diff options
author | Charles Keepax <ckeepax@opensource.wolfsonmicro.com> | 2017-03-22 17:15:35 +0000 |
---|---|---|
committer | Krzysztof Kozlowski <krzk@kernel.org> | 2017-03-23 21:13:19 +0200 |
commit | f69ae4f58a198ad15b0422637434d2bcf6fc2e2a (patch) | |
tree | 90750cb9c17e0a6f0abe0ee72120c16e2fe0063a /drivers/pinctrl | |
parent | 1abd18d1a51a95bf90c10459f1ed5c692660408e (diff) | |
download | op-kernel-dev-f69ae4f58a198ad15b0422637434d2bcf6fc2e2a.zip op-kernel-dev-f69ae4f58a198ad15b0422637434d2bcf6fc2e2a.tar.gz |
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 <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/samsung/pinctrl-samsung.c | 9 |
1 files changed, 2 insertions, 7 deletions
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 */ |