Re: [PATCH v3 05/10] i2c: core: fix adapter debugfs creation
From: Wolfram Sang
Date: Wed Jun 03 2026 - 09:23:24 EST
On Mon, May 11, 2026 at 04:37:10PM +0200, Johan Hovold wrote:
> Clients can be registered from bus notifier callbacks so the debugfs
> directory needs to be created before registering the adapter as clients
> use that directory as their debugfs parent.
>
> Move debugfs creation before adapter registration to avoid having
> clients create their debugfs directories in the debugfs root (which is
> also more likely to fail due to name collisions).
>
> Note that failure to allocate the adapter name must now be handled
> explicitly as debugfs_create_dir() cannot handle a NULL name (unlike
> device_add() which returns an error).
>
> Fixes: 73febd775bdb ("i2c: create debugfs entry per adapter")
> Cc: stable@xxxxxxxxxxxxxxx # 6.8
> Cc: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
Reviewed-by: Wolfram Sang <wsa+renesas@xxxxxxxxxxxxxxxxxxxx>