lkml.org 
[lkml]   [2019]   [Jun]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] drivers: gpio: pca953x: use subsys_i2c_driver()
Date
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-pca953x.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/drivers/gpio/gpio-pca953x.c b/drivers/gpio/gpio-pca953x.c
index cfe827c..532762d 100644
--- a/drivers/gpio/gpio-pca953x.c
+++ b/drivers/gpio/gpio-pca953x.c
@@ -1202,20 +1202,10 @@ static int pca953x_resume(struct device *dev)
.id_table = pca953x_id,
};

-static int __init pca953x_init(void)
-{
- return i2c_add_driver(&pca953x_driver);
-}
/* register after i2c postcore initcall and before
* subsys initcalls that may rely on these GPIOs
*/
-subsys_initcall(pca953x_init);
-
-static void __exit pca953x_exit(void)
-{
- i2c_del_driver(&pca953x_driver);
-}
-module_exit(pca953x_exit);
+subsys_i2c_driver(pca953x_driver);

MODULE_AUTHOR("eric miao <eric.miao@marvell.com>");
MODULE_DESCRIPTION("GPIO expander driver for PCA953x");
--
1.9.1
\
 
 \ /
  Last update: 2019-06-17 20:41    [W:0.139 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site