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

Commit eb8b3c83 authored by Mark Brown's avatar Mark Brown
Browse files

regulator: wm8400: Convert to devm_regulator_register()



Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent e57e5469
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -219,7 +219,8 @@ static int wm8400_regulator_probe(struct platform_device *pdev)
	config.driver_data = wm8400;
	config.regmap = wm8400->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);

@@ -228,21 +229,11 @@ static int wm8400_regulator_probe(struct platform_device *pdev)
	return 0;
}

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

	regulator_unregister(rdev);

	return 0;
}

static struct platform_driver wm8400_regulator_driver = {
	.driver = {
		.name = "wm8400-regulator",
	},
	.probe = wm8400_regulator_probe,
	.remove = wm8400_regulator_remove,
};

/**