Re: [PATCH 1/7] regulator: anatop-regulator: Use devm_regulator_register

From: Marek Vasut
Date: Wed Sep 04 2013 - 10:25:39 EST


Dear Sachin Kamat,

> devm_* simplifies the code.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx>

Makes sense

Acked-by: Marek Vasut <marex@xxxxxxx>

> ---
> This series is compile tested.
> ---
> drivers/regulator/anatop-regulator.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/regulator/anatop-regulator.c
> b/drivers/regulator/anatop-regulator.c index 0d4a8cc..e42bfd1 100644
> --- a/drivers/regulator/anatop-regulator.c
> +++ b/drivers/regulator/anatop-regulator.c
> @@ -200,7 +200,7 @@ static int anatop_regulator_probe(struct
> platform_device *pdev) config.regmap = sreg->anatop;
>
> /* register regulator */
> - rdev = regulator_register(rdesc, &config);
> + rdev = devm_regulator_register(dev, rdesc, &config);
> if (IS_ERR(rdev)) {
> dev_err(dev, "failed to register %s\n",
> rdesc->name);
> @@ -223,7 +223,6 @@ static int anatop_regulator_remove(struct
> platform_device *pdev) struct anatop_regulator *sreg =
> rdev_get_drvdata(rdev);
> const char *name = sreg->name;
>
> - regulator_unregister(rdev);
> kfree(name);
>
> return 0;

Best regards,
Marek Vasut
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/