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

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

regulator: ab3100: use devm_regulator_register()



Use devm_regulator_register() to make cleanup paths simpler.

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 0cdfcc0f
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -535,7 +535,7 @@ static int ab3100_regulator_register(struct platform_device *pdev,
	config.dev = &pdev->dev;
	config.driver_data = reg;

	rdev = regulator_register(desc, &config);
	rdev = devm_regulator_register(&pdev->dev, desc, &config);
	if (IS_ERR(rdev)) {
		err = PTR_ERR(rdev);
		dev_err(&pdev->dev,
@@ -616,7 +616,6 @@ static int ab3100_regulators_remove(struct platform_device *pdev)
	for (i = 0; i < AB3100_NUM_REGULATORS; i++) {
		struct ab3100_regulator *reg = &ab3100_regulators[i];

		regulator_unregister(reg->rdev);
		reg->rdev = NULL;
	}
	return 0;