From: Charles Keepax Date: Wed, 22 Mar 2017 17:15:35 +0000 (+0000) Subject: pinctrl: samsung: Use devres version of gpiochip_add_data X-Git-Tag: v4.14-rc1~1023^2~22^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f69ae4f58a198ad15b0422637434d2bcf6fc2e2a;p=platform%2Fkernel%2Flinux-rpi.git pinctrl: samsung: Use devres version of gpiochip_add_data Use devm_gpiochip_add_data to simplify the error path in samsung_gpiolib_register. Signed-off-by: Charles Keepax Signed-off-by: Krzysztof Kozlowski --- diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 5d53370..934fc3b 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -936,20 +936,15 @@ static int samsung_gpiolib_register(struct platform_device *pdev, gc->of_node = bank->of_node; gc->label = bank->name; - ret = gpiochip_add_data(gc, bank); + ret = devm_gpiochip_add_data(&pdev->dev, gc, bank); if (ret) { dev_err(&pdev->dev, "failed to register gpio_chip %s, error code: %d\n", gc->label, ret); - goto fail; + return ret; } } return 0; - -fail: - for (--i, --bank; i >= 0; --i, --bank) - gpiochip_remove(&bank->gpio_chip); - return ret; } /* retrieve the soc specific data */