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

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

regulator: s5m8767: Covert to devm_regulator_register()

parent b707a274
Loading
Loading
Loading
Loading
+3 −21
Original line number Original line Diff line number Diff line
@@ -910,32 +910,15 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
		config.regmap = iodev->regmap;
		config.regmap = iodev->regmap;
		config.of_node = pdata->regulators[i].reg_node;
		config.of_node = pdata->regulators[i].reg_node;


		rdev[i] = regulator_register(&regulators[id], &config);
		rdev[i] = devm_regulator_register(&pdev->dev, &regulators[id],
						  &config);
		if (IS_ERR(rdev[i])) {
		if (IS_ERR(rdev[i])) {
			ret = PTR_ERR(rdev[i]);
			ret = PTR_ERR(rdev[i]);
			dev_err(s5m8767->dev, "regulator init failed for %d\n",
			dev_err(s5m8767->dev, "regulator init failed for %d\n",
					id);
					id);
			rdev[i] = NULL;
			goto err;
		}
	}

	return 0;
err:
	for (i = 0; i < s5m8767->num_regulators; i++)
		regulator_unregister(rdev[i]);

			return ret;
			return ret;
		}
		}

	}
static int s5m8767_pmic_remove(struct platform_device *pdev)
{
	struct s5m8767_info *s5m8767 = platform_get_drvdata(pdev);
	struct regulator_dev **rdev = s5m8767->rdev;
	int i;

	for (i = 0; i < s5m8767->num_regulators; i++)
		regulator_unregister(rdev[i]);


	return 0;
	return 0;
}
}
@@ -952,7 +935,6 @@ static struct platform_driver s5m8767_pmic_driver = {
		.owner = THIS_MODULE,
		.owner = THIS_MODULE,
	},
	},
	.probe = s5m8767_pmic_probe,
	.probe = s5m8767_pmic_probe,
	.remove = s5m8767_pmic_remove,
	.id_table = s5m8767_pmic_id,
	.id_table = s5m8767_pmic_id,
};
};