aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHimangi Saraogi <himangi774@gmail.com>2014-07-07 12:09:16 -0400
committerLinus Walleij <linus.walleij@linaro.org>2014-07-11 08:08:39 -0400
commitaef1d0003d8c9f913fd66a0e06aeb292b29ab6dd (patch)
treea54bc73f7ecf54b7c07af4f46c5f763e873ca8eb
parent4281a16de2b1d8e715623afff0445bdce9d3ffe7 (diff)
sh-pfc: sh73a0: Introduce the use of devm_regulator_register
This patch moves data allocated using regulator_register to devm_regulator_register and does away the calls to regulator_unregister. The sh73a0_pinmux_soc_exit function is no longer needed and is removed. Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r--drivers/pinctrl/sh-pfc/pfc-sh73a0.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
index ee370de4609a..0bd8f4401b42 100644
--- a/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
+++ b/drivers/pinctrl/sh-pfc/pfc-sh73a0.c
@@ -3842,7 +3842,8 @@ static int sh73a0_pinmux_soc_init(struct sh_pfc *pfc)
3842 cfg.init_data = &sh73a0_vccq_mc0_init_data; 3842 cfg.init_data = &sh73a0_vccq_mc0_init_data;
3843 cfg.driver_data = pfc; 3843 cfg.driver_data = pfc;
3844 3844
3845 data->vccq_mc0 = regulator_register(&sh73a0_vccq_mc0_desc, &cfg); 3845 data->vccq_mc0 = devm_regulator_register(pfc->dev,
3846 &sh73a0_vccq_mc0_desc, &cfg);
3846 if (IS_ERR(data->vccq_mc0)) { 3847 if (IS_ERR(data->vccq_mc0)) {
3847 ret = PTR_ERR(data->vccq_mc0); 3848 ret = PTR_ERR(data->vccq_mc0);
3848 dev_err(pfc->dev, "Failed to register VCCQ MC0 regulator: %d\n", 3849 dev_err(pfc->dev, "Failed to register VCCQ MC0 regulator: %d\n",
@@ -3855,16 +3856,8 @@ static int sh73a0_pinmux_soc_init(struct sh_pfc *pfc)
3855 return 0; 3856 return 0;
3856} 3857}
3857 3858
3858static void sh73a0_pinmux_soc_exit(struct sh_pfc *pfc)
3859{
3860 struct sh73a0_pinmux_data *data = pfc->soc_data;
3861
3862 regulator_unregister(data->vccq_mc0);
3863}
3864
3865static const struct sh_pfc_soc_operations sh73a0_pinmux_ops = { 3859static const struct sh_pfc_soc_operations sh73a0_pinmux_ops = {
3866 .init = sh73a0_pinmux_soc_init, 3860 .init = sh73a0_pinmux_soc_init,
3867 .exit = sh73a0_pinmux_soc_exit,
3868 .get_bias = sh73a0_pinmux_get_bias, 3861 .get_bias = sh73a0_pinmux_get_bias,
3869 .set_bias = sh73a0_pinmux_set_bias, 3862 .set_bias = sh73a0_pinmux_set_bias,
3870}; 3863};