From: Maud Spierings <[email protected]>

After adding the imx8m-blk-ctrl driver errors started appearing about
the genpd device already being registered.

incorperate some extra device details in the device name so this
possible collision goes away.

Signed-off-by: Maud Spierings <[email protected]>
Reviewed-by: Ahmad Fatoum <[email protected]>
Link: 
https://lore.barebox.org/[email protected]
Signed-off-by: Sascha Hauer <[email protected]>
(cherry picked from commit e2d7e032281158b54541392b4d8108de204137a1)
Signed-off-by: Ahmad Fatoum <[email protected]>
---
 drivers/base/power.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/power.c b/drivers/base/power.c
index d60a00f5735e..66ad6d05e815 100644
--- a/drivers/base/power.c
+++ b/drivers/base/power.c
@@ -481,11 +481,11 @@ struct device *genpd_dev_pm_attach_by_id(struct device 
*dev,
        if (!virt_dev)
                return ERR_PTR(-ENOMEM);
 
-       dev_set_name(virt_dev, "genpd");
+       dev_set_name(virt_dev, "genpd:%u:%s", index, dev_name(dev));
        virt_dev->bus = &genpd_bus_type;
        virt_dev->parent = dev;
        virt_dev->of_node = dev->of_node;
-       virt_dev->id = index;
+       virt_dev->id = DEVICE_ID_SINGLE;
 
        ret = device_register(virt_dev);
        if (ret) {
-- 
2.47.3


Reply via email to