linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Enrico Weigelt, metux IT consult" <info@metux.net>
To: linux-kernel@vger.kernel.org
Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com,
	wsa@the-dreams.de, linux-gpio@vger.kernel.org,
	linux-i2c@vger.kernel.org
Subject: [PATCH 2/3] drivers: gpio: pca953x: use subsys_i2c_driver()
Date: Mon, 17 Jun 2019 20:39:38 +0200	[thread overview]
Message-ID: <1560796779-17117-2-git-send-email-info@metux.net> (raw)
In-Reply-To: <1560796779-17117-1-git-send-email-info@metux.net>

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


  reply	other threads:[~2019-06-17 18:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17 18:39 [PATCH 1/3] include: linux: i2c: more helpers for declaring i2c drivers Enrico Weigelt, metux IT consult
2019-06-17 18:39 ` Enrico Weigelt, metux IT consult [this message]
2019-06-17 18:39 ` [PATCH 3/3] drivers: gpio: pcf857x: use subsys_i2c_driver() Enrico Weigelt, metux IT consult
2019-06-21 21:17 ` [PATCH 1/3] include: linux: i2c: more helpers for declaring i2c drivers Wolfram Sang
2019-06-24  5:44   ` Enrico Weigelt, metux IT consult
2019-06-24  8:44     ` Wolfram Sang
2019-06-24  8:59       ` Enrico Weigelt, metux IT consult
2019-08-16 19:56         ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1560796779-17117-2-git-send-email-info@metux.net \
    --to=info@metux.net \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).