Commit 356d8009 authored by Christopher Bostic's avatar Christopher Bostic Committed by Greg Kroah-Hartman

drivers/fsi: Add client driver register utilities

Add driver_register and driver_unregister wrappers for FSI.
Signed-off-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 777dcf73
...@@ -586,6 +586,23 @@ static int fsi_bus_match(struct device *dev, struct device_driver *drv) ...@@ -586,6 +586,23 @@ static int fsi_bus_match(struct device *dev, struct device_driver *drv)
return 0; return 0;
} }
int fsi_driver_register(struct fsi_driver *fsi_drv)
{
if (!fsi_drv)
return -EINVAL;
if (!fsi_drv->id_table)
return -EINVAL;
return driver_register(&fsi_drv->drv);
}
EXPORT_SYMBOL_GPL(fsi_driver_register);
void fsi_driver_unregister(struct fsi_driver *fsi_drv)
{
driver_unregister(&fsi_drv->drv);
}
EXPORT_SYMBOL_GPL(fsi_driver_unregister);
struct bus_type fsi_bus_type = { struct bus_type fsi_bus_type = {
.name = "fsi", .name = "fsi",
.match = fsi_bus_match, .match = fsi_bus_match,
......
...@@ -54,6 +54,18 @@ struct fsi_driver { ...@@ -54,6 +54,18 @@ struct fsi_driver {
#define to_fsi_dev(devp) container_of(devp, struct fsi_device, dev) #define to_fsi_dev(devp) container_of(devp, struct fsi_device, dev)
#define to_fsi_drv(drvp) container_of(drvp, struct fsi_driver, drv) #define to_fsi_drv(drvp) container_of(drvp, struct fsi_driver, drv)
extern int fsi_driver_register(struct fsi_driver *fsi_drv);
extern void fsi_driver_unregister(struct fsi_driver *fsi_drv);
/* module_fsi_driver() - Helper macro for drivers that don't do
* anything special in module init/exit. This eliminates a lot of
* boilerplate. Each module may only use this macro once, and
* calling it replaces module_init() and module_exit()
*/
#define module_fsi_driver(__fsi_driver) \
module_driver(__fsi_driver, fsi_driver_register, \
fsi_driver_unregister)
extern struct bus_type fsi_bus_type; extern struct bus_type fsi_bus_type;
#endif /* LINUX_FSI_H */ #endif /* LINUX_FSI_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment