pinctrl: zynq: 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:27 +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>
Cc: Michal Simek <michal.simek@xilinx.com>
Cc: Sören Brinkmann <soren.brinkmann@xilinx.com>
Cc: linux-gpio@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Sören Brinkmann <soren.brinkmann@xilinx.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/core.c
drivers/pinctrl/pinctrl-zynq.c

index 21df52e8192a1bb65c6512fd7669e3b59ed385a4..98d2a1bb44cb2a2c979ce8d428325f47da354f5b 100644 (file)
@@ -1883,7 +1883,7 @@ static int devm_pinctrl_dev_match(struct device *dev, void *res, void *data)
 {
        struct pctldev **r = res;
 
-       if (WARN_ON(!r || !*r)
+       if (WARN_ON(!r || !*r))
                return 0;
 
        return *r == data;
index 3f1b55f675a5c7e93b31540b67b755efc90d3f12..8fdc60c5aeaf73c375e9258c57157c9fec52a758 100644 (file)
@@ -1195,7 +1195,7 @@ static int zynq_pinctrl_probe(struct platform_device *pdev)
        pctrl->funcs = zynq_pmux_functions;
        pctrl->nfuncs = ARRAY_SIZE(zynq_pmux_functions);
 
-       pctrl->pctrl = pinctrl_register(&zynq_desc, &pdev->dev, pctrl);
+       pctrl->pctrl = devm_pinctrl_register(&pdev->dev, &zynq_desc, pctrl);
        if (IS_ERR(pctrl->pctrl))
                return PTR_ERR(pctrl->pctrl);
 
@@ -1206,15 +1206,6 @@ static int zynq_pinctrl_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int zynq_pinctrl_remove(struct platform_device *pdev)
-{
-       struct zynq_pinctrl *pctrl = platform_get_drvdata(pdev);
-
-       pinctrl_unregister(pctrl->pctrl);
-
-       return 0;
-}
-
 static const struct of_device_id zynq_pinctrl_of_match[] = {
        { .compatible = "xlnx,pinctrl-zynq" },
        { }
@@ -1227,7 +1218,6 @@ static struct platform_driver zynq_pinctrl_driver = {
                .of_match_table = zynq_pinctrl_of_match,
        },
        .probe = zynq_pinctrl_probe,
-       .remove = zynq_pinctrl_remove,
 };
 
 static int __init zynq_pinctrl_init(void)