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

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

regulator: 88pm8607: Convert to devm_regulator_register



Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 9e2bfbbd
Loading
Loading
Loading
Loading
+2 −10
Original line number Original line Diff line number Diff line
@@ -391,7 +391,8 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
	else
	else
		config.regmap = chip->regmap_companion;
		config.regmap = chip->regmap_companion;


	info->regulator = regulator_register(&info->desc, &config);
	info->regulator = devm_regulator_register(&pdev->dev, &info->desc,
						  &config);
	if (IS_ERR(info->regulator)) {
	if (IS_ERR(info->regulator)) {
		dev_err(&pdev->dev, "failed to register regulator %s\n",
		dev_err(&pdev->dev, "failed to register regulator %s\n",
			info->desc.name);
			info->desc.name);
@@ -402,14 +403,6 @@ static int pm8607_regulator_probe(struct platform_device *pdev)
	return 0;
	return 0;
}
}


static int pm8607_regulator_remove(struct platform_device *pdev)
{
	struct pm8607_regulator_info *info = platform_get_drvdata(pdev);

	regulator_unregister(info->regulator);
	return 0;
}

static struct platform_device_id pm8607_regulator_driver_ids[] = {
static struct platform_device_id pm8607_regulator_driver_ids[] = {
	{
	{
		.name	= "88pm860x-regulator",
		.name	= "88pm860x-regulator",
@@ -428,7 +421,6 @@ static struct platform_driver pm8607_regulator_driver = {
		.owner	= THIS_MODULE,
		.owner	= THIS_MODULE,
	},
	},
	.probe		= pm8607_regulator_probe,
	.probe		= pm8607_regulator_probe,
	.remove		= pm8607_regulator_remove,
	.id_table	= pm8607_regulator_driver_ids,
	.id_table	= pm8607_regulator_driver_ids,
};
};