diff mbox series

[29/30] drivers: gpio: max7300: use arch_platform_driver()

Message ID 1560796871-18560-29-git-send-email-info@metux.net (mailing list archive)
State New, archived
Headers show
Series [01/30] include: linux: platform_device: more helpers for declaring platform drivers | expand

Commit Message

Enrico Weigelt, metux IT consult June 17, 2019, 6:41 p.m. UTC
From: Enrico Weigelt <info@metux.net>

Reduce driver init boilerplate by using the new
subsys_i2c_driver() macro.

Signed-off-by: Enrico Weigelt <info@metux.net>
---
 drivers/gpio/gpio-max7300.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-max7300.c b/drivers/gpio/gpio-max7300.c
index 1ae9ba8..36d5afa 100644
--- a/drivers/gpio/gpio-max7300.c
+++ b/drivers/gpio/gpio-max7300.c
@@ -70,18 +70,7 @@  static int max7300_remove(struct i2c_client *client)
 	.remove = max7300_remove,
 	.id_table = max7300_id,
 };
-
-static int __init max7300_init(void)
-{
-	return i2c_add_driver(&max7300_driver);
-}
-subsys_initcall(max7300_init);
-
-static void __exit max7300_exit(void)
-{
-	i2c_del_driver(&max7300_driver);
-}
-module_exit(max7300_exit);
+subsys_i2c_driver(max7300_driver);
 
 MODULE_AUTHOR("Wolfram Sang");
 MODULE_LICENSE("GPL v2");