summaryrefslogtreecommitdiffstats
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-06-26 04:09:00 -0400
committerLinus Walleij <linus.walleij@linaro.org>2019-06-27 10:56:52 -0400
commit4c0a8899d9c215633ef79805c68b2566c775d43d (patch)
tree699712e9c7161cf7d2fb6f2212a9f55b87932bd8 /drivers/gpio
parent04ce935c6b2a8a802750e6b2beda802b61495b7c (diff)
gpio: siox: Do not call gpiochip_remove() on errorpath
gpiochip_remove() was called on the errorpath if gpiochip_add() failed: this is wrong, if the chip failed to add it is not there so it should not be removed. Fixes: be8c8facc707 ("gpio: new driver to work with a 8x12 siox") Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-siox.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c
index fb4e318ab028..0b4450118865 100644
--- a/drivers/gpio/gpio-siox.c
+++ b/drivers/gpio/gpio-siox.c
@@ -243,17 +243,14 @@ static int gpio_siox_probe(struct siox_device *sdevice)
243 if (ret) { 243 if (ret) {
244 dev_err(&sdevice->dev, 244 dev_err(&sdevice->dev,
245 "Failed to register gpio chip (%d)\n", ret); 245 "Failed to register gpio chip (%d)\n", ret);
246 goto err_gpiochip; 246 return ret;
247 } 247 }
248 248
249 ret = gpiochip_irqchip_add(&ddata->gchip, &ddata->ichip, 249 ret = gpiochip_irqchip_add(&ddata->gchip, &ddata->ichip,
250 0, handle_level_irq, IRQ_TYPE_EDGE_RISING); 250 0, handle_level_irq, IRQ_TYPE_EDGE_RISING);
251 if (ret) { 251 if (ret)
252 dev_err(&sdevice->dev, 252 dev_err(&sdevice->dev,
253 "Failed to register irq chip (%d)\n", ret); 253 "Failed to register irq chip (%d)\n", ret);
254err_gpiochip:
255 gpiochip_remove(&ddata->gchip);
256 }
257 254
258 return ret; 255 return ret;
259} 256}