Skip to contentSkip to conversation

i2c: convert gpio-i2cmux to use module_platform_driver()

PATCH Applied Axel Lin 3 participants 3 messages Jan 8, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 i2c: convert gpio-i2cmux to use module_platform_driver()

This patch converts gpio-i2cmux to use the module_platform_driver() macro which makes the code smaller and a bit simpler.

---
 drivers/i2c/muxes/gpio-i2cmux.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
drivers/i2c/muxes/gpio-i2cmux.c +1 -12
index 7b6ce62..e5fa695 100644
@@ -165,18 +165,7 @@ static struct platform_driver gpiomux_driver = {
 	},
 };
 
-static int __init gpiomux_init(void)
-{
-	return platform_driver_register(&gpiomux_driver);
-}
-
-static void __exit gpiomux_exit(void)
-{
-	platform_driver_unregister(&gpiomux_driver);
-}
-
-module_init(gpiomux_init);
-module_exit(gpiomux_exit);
+module_platform_driver(gpiomux_driver);
 
 MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver");
 MODULE_AUTHOR("Peter Korsgaard <peter.korsgaard-ob4gmnvZ1/[email protected]>");
Signature · 1 line
1.7.5.4
Applied
#1 lore raw
Quoted 22 lines · Axel Lin

This patch converts gpio-i2cmux to use the module_platform_driver() macro which makes the code smaller and a bit simpler.

---
 drivers/i2c/muxes/gpio-i2cmux.c |   13 +------------
 1 files changed, 1 insertions(+), 12 deletions(-)
drivers/i2c/muxes/gpio-i2cmux.c +0 -6
index 7b6ce62..e5fa695 100644
@@ -165,18 +165,7 @@ static struct platform_driver gpiomux_driver = {
 	},
 };
 
-static int __init gpiomux_init(void)
-{
-	return platform_driver_register(&gpiomux_driver);
-}
-
-static void __exit gpiomux_exit(void)

drivers/i2c/muxes/gpio-i2cmux.c static struct platform_driver gpiomux_driver = { · line 171

Quoted 10 lines
drivers/i2c/muxes/gpio-i2cmux.c +1 -6
-{
-	platform_driver_unregister(&gpiomux_driver);
-}
-
-module_init(gpiomux_init);
-module_exit(gpiomux_exit);
+module_platform_driver(gpiomux_driver);
 
 MODULE_DESCRIPTION("GPIO-based I2C multiplexer driver");
 MODULE_AUTHOR("Peter Korsgaard <[email protected]>");

Applied, thanks!

Signature · 1 line
Jean Delvare
Acked-by on v1 1/1
#2 lore raw
In reply to Axel Lin
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"AL" == Axel Lin <[email protected]> writes:

AL> This patch converts gpio-i2cmux to use the module_platform_driver() macro which AL> makes the code smaller and a bit simpler.

AL> Signed-off-by: Axel Lin <[email protected]>

Signature · 6 lines
Sorry about disclaimer - It's out of my control.
Bye, Peter Korsgaard


DISCLAIMER:
Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you.