Skip to contentSkip to conversation

drivers/fsi: Change hub sysfs name

PATCH Superseded Christopher Bostic 3 participants 4 messages Feb 28, 2017 – Mar 2, 2017 FSI

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/fsi: Change hub sysfs name

Use the slave's master ID as the ID for the hub master.

---
 drivers/fsi/fsi-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-core.c +1 -1
index 542544e..b9573c5 100644
@@ -437,7 +437,7 @@ static int fsi_slave_scan(struct fsi_slave *slave)
 				return -ENOMEM;
 
 			device_initialize(&hub->dev);
-			dev_set_name(&hub->dev, "hub@%02x", hub->master.idx);
+			dev_set_name(&hub->dev, "hub@%02x", slave->master->idx);
 			hub->dev.release = hub_master_release;
 			rc = device_add(&hub->dev);
 			if (rc)
Signature · 1 line
1.8.2.2
#1 lore raw
Quoted 1 line · Christopher Bostic

Use the slave's master ID as the ID for the hub master.

I don't know enough about how the driver works to know if this is the right thing to do. Is it fixing a bug? Why was the old value wrong?

Cheers,

Joel

Quoted 22 lines
---
 drivers/fsi/fsi-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-core.c +1 -2
index 542544e..b9573c5 100644
@@ -437,7 +437,7 @@ static int fsi_slave_scan(struct fsi_slave *slave)
                                return -ENOMEM;
 
                        device_initialize(&hub->dev);
-                       dev_set_name(&hub->dev, "hub@%02x", hub->master.idx);
+                       dev_set_name(&hub->dev, "hub@%02x", slave->master->idx);
                        hub->dev.release = hub_master_release;
                        rc = device_add(&hub->dev);
                        if (rc)
--

1.8.2.2

#2 lore raw
Quoted 6 lines · Joel Stanley
Quoted 1 line · Christopher Bostic

Use the slave's master ID as the ID for the hub master.

I don't know enough about how the driver works to know if this is the right thing to do. Is it fixing a bug? Why was the old value wrong?

Hi Joel,

Yes this is fixing a bug. Before this fix both hub masters detected -one on first p9, other on second p9, are assigned the name "hub@00". The duplicate name causes a kernel warning to console. With this change each hub master is named uniquely by using the ID of its upstream fsi master.

Thanks,
Chris

Quoted 25 lines

Cheers,

Joel

Quoted 21 lines
---
  drivers/fsi/fsi-core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-core.c +1 -2
index 542544e..b9573c5 100644
@@ -437,7 +437,7 @@ static int fsi_slave_scan(struct fsi_slave *slave)
                                 return -ENOMEM;
 
                         device_initialize(&hub->dev);
-                       dev_set_name(&hub->dev, "hub@%02x", hub->master.idx);
+                       dev_set_name(&hub->dev, "hub@%02x", slave->master->idx);
                         hub->dev.release = hub_master_release;
                         rc = device_add(&hub->dev);
                         if (rc)
--

1.8.2.2

Acked-by
#3 lore raw

Looks good to me.

Quoted 45 lines · Christopher Bostic
Quoted 6 lines · Joel Stanley
Quoted 1 line · Christopher Bostic

Use the slave's master ID as the ID for the hub master.

I don't know enough about how the driver works to know if this is the right thing to do. Is it fixing a bug? Why was the old value wrong?

Hi Joel,

Yes this is fixing a bug. Before this fix both hub masters detected
-one on first p9, other on second p9, are assigned the name "hub@00".
The duplicate name causes a kernel warning to console. With this change each hub master is named uniquely by using the ID of its upstream fsi master.

Thanks,
Chris

Quoted 27 lines

Cheers,

Joel

Quoted 23 lines
---
  drivers/fsi/fsi-core.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/fsi/fsi-core.c +1 -1
index 542544e..b9573c5 100644
@@ -437,7 +437,7 @@ static int fsi_slave_scan(struct fsi_slave *slave)
                                 return -ENOMEM;
 
                         device_initialize(&hub->dev);
-                       dev_set_name(&hub->dev, "hub@%02x", 
 hub->master.idx);
+                       dev_set_name(&hub->dev, "hub@%02x", 
 slave->master->idx);
                         hub->dev.release = hub_master_release;
                         rc = device_add(&hub->dev);
                         if (rc)
Signature · 1 line
1.8.2.2