sh-pfc: sh73a0: Introduce the use of devm_regulator_register
Subsystems (2)
PATCH 1/1 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.
---
To send to: Linus Walleij <[email protected]>,[email protected]
drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)
drivers/pinctrl/sh-pfc/pfc-sh73a0.c +2 -9
@@ -3842,7 +3842,8 @@ static int sh73a0_pinmux_soc_init(struct sh_pfc *pfc) cfg.init_data = &sh73a0_vccq_mc0_init_data; cfg.driver_data = pfc; - data->vccq_mc0 =regulator_register (&sh73a0_vccq_mc0_desc, &cfg); + data->vccq_mc0 =devm_regulator_register (pfc->dev, + &sh73a0_vccq_mc0_desc, &cfg);if (IS_ERR (data->vccq_mc0)) { ret =PTR_ERR (data->vccq_mc0); 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)return 0 ; } -static void sh73a0_pinmux_soc_exit (struct sh_pfc *pfc) -{ -struct sh73a0_pinmux_data *data = pfc->soc_data; - -regulator_unregister (data->vccq_mc0); -} -static const struct sh_pfc_soc_operations sh73a0_pinmux_ops = { .init = sh73a0_pinmux_soc_init, - .exit = sh73a0_pinmux_soc_exit, .get_bias = sh73a0_pinmux_get_bias, .set_bias = sh73a0_pinmux_set_bias, };
Signature · 1 line
1.9.1
CC linux-sh
Quoted 43 lines · Himangi Saraogi
This patch moves data allocated using
regulator_registertodevm_regulator_registerand does away the calls toregulator_unregister. Thesh73a0_pinmux_soc_exitfunction is no longer needed and is removed.Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>---
To send to: Linus Walleij <[email protected]>,[email protected]drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-)drivers/pinctrl/sh-pfc/pfc-sh73a0.c +2
-10@@ -3842,7 +3842,8 @@ static int sh73a0_pinmux_soc_init(struct sh_pfc *pfc) cfg.init_data = &sh73a0_vccq_mc0_init_data; cfg.driver_data = pfc; - data->vccq_mc0 =regulator_register (&sh73a0_vccq_mc0_desc, &cfg); + data->vccq_mc0 =devm_regulator_register (pfc->dev, + &sh73a0_vccq_mc0_desc, &cfg);if (IS_ERR (data->vccq_mc0)) { ret =PTR_ERR (data->vccq_mc0); 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)return 0 ; } -static void sh73a0_pinmux_soc_exit (struct sh_pfc *pfc) -{ -struct sh73a0_pinmux_data *data = pfc->soc_data; - -regulator_unregister (data->vccq_mc0); -} -static const struct sh_pfc_soc_operations sh73a0_pinmux_ops = { .init = sh73a0_pinmux_soc_init, - .exit = sh73a0_pinmux_soc_exit, .get_bias = sh73a0_pinmux_get_bias, .set_bias = sh73a0_pinmux_set_bias, }; --
Quoted 1 line
1.9.1
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Quoted 6 lines · Himangi Saraogi
This patch moves data allocated using
regulator_registertodevm_regulator_registerand does away the calls toregulator_unregister. Thesh73a0_pinmux_soc_exitfunction is no longer needed and is removed.Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>
Laurent is maintaining this driver so let's see if he can ACK it.
Yours,
Linus Walleij
Laurent Pinchart
Acked-byQuoted 9 lines · On Wednesday 09 July 2014 12:32:44 Linus Walleij wrote:
Quoted 6 lines · Himangi Saraogi
This patch moves data allocated using
regulator_registertodevm_regulator_registerand does away the calls toregulator_unregister. Thesh73a0_pinmux_soc_exitfunction is no longer needed and is removed.Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>Laurent is maintaining this driver so let's see if he can ACK it.
Assuming we're talking about https://lkml.org/lkml/2014/7/7/386,
Signature · 3 lines
Regards, Laurent Pinchart
Quoted 6 lines · Himangi Saraogi
This patch moves data allocated using
regulator_registertodevm_regulator_registerand does away the calls toregulator_unregister. Thesh73a0_pinmux_soc_exitfunction is no longer needed and is removed.Signed-off-by Himangi Saraogi <[email protected]>Acked-by Julia Lawall <[email protected]>
Patch applied with Laurent's ACK.
Yours,
Linus Walleij