[v4,3/6] i3c: master: make sure the PID is set before registering the device
diff mbox series

Message ID 20191210101502.8401-4-pgaj@cadence.com
State New
Headers show
Series
  • I3C device addresing adjustments
Related show

Commit Message

Przemysław Gaj Dec. 10, 2019, 10:14 a.m. UTC
If SETDASA failed for some reason or Provisioned ID (PID) retrieval
failed PID may not be set. Check that condition before registering
the device.

Signed-off-by: Przemysław Gaj <pgaj@cadence.com>
---
 drivers/i3c/master.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index fab6e0609fca..4b3d1c0f778d 100755
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -1450,7 +1450,8 @@  i3c_master_register_new_i3c_devs(struct i3c_master_controller *master)
 		return;
 
 	i3c_bus_for_each_i3cdev(&master->bus, desc) {
-		if (desc->dev || !desc->info.dyn_addr || desc == master->this)
+		if (desc->dev || !desc->info.dyn_addr ||
+		    desc == master->this || !desc->info.pid)
 			continue;
 
 		desc->dev = kzalloc(sizeof(*desc->dev), GFP_KERNEL);