diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2016-02-24 14:44:07 +0530 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2016-04-21 09:23:21 +0200 |
commit | 4d106c2282804e7247e97314d97f8ec5d2d66dab (patch) | |
tree | 8f373700e9c55b4eb372e73392372f53d679e7bb /drivers/pinctrl | |
parent | 251e22abde21833b3d29577e4d8c7aaccd650eee (diff) | |
download | op-kernel-dev-4d106c2282804e7247e97314d97f8ec5d2d66dab.zip op-kernel-dev-4d106c2282804e7247e97314d97f8ec5d2d66dab.tar.gz |
pinctrl: as3722: Use devm_pinctrl_register() for pinctrl registration
Use devm_pinctrl_register() for pin control registration and clean
error path.
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-as3722.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/pinctrl/pinctrl-as3722.c b/drivers/pinctrl/pinctrl-as3722.c index 1070bb9..4e9fe78 100644 --- a/drivers/pinctrl/pinctrl-as3722.c +++ b/drivers/pinctrl/pinctrl-as3722.c @@ -569,8 +569,8 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) as3722_pinctrl_desc.name = dev_name(&pdev->dev); as3722_pinctrl_desc.pins = as3722_pins_desc; as3722_pinctrl_desc.npins = ARRAY_SIZE(as3722_pins_desc); - as_pci->pctl = pinctrl_register(&as3722_pinctrl_desc, - &pdev->dev, as_pci); + as_pci->pctl = devm_pinctrl_register(&pdev->dev, &as3722_pinctrl_desc, + as_pci); if (IS_ERR(as_pci->pctl)) { dev_err(&pdev->dev, "Couldn't register pinctrl driver\n"); return PTR_ERR(as_pci->pctl); @@ -582,7 +582,7 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) ret = gpiochip_add_data(&as_pci->gpio_chip, as_pci); if (ret < 0) { dev_err(&pdev->dev, "Couldn't register gpiochip, %d\n", ret); - goto fail_chip_add; + return ret; } ret = gpiochip_add_pin_range(&as_pci->gpio_chip, dev_name(&pdev->dev), @@ -596,8 +596,6 @@ static int as3722_pinctrl_probe(struct platform_device *pdev) fail_range_add: gpiochip_remove(&as_pci->gpio_chip); -fail_chip_add: - pinctrl_unregister(as_pci->pctl); return ret; } @@ -606,7 +604,6 @@ static int as3722_pinctrl_remove(struct platform_device *pdev) struct as3722_pctrl_info *as_pci = platform_get_drvdata(pdev); gpiochip_remove(&as_pci->gpio_chip); - pinctrl_unregister(as_pci->pctl); return 0; } |