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

Commit b1a613d5 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown
Browse files

regulator: aat2870: Convert to devm_regulator_register

parent bcb5fe44
Loading
Loading
Loading
Loading
+1 −10
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
	config.driver_data = ri;
	config.init_data = dev_get_platdata(&pdev->dev);

	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);
@@ -187,21 +187,12 @@ static int aat2870_regulator_probe(struct platform_device *pdev)
	return 0;
}

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

	regulator_unregister(rdev);
	return 0;
}

static struct platform_driver aat2870_regulator_driver = {
	.driver = {
		.name	= "aat2870-regulator",
		.owner	= THIS_MODULE,
	},
	.probe	= aat2870_regulator_probe,
	.remove	= aat2870_regulator_remove,
};

static int __init aat2870_regulator_init(void)