]> git.karo-electronics.de Git - linux-beck.git/commitdiff
pinctrl: palmas: Use devm_pinctrl_register() for pinctrl registration
authorLaxman Dewangan <ldewangan@nvidia.com>
Wed, 24 Feb 2016 09:14:07 +0000 (14:44 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 21 Apr 2016 07:23:23 +0000 (09:23 +0200)
Use devm_pinctrl_register() for pin control registration and
remove the need of .remove callback.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-palmas.c

index 8f0163feda28023e1a16912b3e1bb478505c511c..8edb3f8c72c820eea3814f4defd01a8891ecd442 100644 (file)
@@ -1043,7 +1043,8 @@ static int palmas_pinctrl_probe(struct platform_device *pdev)
        palmas_pinctrl_desc.name = dev_name(&pdev->dev);
        palmas_pinctrl_desc.pins = palmas_pins_desc;
        palmas_pinctrl_desc.npins = ARRAY_SIZE(palmas_pins_desc);
-       pci->pctl = pinctrl_register(&palmas_pinctrl_desc, &pdev->dev, pci);
+       pci->pctl = devm_pinctrl_register(&pdev->dev, &palmas_pinctrl_desc,
+                                         pci);
        if (IS_ERR(pci->pctl)) {
                dev_err(&pdev->dev, "Couldn't register pinctrl driver\n");
                return PTR_ERR(pci->pctl);
@@ -1051,21 +1052,12 @@ static int palmas_pinctrl_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int palmas_pinctrl_remove(struct platform_device *pdev)
-{
-       struct palmas_pctrl_chip_info *pci = platform_get_drvdata(pdev);
-
-       pinctrl_unregister(pci->pctl);
-       return 0;
-}
-
 static struct platform_driver palmas_pinctrl_driver = {
        .driver = {
                .name = "palmas-pinctrl",
                .of_match_table = palmas_pinctrl_of_match,
        },
        .probe = palmas_pinctrl_probe,
-       .remove = palmas_pinctrl_remove,
 };
 
 module_platform_driver(palmas_pinctrl_driver);