Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1339522 > unrolled thread

[PATCH 61/61] gpio: xgene: Use devm_gpiochip_add_data() for gpio registration

Started byLaxman Dewangan <ldewangan@nvidia.com>
First post2016-02-22 15:30 +0100
Last post2016-02-22 15:30 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 61/61] gpio: xgene: Use devm_gpiochip_add_data() for gpio registration Laxman Dewangan <ldewangan@nvidia.com> - 2016-02-22 15:30 +0100

#1339522 — [PATCH 61/61] gpio: xgene: Use devm_gpiochip_add_data() for gpio registration

FromLaxman Dewangan <ldewangan@nvidia.com>
Date2016-02-22 15:30 +0100
Subject[PATCH 61/61] gpio: xgene: Use devm_gpiochip_add_data() for gpio registration
Message-ID<r4ZET-741-35@gated-at.bofh.it>
Use devm_gpiochip_add_data() for GPIO registration and remove the
need of driver callback .remove.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 drivers/gpio/gpio-xgene.c | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git a/drivers/gpio/gpio-xgene.c b/drivers/gpio/gpio-xgene.c
index 592e9cd..c0aa387 100644
--- a/drivers/gpio/gpio-xgene.c
+++ b/drivers/gpio/gpio-xgene.c
@@ -193,7 +193,7 @@ static int xgene_gpio_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, gpio);
 
-	err = gpiochip_add_data(&gpio->chip, gpio);
+	err = devm_gpiochip_add_data(&pdev->dev, &gpio->chip, gpio);
 	if (err) {
 		dev_err(&pdev->dev,
 			"failed to register gpiochip.\n");
@@ -207,14 +207,6 @@ err:
 	return err;
 }
 
-static int xgene_gpio_remove(struct platform_device *pdev)
-{
-	struct xgene_gpio *gpio = platform_get_drvdata(pdev);
-
-	gpiochip_remove(&gpio->chip);
-	return 0;
-}
-
 static const struct of_device_id xgene_gpio_of_match[] = {
 	{ .compatible = "apm,xgene-gpio", },
 	{},
@@ -228,7 +220,6 @@ static struct platform_driver xgene_gpio_driver = {
 		.pm     = XGENE_GPIO_PM_OPS,
 	},
 	.probe = xgene_gpio_probe,
-	.remove = xgene_gpio_remove,
 };
 
 module_platform_driver(xgene_gpio_driver);
-- 
2.1.4

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web