Skip to content

Commit d4fa7d7

Browse files
billy-tsaialexandrebelloni
authored andcommitted
i3c: master: Free the old_dyn_addr when reattach.
This patch is used to free the old_dyn_addr when the caller want to reattach the device to the different dynamic address. If the old_dyn_addr is 0 the function will treat it as no old_dyn_addr is reserved on the bus. Without the patch, when the driver reattach the i3c device after setnewda the old_dyn_addr will be permanently occupied. Signed-off-by: Billy Tsai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 568035b commit d4fa7d7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/i3c/master.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,6 +1379,9 @@ static int i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev,
13791379
i3c_bus_set_addr_slot_status(&master->bus,
13801380
dev->info.dyn_addr,
13811381
I3C_ADDR_SLOT_I3C_DEV);
1382+
if (old_dyn_addr)
1383+
i3c_bus_set_addr_slot_status(&master->bus, old_dyn_addr,
1384+
I3C_ADDR_SLOT_FREE);
13821385
}
13831386

13841387
if (master->ops->reattach_i3c_dev) {

0 commit comments

Comments
 (0)