From: Andy Shevchenko Date: Sun, 19 Jun 2016 20:49:57 +0000 (+0300) Subject: gpio: intel-mid: switch to devm_gpiochip_add_data() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=dd3b204af11b50be6dc77e18b88b3c646bba354c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git gpio: intel-mid: switch to devm_gpiochip_add_data() The error handling is not correct since the commit 3f7dbfd8eea9 ("gpio: intel-mid: switch to using gpiolib irqchip helpers"). Switch to devres API to fix the potential resource leak. Fixes: commit 3f7dbfd8eea9 ("gpio: intel-mid: switch to using gpiolib irqchip helpers") Signed-off-by: Andy Shevchenko Signed-off-by: Linus Walleij --- diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c index cdaba13cb8e8..a99cf4b9395c 100644 --- a/drivers/gpio/gpio-intel-mid.c +++ b/drivers/gpio/gpio-intel-mid.c @@ -401,7 +401,7 @@ static int intel_gpio_probe(struct pci_dev *pdev, spin_lock_init(&priv->lock); pci_set_drvdata(pdev, priv); - retval = gpiochip_add_data(&priv->chip, priv); + retval = devm_gpiochip_add_data(&pdev->dev, &priv->chip, priv); if (retval) { dev_err(&pdev->dev, "gpiochip_add error %d\n", retval); return retval;