pinctrl: ish-pfc: Use devm_pinctrl_register() for pinctrl registration
authorLaxman Dewangan <ldewangan@nvidia.com>
Sun, 28 Feb 2016 09:07:47 +0000 (14:37 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 20 Apr 2016 22:03:14 +0000 (00:03 +0200)
Use devm_pinctrl_register() for pin control registration.

Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>
Cc: linux-renesas-soc@vger.kernel.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/sh-pfc/core.c
drivers/pinctrl/sh-pfc/core.h
drivers/pinctrl/sh-pfc/pinctrl.c

index 0497bbb8a8e791ea1a78ded7fcf5a0767daeee1a..9a085cbb9d1808916adfbe0713bdc8ec25fa0783 100644 (file)
@@ -603,7 +603,6 @@ static int sh_pfc_remove(struct platform_device *pdev)
 #ifdef CONFIG_PINCTRL_SH_PFC_GPIO
        sh_pfc_unregister_gpiochip(pfc);
 #endif
-       sh_pfc_unregister_pinctrl(pfc);
 
        return 0;
 }
index fc05d0c516f33e5e286d04e762a3edb84cf41aa4..dc1b2adb24c5c5882b468d5b5d3e145c2348bafd 100644 (file)
@@ -50,14 +50,12 @@ struct sh_pfc {
        struct sh_pfc_chip *func;
 #endif
 
-       struct sh_pfc_pinctrl *pinctrl;
 };
 
 int sh_pfc_register_gpiochip(struct sh_pfc *pfc);
 int sh_pfc_unregister_gpiochip(struct sh_pfc *pfc);
 
 int sh_pfc_register_pinctrl(struct sh_pfc *pfc);
-int sh_pfc_unregister_pinctrl(struct sh_pfc *pfc);
 
 u32 sh_pfc_read_raw_reg(void __iomem *mapped_reg, unsigned int reg_width);
 void sh_pfc_write_raw_reg(void __iomem *mapped_reg, unsigned int reg_width,
index 8efaa0631be618a919079f3aa01edc94a1125407..fdb445d68b9a08a67992c07f46750bfb33875fc6 100644 (file)
@@ -789,7 +789,6 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
                return -ENOMEM;
 
        pmx->pfc = pfc;
-       pfc->pinctrl = pmx;
 
        ret = sh_pfc_map_pins(pfc, pmx);
        if (ret < 0)
@@ -803,19 +802,9 @@ int sh_pfc_register_pinctrl(struct sh_pfc *pfc)
        pmx->pctl_desc.pins = pmx->pins;
        pmx->pctl_desc.npins = pfc->info->nr_pins;
 
-       pmx->pctl = pinctrl_register(&pmx->pctl_desc, pfc->dev, pmx);
+       pmx->pctl = devm_pinctrl_register(pfc->dev, &pmx->pctl_desc, pmx);
        if (IS_ERR(pmx->pctl))
                return PTR_ERR(pmx->pctl);
 
        return 0;
 }
-
-int sh_pfc_unregister_pinctrl(struct sh_pfc *pfc)
-{
-       struct sh_pfc_pinctrl *pmx = pfc->pinctrl;
-
-       pinctrl_unregister(pmx->pctl);
-
-       pfc->pinctrl = NULL;
-       return 0;
-}