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

Commit 5e0165e5 authored by Jingoo Han's avatar Jingoo Han Committed by Mark Brown
Browse files

regulator: pcf50633: 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 15dc006a
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -90,7 +90,8 @@ static int pcf50633_regulator_probe(struct platform_device *pdev)
	config.driver_data = pcf;
	config.regmap = pcf->regmap;

	rdev = regulator_register(&regulators[pdev->id], &config);
	rdev = devm_regulator_register(&pdev->dev, &regulators[pdev->id],
				       &config);
	if (IS_ERR(rdev))
		return PTR_ERR(rdev);

@@ -102,21 +103,11 @@ static int pcf50633_regulator_probe(struct platform_device *pdev)
	return 0;
}

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

	regulator_unregister(rdev);

	return 0;
}

static struct platform_driver pcf50633_regulator_driver = {
	.driver = {
		.name = "pcf50633-regltr",
	},
	.probe = pcf50633_regulator_probe,
	.remove = pcf50633_regulator_remove,
};

static int __init pcf50633_regulator_init(void)