summaryrefslogtreecommitdiffstats
path: root/Documentation/driver-model
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2015-09-25 17:29:04 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-05 05:02:40 +0100
commitdbe2256ddd8e8420c254c79f4045c41cb5f4bd6b (patch)
treee90776bacb2349a6828b4e079aa131ff5293a61d /Documentation/driver-model
parent7568fb63f57ac8672f8bf2018171255441238882 (diff)
downloadlinux-dbe2256ddd8e8420c254c79f4045c41cb5f4bd6b.tar.bz2
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 'Documentation/driver-model')
-rw-r--r--Documentation/driver-model/platform.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt
index 07795ec51cde..e456696cfef2 100644
--- a/Documentation/driver-model/platform.txt
+++ b/Documentation/driver-model/platform.txt
@@ -63,6 +63,20 @@ runtime memory footprint:
int platform_driver_probe(struct platform_driver *drv,
int (*probe)(struct platform_device *))
+Kernel modules can be composed of several platform drivers. The platform core
+provides helpers to register and unregister an array of drivers:
+
+ 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);
+
+If one of the drivers fails to register, all drivers registered up to that
+point will be unregistered in reverse order. Note that there is a convenience
+macro that passes THIS_MODULE as owner parameter:
+
+ #define platform_register_driver(drivers, count)
+
Device Enumeration
~~~~~~~~~~~~~~~~~~