pinctrl: mvebu: 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>
Wed, 20 Apr 2016 22:02:39 +0000 (00:02 +0200)
Use devm_pinctrl_register() for pin control registration and remove
need of .remove callback.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Hongzhou Yang <hongzhou.yang@mediatek.com>
Cc: Fabian Frederick <fabf@skynet.be>
Cc: Andrew Andrianov <andrew@ncrmnt.org>
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/mvebu/pinctrl-armada-370.c
drivers/pinctrl/mvebu/pinctrl-armada-375.c
drivers/pinctrl/mvebu/pinctrl-armada-38x.c
drivers/pinctrl/mvebu/pinctrl-armada-39x.c
drivers/pinctrl/mvebu/pinctrl-armada-xp.c
drivers/pinctrl/mvebu/pinctrl-dove.c
drivers/pinctrl/mvebu/pinctrl-kirkwood.c
drivers/pinctrl/mvebu/pinctrl-mvebu.c
drivers/pinctrl/mvebu/pinctrl-mvebu.h
drivers/pinctrl/mvebu/pinctrl-orion.c

index 73dc1bc5f32ceb77998affa5dc4b67dbcd043182..9cc1cc3f5c347d470d88cdf1d69d83fa2f4b736f 100644 (file)
@@ -417,18 +417,12 @@ static int armada_370_pinctrl_probe(struct platform_device *pdev)
        return mvebu_pinctrl_probe(pdev);
 }
 
-static int armada_370_pinctrl_remove(struct platform_device *pdev)
-{
-       return mvebu_pinctrl_remove(pdev);
-}
-
 static struct platform_driver armada_370_pinctrl_driver = {
        .driver = {
                .name = "armada-370-pinctrl",
                .of_match_table = armada_370_pinctrl_of_match,
        },
        .probe = armada_370_pinctrl_probe,
-       .remove = armada_370_pinctrl_remove,
 };
 
 module_platform_driver(armada_370_pinctrl_driver);
index 54e9fbd0121f795f11ec53d5326b458d6d70a42f..070651431ca4eea719bfa524d645fc1813210200 100644 (file)
@@ -435,18 +435,12 @@ static int armada_375_pinctrl_probe(struct platform_device *pdev)
        return mvebu_pinctrl_probe(pdev);
 }
 
-static int armada_375_pinctrl_remove(struct platform_device *pdev)
-{
-       return mvebu_pinctrl_remove(pdev);
-}
-
 static struct platform_driver armada_375_pinctrl_driver = {
        .driver = {
                .name = "armada-375-pinctrl",
                .of_match_table = of_match_ptr(armada_375_pinctrl_of_match),
        },
        .probe = armada_375_pinctrl_probe,
-       .remove = armada_375_pinctrl_remove,
 };
 
 module_platform_driver(armada_375_pinctrl_driver);
index 6ec82c62dff792e9e1cebe02d18586d0e75cebfb..4e84c8e4938c52970d83cd7a5ec6a016f326297d 100644 (file)
@@ -446,18 +446,12 @@ static int armada_38x_pinctrl_probe(struct platform_device *pdev)
        return mvebu_pinctrl_probe(pdev);
 }
 
-static int armada_38x_pinctrl_remove(struct platform_device *pdev)
-{
-       return mvebu_pinctrl_remove(pdev);
-}
-
 static struct platform_driver armada_38x_pinctrl_driver = {
        .driver = {
                .name = "armada-38x-pinctrl",
                .of_match_table = of_match_ptr(armada_38x_pinctrl_of_match),
        },
        .probe = armada_38x_pinctrl_probe,
-       .remove = armada_38x_pinctrl_remove,
 };
 
 module_platform_driver(armada_38x_pinctrl_driver);
index fcfe9b478a2eddfc113ca42aa6c901a348f96953..e288f8ba0bf13cb9ebdf8d6a3a0c60155390a6f4 100644 (file)
@@ -428,18 +428,12 @@ static int armada_39x_pinctrl_probe(struct platform_device *pdev)
        return mvebu_pinctrl_probe(pdev);
 }
 
-static int armada_39x_pinctrl_remove(struct platform_device *pdev)
-{
-       return mvebu_pinctrl_remove(pdev);
-}
-
 static struct platform_driver armada_39x_pinctrl_driver = {
        .driver = {
                .name = "armada-39x-pinctrl",
                .of_match_table = of_match_ptr(armada_39x_pinctrl_of_match),
        },
        .probe = armada_39x_pinctrl_probe,
-       .remove = armada_39x_pinctrl_remove,
 };
 
 module_platform_driver(armada_39x_pinctrl_driver);
