linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: linux-gpio@vger.kernel.org
Cc: "Bartosz Golaszewski" <bgolaszewski@baylibre.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Subject: [PATCH 5/5] gpio: siox: Use devm_ managed gpiochip
Date: Wed, 26 Jun 2019 10:44:07 +0200	[thread overview]
Message-ID: <20190626084407.27976-5-linus.walleij@linaro.org> (raw)
In-Reply-To: <20190626084407.27976-1-linus.walleij@linaro.org>

By using devm_gpiochip_add_data() we can get rid of the
remove() callback. As this driver doesn't use the
gpiochip data pointer we simply pass in NULL.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/gpio/gpio-siox.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c
index f85f1fab781f..5e3861c1ad99 100644
--- a/drivers/gpio/gpio-siox.c
+++ b/drivers/gpio/gpio-siox.c
@@ -246,7 +246,7 @@ static int gpio_siox_probe(struct siox_device *sdevice)
 	girq->default_type = IRQ_TYPE_NONE;
 	girq->handler = handle_level_irq;
 
-	ret = gpiochip_add(&ddata->gchip);
+	ret = devm_gpiochip_add_data(dev, &ddata->gchip, NULL);
 	if (ret) {
 		dev_err(dev, "Failed to register gpio chip (%d)\n", ret);
 		return ret;
@@ -255,17 +255,8 @@ static int gpio_siox_probe(struct siox_device *sdevice)
 	return 0;
 }
 
-static int gpio_siox_remove(struct siox_device *sdevice)
-{
-	struct gpio_siox_ddata *ddata = dev_get_drvdata(&sdevice->dev);
-
-	gpiochip_remove(&ddata->gchip);
-	return 0;
-}
-
 static struct siox_driver gpio_siox_driver = {
 	.probe = gpio_siox_probe,
-	.remove = gpio_siox_remove,
 	.set_data = gpio_siox_set_data,
 	.get_data = gpio_siox_get_data,
 	.driver = {
-- 
2.20.1


  parent reply	other threads:[~2019-06-26  8:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-26  8:44 [PATCH 1/5] gpio: siox: Do not call gpiochip_remove() on errorpath Linus Walleij
2019-06-26  8:44 ` [PATCH 2/5] gpio: siox: Switch to IRQ_TYPE_NONE Linus Walleij
2019-06-26  9:12   ` Uwe Kleine-König
2019-06-26  8:44 ` [PATCH 3/5] gpio: siox: Pass irqchip when adding gpiochip Linus Walleij
2019-06-26  9:16   ` Uwe Kleine-König
2019-06-26  8:44 ` [PATCH 4/5] gpio: siox: Add struct device *dev helper variable Linus Walleij
2019-06-26  9:13   ` Uwe Kleine-König
2019-06-26  8:44 ` Linus Walleij [this message]
2019-06-26  9:14   ` [PATCH 5/5] gpio: siox: Use devm_ managed gpiochip Uwe Kleine-König
2019-06-26  9:12 ` [PATCH 1/5] gpio: siox: Do not call gpiochip_remove() on errorpath Uwe Kleine-König
2019-06-26 11:49   ` Linus Walleij

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=20190626084407.27976-5-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=linux-gpio@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.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).