Skip to contentSkip to conversation

misc: ep93xx_pwm.c: fix section mismatch and use module_platform_driver

PATCH In review H Hartley Sweeten 4 participants 5 messages Mar 16, 2013 – Mar 25, 2013 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 3/3 misc: ep93xx_pwm.c: fix section mismatch and use module_platform_driver

Remove the __init tags from the ep93xx_pwm_probe() and ep93xx_pwm_remove() functions to fix the section mismatch warnings.

Use module_platform_driver() to remove the init/exit boilerplate.

Cc Ryan Mallon <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/misc/ep93xx_pwm.c | 21 +++++----------------
 1 file changed, 5 insertions(+), 16 deletions(-)
drivers/misc/ep93xx_pwm.c +5 -16
index 16d7179..4a674f6 100644
@@ -269,7 +269,7 @@ static const struct attribute_group ep93xx_pwm_sysfs_files = {
 	.attrs	= ep93xx_pwm_attrs,
 };
 
-static int __init ep93xx_pwm_probe(struct platform_device *pdev)
+static int ep93xx_pwm_probe(struct platform_device *pdev)
 {
 	struct ep93xx_pwm *pwm;
 	struct resource *res;
@@ -339,7 +339,7 @@ fail_no_mem:
 	return err;
 }
 
-static int __exit ep93xx_pwm_remove(struct platform_device *pdev)
+static int ep93xx_pwm_remove(struct platform_device *pdev)
 {
 	struct ep93xx_pwm *pwm = platform_get_drvdata(pdev);
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -362,21 +362,10 @@ static struct platform_driver ep93xx_pwm_driver = {
 		.name	= "ep93xx-pwm",
 		.owner	= THIS_MODULE,
 	},
-	.remove		= __exit_p(ep93xx_pwm_remove),
+	.probe		= ep93xx_pwm_probe,
+	.remove		= ep93xx_pwm_remove,
 };
-
-static int __init ep93xx_pwm_init(void)
-{
-	return platform_driver_probe(&ep93xx_pwm_driver, ep93xx_pwm_probe);
-}
-
-static void __exit ep93xx_pwm_exit(void)
-{
-	platform_driver_unregister(&ep93xx_pwm_driver);
-}
-
-module_init(ep93xx_pwm_init);
-module_exit(ep93xx_pwm_exit);
+module_platform_driver(ep93xx_pwm_driver);
 
 MODULE_AUTHOR("Matthieu Crapet <[email protected]>, "
 	      "H Hartley Sweeten <[email protected]>");
Signature · 1 line
1.8.1.4
maintainer Acked-by on v1 3/3
#1 lore raw
Quoted 10 lines · H Hartley Sweeten

Remove the __init tags from the ep93xx_pwm_probe() and ep93xx_pwm_remove() functions to fix the section mismatch warnings.

Use module_platform_driver() to remove the init/exit boilerplate.

Cc Ryan Mallon <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Acked-by
#2 lore raw
Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · H Hartley Sweeten

Remove the __init tags from the ep93xx_pwm_probe() and ep93xx_pwm_remove() functions to fix the section mismatch warnings.

Quoted 8 lines
Quoted 6 lines

Use module_platform_driver() to remove the init/exit boilerplate.

Cc Ryan Mallon <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>

For the whole series:

Not sure if I should take these in my tree, or if they should be handled by the respective subsystem maintainers. Arnd?

~Ryan

maintainer
#3 lore raw
Quoted 17 lines · Ryan Mallon
Quoted 5 lines · Arnd Bergmann
Quoted 4 lines · H Hartley Sweeten

Remove the __init tags from the ep93xx_pwm_probe() and ep93xx_pwm_remove() functions to fix the section mismatch warnings.

Quoted 8 lines
Quoted 6 lines

Use module_platform_driver() to remove the init/exit boilerplate.

Cc Ryan Mallon <[email protected]>
Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
Quoted 6 lines

For the whole series:

Not sure if I should take these in my tree, or if they should be handled by the respective subsystem maintainers. Arnd?

Doesn't matter much, as there are no dependencies. The default would be to ask the subsystem maintainers to put them into their trees. If that doesn't happen for some reason, I can take them through the arm-soc tree as a fallback.

Arnd