[PATCH linux dev-4.7] drivers/fsi: Reorder hub devices so that parent is set before add

Christopher Bostic cbostic at linux.vnet.ibm.com
Tue Mar 7 10:32:19 AEDT 2017


Hub device parent needs to be set before device_add otherwise it
isn't saved.

Signed-off-by: Christopher Bostic <cbostic at linux.vnet.ibm.com>
---
 drivers/fsi/fsi-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c
index b9573c5..bd57b41 100644
--- a/drivers/fsi/fsi-core.c
+++ b/drivers/fsi/fsi-core.c
@@ -439,12 +439,12 @@ static int fsi_slave_scan(struct fsi_slave *slave)
 			device_initialize(&hub->dev);
 			dev_set_name(&hub->dev, "hub@%02x", slave->master->idx);
 			hub->dev.release = hub_master_release;
+			hub->master.dev = &hub->dev;
+			hub->master.dev->parent = &slave->dev;
 			rc = device_add(&hub->dev);
 			if (rc)
 				return rc;
 
-			hub->master.dev = &hub->dev;
-			hub->master.dev->parent = &slave->dev;
 			hub->base = FSI_HUB_LINK_OFFSET;
 			hub->control_regs = engine_addr;
 			hub->slave = slave;
-- 
1.8.2.2



More information about the openbmc mailing list