diff options
-rw-r--r-- | drivers/base/platform.c | 11 | ||||
-rw-r--r-- | include/linux/platform_device.h | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index b2afc29403f9..c87a63326871 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -580,9 +580,10 @@ void platform_driver_unregister(struct platform_driver *drv) | |||
580 | EXPORT_SYMBOL_GPL(platform_driver_unregister); | 580 | EXPORT_SYMBOL_GPL(platform_driver_unregister); |
581 | 581 | ||
582 | /** | 582 | /** |
583 | * platform_driver_probe - register driver for non-hotpluggable device | 583 | * __platform_driver_probe - register driver for non-hotpluggable device |
584 | * @drv: platform driver structure | 584 | * @drv: platform driver structure |
585 | * @probe: the driver probe routine, probably from an __init section | 585 | * @probe: the driver probe routine, probably from an __init section |
586 | * @module: module which will be the owner of the driver | ||
586 | * | 587 | * |
587 | * Use this instead of platform_driver_register() when you know the device | 588 | * Use this instead of platform_driver_register() when you know the device |
588 | * is not hotpluggable and has already been registered, and you want to | 589 | * is not hotpluggable and has already been registered, and you want to |
@@ -598,8 +599,8 @@ EXPORT_SYMBOL_GPL(platform_driver_unregister); | |||
598 | * Returns zero if the driver registered and bound to a device, else returns | 599 | * Returns zero if the driver registered and bound to a device, else returns |
599 | * a negative error code and with the driver not registered. | 600 | * a negative error code and with the driver not registered. |
600 | */ | 601 | */ |
601 | int __init_or_module platform_driver_probe(struct platform_driver *drv, | 602 | int __init_or_module __platform_driver_probe(struct platform_driver *drv, |
602 | int (*probe)(struct platform_device *)) | 603 | int (*probe)(struct platform_device *), struct module *module) |
603 | { | 604 | { |
604 | int retval, code; | 605 | int retval, code; |
605 | 606 | ||
@@ -614,7 +615,7 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv, | |||
614 | 615 | ||
615 | /* temporary section violation during probe() */ | 616 | /* temporary section violation during probe() */ |
616 | drv->probe = probe; | 617 | drv->probe = probe; |
617 | retval = code = platform_driver_register(drv); | 618 | retval = code = __platform_driver_register(drv, module); |
618 | 619 | ||
619 | /* | 620 | /* |
620 | * Fixup that section violation, being paranoid about code scanning | 621 | * Fixup that section violation, being paranoid about code scanning |
@@ -633,7 +634,7 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv, | |||
633 | platform_driver_unregister(drv); | 634 | platform_driver_unregister(drv); |
634 | return retval; | 635 | return retval; |
635 | } | 636 | } |
636 | EXPORT_SYMBOL_GPL(platform_driver_probe); | 637 | EXPORT_SYMBOL_GPL(__platform_driver_probe); |
637 | 638 | ||
638 | /** | 639 | /** |
639 | * platform_create_bundle - register driver and create corresponding device | 640 | * platform_create_bundle - register driver and create corresponding device |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 153d303af7eb..c8d95c60da19 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -197,8 +197,10 @@ extern void platform_driver_unregister(struct platform_driver *); | |||
197 | /* non-hotpluggable platform devices may use this so that probe() and | 197 | /* non-hotpluggable platform devices may use this so that probe() and |
198 | * its support may live in __init sections, conserving runtime memory. | 198 | * its support may live in __init sections, conserving runtime memory. |
199 | */ | 199 | */ |
200 | extern int platform_driver_probe(struct platform_driver *driver, | 200 | #define platform_driver_probe(drv, probe) \ |
201 | int (*probe)(struct platform_device *)); | 201 | __platform_driver_probe(drv, probe, THIS_MODULE) |
202 | extern int __platform_driver_probe(struct platform_driver *driver, | ||
203 | int (*probe)(struct platform_device *), struct module *module); | ||
202 | 204 | ||
203 | static inline void *platform_get_drvdata(const struct platform_device *pdev) | 205 | static inline void *platform_get_drvdata(const struct platform_device *pdev) |
204 | { | 206 | { |