diff options
author | Cornelia Huck <cornelia.huck@de.ibm.com> | 2008-01-26 08:10:41 -0500 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2008-01-26 08:10:58 -0500 |
commit | 25b7bb5838ab81b68a9de72df577103d8b4aba3c (patch) | |
tree | ccbef7d152370e7a770788c103776af0fbe7fc47 /drivers/s390/cio/css.c | |
parent | 98c13c283a4e8b7f844f1f470abd7c756248fcc4 (diff) |
[S390] cio: Add css_driver_{register,unregister}.
Add wrapper functions for driver_register and driver_unregister so
that css drivers don't need to muck with struct device_driver
directly.
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/css.c')
-rw-r--r-- | drivers/s390/cio/css.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index f558686a66dd..7d887f88bb73 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -837,6 +837,33 @@ struct bus_type css_bus_type = { | |||
837 | .shutdown = css_shutdown, | 837 | .shutdown = css_shutdown, |
838 | }; | 838 | }; |
839 | 839 | ||
840 | /** | ||
841 | * css_driver_register - register a css driver | ||
842 | * @cdrv: css driver to register | ||
843 | * | ||
844 | * This is mainly a wrapper around driver_register that sets name | ||
845 | * and bus_type in the embedded struct device_driver correctly. | ||
846 | */ | ||
847 | int css_driver_register(struct css_driver *cdrv) | ||
848 | { | ||
849 | cdrv->drv.name = cdrv->name; | ||
850 | cdrv->drv.bus = &css_bus_type; | ||
851 | return driver_register(&cdrv->drv); | ||
852 | } | ||
853 | EXPORT_SYMBOL_GPL(css_driver_register); | ||
854 | |||
855 | /** | ||
856 | * css_driver_unregister - unregister a css driver | ||
857 | * @cdrv: css driver to unregister | ||
858 | * | ||
859 | * This is a wrapper around driver_unregister. | ||
860 | */ | ||
861 | void css_driver_unregister(struct css_driver *cdrv) | ||
862 | { | ||
863 | driver_unregister(&cdrv->drv); | ||
864 | } | ||
865 | EXPORT_SYMBOL_GPL(css_driver_unregister); | ||
866 | |||
840 | subsys_initcall(init_channel_subsystem); | 867 | subsys_initcall(init_channel_subsystem); |
841 | 868 | ||
842 | MODULE_LICENSE("GPL"); | 869 | MODULE_LICENSE("GPL"); |