Skip to content

Commit

Permalink
sh-pfc: sh73a0: Introduce the use of devm_regulator_register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Himangi Saraogi authored and Linus Walleij committed Jul 11, 2014
1 parent 4281a16 commit aef1d00
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions drivers/pinctrl/sh-pfc/pfc-sh73a0.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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,
};
Expand Down

0 comments on commit aef1d00

Please sign in to comment.