Commit 12ba4082 authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Linus Walleij

pinctrl: adi2: Use devm_pinctrl_register() for pinctrl registration

Use devm_pinctrl_register() for pin control registration and remove
the need of .remove callback.
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent f3abcb66
...@@ -1058,7 +1058,8 @@ static int adi_pinctrl_probe(struct platform_device *pdev) ...@@ -1058,7 +1058,8 @@ static int adi_pinctrl_probe(struct platform_device *pdev)
adi_pinmux_desc.npins = pinctrl->soc->npins; adi_pinmux_desc.npins = pinctrl->soc->npins;
/* Now register the pin controller and all pins it handles */ /* Now register the pin controller and all pins it handles */
pinctrl->pctl = pinctrl_register(&adi_pinmux_desc, &pdev->dev, pinctrl); pinctrl->pctl = devm_pinctrl_register(&pdev->dev, &adi_pinmux_desc,
pinctrl);
if (IS_ERR(pinctrl->pctl)) { if (IS_ERR(pinctrl->pctl)) {
dev_err(&pdev->dev, "could not register pinctrl ADI2 driver\n"); dev_err(&pdev->dev, "could not register pinctrl ADI2 driver\n");
return PTR_ERR(pinctrl->pctl); return PTR_ERR(pinctrl->pctl);
...@@ -1069,18 +1070,8 @@ static int adi_pinctrl_probe(struct platform_device *pdev) ...@@ -1069,18 +1070,8 @@ static int adi_pinctrl_probe(struct platform_device *pdev)
return 0; return 0;
} }
static int adi_pinctrl_remove(struct platform_device *pdev)
{
struct adi_pinctrl *pinctrl = platform_get_drvdata(pdev);
pinctrl_unregister(pinctrl->pctl);
return 0;
}
static struct platform_driver adi_pinctrl_driver = { static struct platform_driver adi_pinctrl_driver = {
.probe = adi_pinctrl_probe, .probe = adi_pinctrl_probe,
.remove = adi_pinctrl_remove,
.driver = { .driver = {
.name = DRIVER_NAME, .name = DRIVER_NAME,
}, },
......
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