Skip to contentSkip to conversation

i2c: pxa: use module_platform_driver() replace init/exit

RFC PATCH In review Libo Chen 3 participants 4 messages May 23, 2013 – Jun 12, 2013 I2C subsystem host drivers

lore
Share & tools
lore

Libo Chen

author
#0 lore raw

RFC PATCH v3 3/3 i2c: pxa: use module_platform_driver() replace init/exit

use module_platform_driver() macro to replace the module init/exit

---
 drivers/i2c/busses/i2c-pxa.c |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
drivers/i2c/busses/i2c-pxa.c +1 -9
index 7b10102..e9c3524 100644
@@ -1242,15 +1242,7 @@ static struct platform_driver i2c_pxa_driver = {
 	.id_table	= i2c_pxa_id_table,
 };
 
-static int __init i2c_adap_pxa_init(void)
-{
-	return platform_driver_register(&i2c_pxa_driver);
-}
-
-static void __exit i2c_adap_pxa_exit(void)
-{
-	platform_driver_unregister(&i2c_pxa_driver);
-}
+module_platform_driver(i2c_pxa_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_ALIAS("platform:pxa2xx-i2c");
Signature · 1 line
1.7.1
#1 lore raw

maybe I make a mistake, please drop it.

Quoted 28 lines · Libo Chen

use module_platform_driver() macro to replace the module init/exit

---
  drivers/i2c/busses/i2c-pxa.c |   10 +---------
  1 files changed, 1 insertions(+), 9 deletions(-)
drivers/i2c/busses/i2c-pxa.c +1 -9
index 7b10102..e9c3524 100644
@@ -1242,15 +1242,7 @@ static struct platform_driver i2c_pxa_driver = {
  	.id_table	= i2c_pxa_id_table,
  };
 
-static int __init i2c_adap_pxa_init(void)
-{
-	return platform_driver_register(&i2c_pxa_driver);
-}
-
-static void __exit i2c_adap_pxa_exit(void)
-{
-	platform_driver_unregister(&i2c_pxa_driver);
-}
+module_platform_driver(i2c_pxa_driver);
 
  MODULE_LICENSE("GPL");
  MODULE_ALIAS("platform:pxa2xx-i2c");
#2 lore raw
Quoted 1 line · Libo Chen

maybe I make a mistake, please drop it.

Which mistake?

#3 lore raw
Quoted 4 lines · Wolfram Sang
Quoted 1 line · Libo Chen

maybe I make a mistake, please drop it.

Which mistake?

Wrong window, now I see it.