mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
mfd: da9052: Fix broken regulator probe
Fix broken probe of da9052 regulators, which since commitb3f6c73db7("mfd: da9052-core: Fix platform-device id collision") use a non-deterministic platform-device id to retrieve static regulator information. Fortunately, adequate error handling was in place so probe would simply fail with an error message. Update the mfd-cell ids to be zero-based and use those to identify the cells when probing the regulator devices. Fixes:b3f6c73db7("mfd: da9052-core: Fix platform-device id collision") Cc: stable <stable@vger.kernel.org> # v3.19 Signed-off-by: Johan Hovold <johan@kernel.org> Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Reviewed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
This commit is contained in:
parent
5ebe6afaf0
commit
e0c21530fa
2 changed files with 7 additions and 6 deletions
|
|
@ -431,6 +431,10 @@ int da9052_adc_read_temp(struct da9052 *da9052)
|
||||||
EXPORT_SYMBOL_GPL(da9052_adc_read_temp);
|
EXPORT_SYMBOL_GPL(da9052_adc_read_temp);
|
||||||
|
|
||||||
static const struct mfd_cell da9052_subdev_info[] = {
|
static const struct mfd_cell da9052_subdev_info[] = {
|
||||||
|
{
|
||||||
|
.name = "da9052-regulator",
|
||||||
|
.id = 0,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.name = "da9052-regulator",
|
.name = "da9052-regulator",
|
||||||
.id = 1,
|
.id = 1,
|
||||||
|
|
@ -483,10 +487,6 @@ static const struct mfd_cell da9052_subdev_info[] = {
|
||||||
.name = "da9052-regulator",
|
.name = "da9052-regulator",
|
||||||
.id = 13,
|
.id = 13,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
.name = "da9052-regulator",
|
|
||||||
.id = 14,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
.name = "da9052-onkey",
|
.name = "da9052-onkey",
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -394,6 +394,7 @@ static inline struct da9052_regulator_info *find_regulator_info(u8 chip_id,
|
||||||
|
|
||||||
static int da9052_regulator_probe(struct platform_device *pdev)
|
static int da9052_regulator_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
const struct mfd_cell *cell = mfd_get_cell(pdev);
|
||||||
struct regulator_config config = { };
|
struct regulator_config config = { };
|
||||||
struct da9052_regulator *regulator;
|
struct da9052_regulator *regulator;
|
||||||
struct da9052 *da9052;
|
struct da9052 *da9052;
|
||||||
|
|
@ -409,7 +410,7 @@ static int da9052_regulator_probe(struct platform_device *pdev)
|
||||||
regulator->da9052 = da9052;
|
regulator->da9052 = da9052;
|
||||||
|
|
||||||
regulator->info = find_regulator_info(regulator->da9052->chip_id,
|
regulator->info = find_regulator_info(regulator->da9052->chip_id,
|
||||||
pdev->id);
|
cell->id);
|
||||||
if (regulator->info == NULL) {
|
if (regulator->info == NULL) {
|
||||||
dev_err(&pdev->dev, "invalid regulator ID specified\n");
|
dev_err(&pdev->dev, "invalid regulator ID specified\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
@ -419,7 +420,7 @@ static int da9052_regulator_probe(struct platform_device *pdev)
|
||||||
config.driver_data = regulator;
|
config.driver_data = regulator;
|
||||||
config.regmap = da9052->regmap;
|
config.regmap = da9052->regmap;
|
||||||
if (pdata && pdata->regulators) {
|
if (pdata && pdata->regulators) {
|
||||||
config.init_data = pdata->regulators[pdev->id];
|
config.init_data = pdata->regulators[cell->id];
|
||||||
} else {
|
} else {
|
||||||
#ifdef CONFIG_OF
|
#ifdef CONFIG_OF
|
||||||
struct device_node *nproot = da9052->dev->of_node;
|
struct device_node *nproot = da9052->dev->of_node;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue