mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] i3c: Move device name assignment after i3c_bus_init
@ 2026-01-12  6:07 Billy Tsai
  2026-01-12 16:00 ` Frank Li
  2026-01-14 15:01 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Billy Tsai @ 2026-01-12  6:07 UTC (permalink / raw)
  To: Alexandre Belloni, Frank Li; +Cc: linux-i3c, linux-kernel, Billy Tsai

Move device name initialization to occur after i3c_bus_init()
so that i3cbus->id is guaranteed to be assigned before it is used.

Fixes: 9d4f219807d5 ("i3c: fix refcount inconsistency in i3c_master_register")
Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
 drivers/i3c/master.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 7f606c871648..1bc3c9068402 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -2881,7 +2881,6 @@ int i3c_master_register(struct i3c_master_controller *master,
 	INIT_LIST_HEAD(&master->boardinfo.i3c);
 
 	device_initialize(&master->dev);
-	dev_set_name(&master->dev, "i3c-%d", i3cbus->id);
 
 	master->dev.dma_mask = parent->dma_mask;
 	master->dev.coherent_dma_mask = parent->coherent_dma_mask;
@@ -2891,6 +2890,8 @@ int i3c_master_register(struct i3c_master_controller *master,
 	if (ret)
 		goto err_put_dev;
 
+	dev_set_name(&master->dev, "i3c-%d", i3cbus->id);
+
 	ret = of_populate_i3c_bus(master);
 	if (ret)
 		goto err_put_dev;

---
base-commit: 9c7ef209cd0f7c1a92ed61eed3e835d6e4abc66c
change-id: 20260112-upstream_i3c_fix-455a2cc442a5

Best regards,
-- 
Billy Tsai <billy_tsai@aspeedtech.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i3c: Move device name assignment after i3c_bus_init
  2026-01-12  6:07 [PATCH] i3c: Move device name assignment after i3c_bus_init Billy Tsai
@ 2026-01-12 16:00 ` Frank Li
  2026-01-14 15:01 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Frank Li @ 2026-01-12 16:00 UTC (permalink / raw)
  To: Billy Tsai; +Cc: Alexandre Belloni, linux-i3c, linux-kernel

On Mon, Jan 12, 2026 at 02:07:22PM +0800, Billy Tsai wrote:
> Move device name initialization to occur after i3c_bus_init()
> so that i3cbus->id is guaranteed to be assigned before it is used.
>
> Fixes: 9d4f219807d5 ("i3c: fix refcount inconsistency in i3c_master_register")
> Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/i3c/master.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
> index 7f606c871648..1bc3c9068402 100644
> --- a/drivers/i3c/master.c
> +++ b/drivers/i3c/master.c
> @@ -2881,7 +2881,6 @@ int i3c_master_register(struct i3c_master_controller *master,
>  	INIT_LIST_HEAD(&master->boardinfo.i3c);
>
>  	device_initialize(&master->dev);
> -	dev_set_name(&master->dev, "i3c-%d", i3cbus->id);
>
>  	master->dev.dma_mask = parent->dma_mask;
>  	master->dev.coherent_dma_mask = parent->coherent_dma_mask;
> @@ -2891,6 +2890,8 @@ int i3c_master_register(struct i3c_master_controller *master,
>  	if (ret)
>  		goto err_put_dev;
>
> +	dev_set_name(&master->dev, "i3c-%d", i3cbus->id);
> +
>  	ret = of_populate_i3c_bus(master);
>  	if (ret)
>  		goto err_put_dev;
>
> ---
> base-commit: 9c7ef209cd0f7c1a92ed61eed3e835d6e4abc66c
> change-id: 20260112-upstream_i3c_fix-455a2cc442a5
>
> Best regards,
> --
> Billy Tsai <billy_tsai@aspeedtech.com>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] i3c: Move device name assignment after i3c_bus_init
  2026-01-12  6:07 [PATCH] i3c: Move device name assignment after i3c_bus_init Billy Tsai
  2026-01-12 16:00 ` Frank Li
@ 2026-01-14 15:01 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2026-01-14 15:01 UTC (permalink / raw)
  To: Frank Li, Billy Tsai; +Cc: linux-i3c, linux-kernel

On Mon, 12 Jan 2026 14:07:22 +0800, Billy Tsai wrote:
> Move device name initialization to occur after i3c_bus_init()
> so that i3cbus->id is guaranteed to be assigned before it is used.
> 
> 

Applied, thanks!

[1/1] i3c: Move device name assignment after i3c_bus_init
      https://git.kernel.org/i3c/c/3502cea99c7c

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-14 15:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-12  6:07 [PATCH] i3c: Move device name assignment after i3c_bus_init Billy Tsai
2026-01-12 16:00 ` Frank Li
2026-01-14 15:01 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®