aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThierry Reding2015-09-25 17:29:04 +0200
committerGreg Kroah-Hartman2015-10-05 05:02:40 +0100
commitdbe2256ddd8e8420c254c79f4045c41cb5f4bd6b (patch)
treee90776bacb2349a6828b4e079aa131ff5293a61d /include
parent7568fb63f57ac8672f8bf2018171255441238882 (diff)
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')
-rw-r--r--include/linux/platform_device.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index bba08f44cc97..dc777be5f2e1 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;