summaryrefslogtreecommitdiffstats
path: root/include/linux/platform_device.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/platform_device.h')
-rw-r--r--include/linux/platform_device.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 9abf1db6aea6..ce8e4ffd78c7 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -180,7 +180,16 @@ struct platform_driver {
const struct platform_device_id *id_table;
};
-extern int platform_driver_register(struct platform_driver *);
+#define to_platform_driver(drv) (container_of((drv), struct platform_driver, \
+ driver))
+
+/*
+ * use a macro to avoid include chaining to get THIS_MODULE
+ */
+#define platform_driver_register(drv) \
+ __platform_driver_register(drv, THIS_MODULE)
+extern int __platform_driver_register(struct platform_driver *,
+ struct module *);
extern void platform_driver_unregister(struct platform_driver *);
/* non-hotpluggable platform devices may use this so that probe() and