Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a2b5a93 authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown
Browse files

regulator: tps6105x: use devm_regulator_register()



Use devm_regulator_register() to make cleanup paths simpler,
and remove unnecessary remove().

Signed-off-by: default avatarJingoo Han <jg1.han@samsung.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 5e0165e5
Loading
Loading
Loading
Loading
+3 −10
Original line number Diff line number Diff line
@@ -146,7 +146,8 @@ static int tps6105x_regulator_probe(struct platform_device *pdev)
	config.driver_data = tps6105x;

	/* Register regulator with framework */
	tps6105x->regulator = regulator_register(&tps6105x_regulator_desc,
	tps6105x->regulator = devm_regulator_register(&pdev->dev,
						      &tps6105x_regulator_desc,
						      &config);
	if (IS_ERR(tps6105x->regulator)) {
		ret = PTR_ERR(tps6105x->regulator);
@@ -159,20 +160,12 @@ static int tps6105x_regulator_probe(struct platform_device *pdev)
	return 0;
}

static int tps6105x_regulator_remove(struct platform_device *pdev)
{
	struct tps6105x *tps6105x = dev_get_platdata(&pdev->dev);
	regulator_unregister(tps6105x->regulator);
	return 0;
}

static struct platform_driver tps6105x_regulator_driver = {
	.driver = {
		.name  = "tps6105x-regulator",
		.owner = THIS_MODULE,
	},
	.probe = tps6105x_regulator_probe,
	.remove = tps6105x_regulator_remove,
};

static __init int tps6105x_regulator_init(void)