From: Linus Walleij Date: Wed, 26 Jun 2019 08:09:00 +0000 (+0200) Subject: gpio: siox: Do not call gpiochip_remove() on errorpath X-Git-Tag: v5.3-rc1~176^2~21 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=4c0a8899d9c215633ef79805c68b2566c775d43d;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-siox.c b/drivers/gpio/gpio-siox.c index fb4e318ab0286..0b44501188654 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) if (ret) { dev_err(&sdevice->dev, "Failed to register gpio chip (%d)\n", ret); - goto err_gpiochip; + return ret; } ret = gpiochip_irqchip_add(&ddata->gchip, &ddata->ichip, 0, handle_level_irq, IRQ_TYPE_EDGE_RISING); - if (ret) { + if (ret) dev_err(&sdevice->dev, "Failed to register irq chip (%d)\n", ret); -err_gpiochip: - gpiochip_remove(&ddata->gchip); - } return ret; }