index bf70e09535762afbcde05e60f3353551f0981904..e4ea71a9d98546d3a24f5ee28309474b79fccebd 100644 (file)
@@ -502,18 +502,12 @@ static int armada_xp_pinctrl_probe(struct platform_device *pdev)
        return mvebu_pinctrl_probe(pdev);
 }
 
-static int armada_xp_pinctrl_remove(struct platform_device *pdev)
-{
-       return mvebu_pinctrl_remove(pdev);
-}
-
 static struct platform_driver armada_xp_pinctrl_driver = {
        .driver = {
                .name = "armada-xp-pinctrl",
                .of_match_table = armada_xp_pinctrl_of_match,
        },
        .probe = armada_xp_pinctrl_probe,
-       .remove = armada_xp_pinctrl_remove,
        .suspend = armada_xp_pinctrl_suspend,
        .resume = armada_xp_pinctrl_resume,
 };
index 95bfd0653e8fb9a0cbff91cefcb29fefaa167874..f93ae0dcef9caabdfdeb5635401f233c2b108bb3 100644 (file)
@@ -840,12 +840,9 @@ static int dove_pinctrl_probe(struct platform_device *pdev)
 
 static int dove_pinctrl_remove(struct platform_device *pdev)
 {
-       int ret;
-
-       ret = mvebu_pinctrl_remove(pdev);
        if (!IS_ERR(clk))
                clk_disable_unprepare(clk);
-       return ret;
+       return 0;
 }
 
 static struct platform_driver dove_pinctrl_driver = {
index 0f07dc554a1dd8e977f435d7fcc925267f2fabf4..a78e9a4997baa2645c5251f9b1d141979e5948a6 100644 (file)
@@ -481,18 +481,12 @@ static int kirkwood_pinctrl_probe(struct platform_device *pdev)
        return mvebu_pinctrl_probe(pdev);
 }
 
-static int kirkwood_pinctrl_remove(struct platform_device *pdev)
-{
-       return mvebu_pinctrl_remove(pdev);
-}
-
 static struct platform_driver kirkwood_pinctrl_driver = {
        .driver = {
                .name = "kirkwood-pinctrl",
                .of_match_table = kirkwood_pinctrl_of_match,
        },
        .probe = kirkwood_pinctrl_probe,
-       .remove = kirkwood_pinctrl_remove,
 };
 
 module_platform_driver(kirkwood_pinctrl_driver);
index 3ef798fac81bdba4926273f74b8c2b62b80102b3..b6ec6db783517a01a0e2daebcdfe5b4924716061 100644 (file)
@@ -711,7 +711,7 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
                return ret;
        }
 
-       pctl->pctldev = pinctrl_register(&pctl->desc, &pdev->dev, pctl);
+       pctl->pctldev = devm_pinctrl_register(&pdev->dev, &pctl->desc, pctl);
        if (IS_ERR(pctl->pctldev)) {
                dev_err(&pdev->dev, "unable to register pinctrl driver\n");
                return PTR_ERR(pctl->pctldev);
@@ -725,10 +725,3 @@ int mvebu_pinctrl_probe(struct platform_device *pdev)
 
        return 0;
 }
-
-int mvebu_pinctrl_remove(struct platform_device *pdev)
-{
-       struct mvebu_pinctrl *pctl = platform_get_drvdata(pdev);
-       pinctrl_unregister(pctl->pctldev);
-       return 0;
-}
index 65a98e6f72657a3277154bcbe8e8adee82cde20f..b75a5f4adf3b1fce09c200e8bc585c51c1e791d4 100644 (file)
@@ -202,6 +202,5 @@ static inline int default_mpp_ctrl_set(void __iomem *base, unsigned int pid,
 }
 
 int mvebu_pinctrl_probe(struct platform_device *pdev);
-int mvebu_pinctrl_remove(struct platform_device *pdev);
 
 #endif
index 3b7122d826e415bd6a1c5f7fbc0bbe451ab3114e..345c3df669a02fab51279ddb2d9bfed2b9b69d3d 100644 (file)
@@ -239,18 +239,12 @@ static int orion_pinctrl_probe(struct platform_device *pdev)
        return mvebu_pinctrl_probe(pdev);
 }
 
-static int orion_pinctrl_remove(struct platform_device *pdev)
-{
-       return mvebu_pinctrl_remove(pdev);
-}
-
 static struct platform_driver orion_pinctrl_driver = {
        .driver = {
                .name = "orion-pinctrl",
                .of_match_table = of_match_ptr(orion_pinctrl_of_match),
        },
        .probe = orion_pinctrl_probe,
-       .remove = orion_pinctrl_remove,
 };
 
 module_platform_driver(orion_pinctrl_driver);