summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-12-30 05:11:20 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-03-08 02:04:46 +0100
commitecdf6ceb8cf4756bd4214bf9755755752b6015f5 (patch)
tree828af56bdfe60396e77bbc05f28e231ffe70fe9b /include
parentkset-example: Spelling fixes. (diff)
downloadlinux-ecdf6ceb8cf4756bd4214bf9755755752b6015f5.tar.xz
linux-ecdf6ceb8cf4756bd4214bf9755755752b6015f5.zip
Driver core: add platform_create_bundle() helper
Many legacy-style module create singleton platform devices themselves, along with corresponding platform driver. Instead of replicating error handling code in all such drivers, provide a helper that allocates and registers a single platform device and a driver and binds them together. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/platform_device.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 71ff887ca44e..25e64b43e644 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -77,6 +77,11 @@ extern int platform_driver_probe(struct platform_driver *driver,
#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
+extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
+ int (*probe)(struct platform_device *),
+ struct resource *res, unsigned int n_res,
+ const void *data, size_t size);
+
/* early platform driver interface */
struct early_platform_driver {
const char *class_str;