mdev_driver.c (290aac5df88a83e264b3a73ec146e5e5b3c45793) mdev_driver.c (685a1537f4c603cfcaf4b9be56ff6a571f7ddd08)
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * MDEV driver
4 *
5 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
6 * Author: Neo Jia <cjia@nvidia.com>
7 * Kirti Wankhede <kwankhede@nvidia.com>
8 */

--- 41 unchanged lines hidden (view full) ---

50/**
51 * mdev_register_driver - register a new MDEV driver
52 * @drv: the driver to register
53 *
54 * Returns a negative value on error, otherwise 0.
55 **/
56int mdev_register_driver(struct mdev_driver *drv)
57{
1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * MDEV driver
4 *
5 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
6 * Author: Neo Jia <cjia@nvidia.com>
7 * Kirti Wankhede <kwankhede@nvidia.com>
8 */

--- 41 unchanged lines hidden (view full) ---

50/**
51 * mdev_register_driver - register a new MDEV driver
52 * @drv: the driver to register
53 *
54 * Returns a negative value on error, otherwise 0.
55 **/
56int mdev_register_driver(struct mdev_driver *drv)
57{
58 if (!drv->types_attrs || !drv->device_api)
58 if (!drv->device_api)
59 return -EINVAL;
60
61 /* initialize common driver fields */
62 drv->driver.bus = &mdev_bus_type;
63 return driver_register(&drv->driver);
64}
65EXPORT_SYMBOL(mdev_register_driver);
66
67/*
68 * mdev_unregister_driver - unregister MDEV driver
69 * @drv: the driver to unregister
70 */
71void mdev_unregister_driver(struct mdev_driver *drv)
72{
73 driver_unregister(&drv->driver);
74}
75EXPORT_SYMBOL(mdev_unregister_driver);
59 return -EINVAL;
60
61 /* initialize common driver fields */
62 drv->driver.bus = &mdev_bus_type;
63 return driver_register(&drv->driver);
64}
65EXPORT_SYMBOL(mdev_register_driver);
66
67/*
68 * mdev_unregister_driver - unregister MDEV driver
69 * @drv: the driver to unregister
70 */
71void mdev_unregister_driver(struct mdev_driver *drv)
72{
73 driver_unregister(&drv->driver);
74}
75EXPORT_SYMBOL(mdev_unregister_driver);