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

Commit 58765e24 authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown
Browse files

regulator: max8925: 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>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 0b7bb090
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -312,7 +312,7 @@ static int max8925_regulator_probe(struct platform_device *pdev)
		if (pdata)
			config.init_data = pdata;

	rdev = regulator_register(&ri->desc, &config);
	rdev = devm_regulator_register(&pdev->dev, &ri->desc, &config);
	if (IS_ERR(rdev)) {
		dev_err(&pdev->dev, "failed to register regulator %s\n",
				ri->desc.name);
@@ -323,22 +323,12 @@ static int max8925_regulator_probe(struct platform_device *pdev)
	return 0;
}

static int max8925_regulator_remove(struct platform_device *pdev)
{
	struct regulator_dev *rdev = platform_get_drvdata(pdev);

	regulator_unregister(rdev);

	return 0;
}

static struct platform_driver max8925_regulator_driver = {
	.driver		= {
		.name	= "max8925-regulator",
		.owner	= THIS_MODULE,
	},
	.probe		= max8925_regulator_probe,
	.remove		= max8925_regulator_remove,
};

static int __init max8925_regulator_init(void)