diff mbox series

[4/5] gpio: siox: Add struct device *dev helper variable

Message ID 20190626084407.27976-4-linus.walleij@linaro.org
State Accepted
Commit acc141374df40abd24ed5e128c8a3eb43805a688
Headers show
Series [1/5] gpio: siox: Do not call gpiochip_remove() on errorpath | expand

Commit Message

Linus Walleij June 26, 2019, 8:44 a.m. UTC
This makes the code easier to read.

Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

---
 drivers/gpio/gpio-siox.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
2.20.1

Comments

Uwe Kleine-König June 26, 2019, 9:13 a.m. UTC | #1
On Wed, Jun 26, 2019 at 10:44:06AM +0200, Linus Walleij wrote:
> This makes the code easier to read.

> 

> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>


fine,

Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>


Thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c
index 31749c058e33..f85f1fab781f 100644
--- a/drivers/gpio/gpio-siox.c
+++ b/drivers/gpio/gpio-siox.c
@@ -212,20 +212,21 @@  static int gpio_siox_probe(struct siox_device *sdevice)
 {
 	struct gpio_siox_ddata *ddata;
 	struct gpio_irq_chip *girq;
+	struct device *dev = &sdevice->dev;
 	int ret;
 
-	ddata = devm_kzalloc(&sdevice->dev, sizeof(*ddata), GFP_KERNEL);
+	ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
 	if (!ddata)
 		return -ENOMEM;
 
-	dev_set_drvdata(&sdevice->dev, ddata);
+	dev_set_drvdata(dev, ddata);
 
 	mutex_init(&ddata->lock);
 	spin_lock_init(&ddata->irqlock);
 
 	ddata->gchip.base = -1;
 	ddata->gchip.can_sleep = 1;
-	ddata->gchip.parent = &sdevice->dev;
+	ddata->gchip.parent = dev;
 	ddata->gchip.owner = THIS_MODULE;
 	ddata->gchip.get = gpio_siox_get;
 	ddata->gchip.set = gpio_siox_set;
@@ -247,8 +248,7 @@  static int gpio_siox_probe(struct siox_device *sdevice)
 
 	ret = gpiochip_add(&ddata->gchip);
 	if (ret) {
-		dev_err(&sdevice->dev,
-			"Failed to register gpio chip (%d)\n", ret);
+		dev_err(dev, "Failed to register gpio chip (%d)\n", ret);
 		return ret;
 	}