Commit 7cf061fa authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Linus Walleij

pinctrl: cherryview: Use devm_pinctrl_register() for pinctrl registration

Use devm_pinctrl_register() for pin control registration and clean
error path.
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Cc: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e55e025d
...@@ -1526,17 +1526,16 @@ static int chv_pinctrl_probe(struct platform_device *pdev) ...@@ -1526,17 +1526,16 @@ static int chv_pinctrl_probe(struct platform_device *pdev)
pctrl->pctldesc.pins = pctrl->community->pins; pctrl->pctldesc.pins = pctrl->community->pins;
pctrl->pctldesc.npins = pctrl->community->npins; pctrl->pctldesc.npins = pctrl->community->npins;
pctrl->pctldev = pinctrl_register(&pctrl->pctldesc, &pdev->dev, pctrl); pctrl->pctldev = devm_pinctrl_register(&pdev->dev, &pctrl->pctldesc,
pctrl);
if (IS_ERR(pctrl->pctldev)) { if (IS_ERR(pctrl->pctldev)) {
dev_err(&pdev->dev, "failed to register pinctrl driver\n"); dev_err(&pdev->dev, "failed to register pinctrl driver\n");
return PTR_ERR(pctrl->pctldev); return PTR_ERR(pctrl->pctldev);
} }
ret = chv_gpio_probe(pctrl, irq); ret = chv_gpio_probe(pctrl, irq);
if (ret) { if (ret)
pinctrl_unregister(pctrl->pctldev);
return ret; return ret;
}
platform_set_drvdata(pdev, pctrl); platform_set_drvdata(pdev, pctrl);
...@@ -1548,7 +1547,6 @@ static int chv_pinctrl_remove(struct platform_device *pdev) ...@@ -1548,7 +1547,6 @@ static int chv_pinctrl_remove(struct platform_device *pdev)
struct chv_pinctrl *pctrl = platform_get_drvdata(pdev); struct chv_pinctrl *pctrl = platform_get_drvdata(pdev);
gpiochip_remove(&pctrl->chip); gpiochip_remove(&pctrl->chip);
pinctrl_unregister(pctrl->pctldev);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment