[PATCH v3 2/4] mfd: da9055: Fix platform device ids to avoid probe failure

From: Bartlomiej Zolnierkiewicz
Date: Mon Mar 23 2015 - 11:09:54 EST


Commit 6e3f62f0793e ("mfd: core: Fix platform-device id generation")
changed the way platform device ids are generated from mfd id base and
cell ids in mfd_add_device(). Unfortunately the change in question
breaks mfd drivers which are using mfd_add_devices() with mfd id base
equal to -1 and non-zero cell ids (used to distinguish cells with
the same name field). The result is that mfd core tries to register
platform devices with the same name which obviously fails and leads
to mfd device probe failure.

Change mfd_add_devices() mfd id base from -1 to PLATFORM_DEVID_AUTO
to fix the issue.

Fixes: 6e3f62f0793e ("mfd: core: Fix platform-device id generation")
Cc: Johan Hovold <johan@xxxxxxxxxx>
Cc: Support Opensource <support.opensource@xxxxxxxxxxx>
Cc: <stable@xxxxxxxxxxxxxxx>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@xxxxxxxxxxx>
---
drivers/mfd/da9055-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/da9055-core.c b/drivers/mfd/da9055-core.c
index b4d920c..e6ed6a1 100644
--- a/drivers/mfd/da9055-core.c
+++ b/drivers/mfd/da9055-core.c
@@ -404,7 +404,7 @@ int da9055_device_init(struct da9055 *da9055)

da9055->irq_base = regmap_irq_chip_get_base(da9055->irq_data);

- ret = mfd_add_devices(da9055->dev, -1,
+ ret = mfd_add_devices(da9055->dev, PLATFORM_DEVID_AUTO,
da9055_devs, ARRAY_SIZE(da9055_devs),
NULL, da9055->irq_base, NULL);
if (ret)
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/