diff options
author | Thierry Reding <treding@nvidia.com> | 2015-09-25 17:29:04 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-10-05 05:02:40 +0100 |
commit | dbe2256ddd8e8420c254c79f4045c41cb5f4bd6b (patch) | |
tree | e90776bacb2349a6828b4e079aa131ff5293a61d /include/linux/platform_device.h | |
parent | 7568fb63f57ac8672f8bf2018171255441238882 (diff) | |
download | op-kernel-dev-dbe2256ddd8e8420c254c79f4045c41cb5f4bd6b.zip op-kernel-dev-dbe2256ddd8e8420c254c79f4045c41cb5f4bd6b.tar.gz |
driver-core: platform: Provide helpers for multi-driver modules
Some modules register several sub-drivers. Provide a helper that makes
it easy to register and unregister a list of sub-drivers, as well as
unwind properly on error.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/platform_device.h')
-rw-r--r-- | include/linux/platform_device.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index bba08f4..dc777be 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -270,6 +270,14 @@ extern struct platform_device *__platform_create_bundle( struct resource *res, unsigned int n_res, const void *data, size_t size, struct module *module); +int __platform_register_drivers(struct platform_driver * const *drivers, + unsigned int count, struct module *owner); +void platform_unregister_drivers(struct platform_driver * const *drivers, + unsigned int count); + +#define platform_register_drivers(drivers, count) \ + __platform_register_drivers(drivers, count, THIS_MODULE) + /* early platform driver interface */ struct early_platform_driver { const char *class_str; |