Re: [PATCH v2 3/3] i2c: dev: clean up registration
From: Bartosz Golaszewski
Date: Mon Nov 09 2026 - 10:04:59 EST
On Thu, Aug 27, 2026 at 12:20:43PM +0200, Johan Hovold wrote:
> Drop the get_free_i2c_dev() and put_i2c_dev() helpers and do all setup
> and teardown directly in i2cdev_attach_adapter() and
> i2cdev_detach_adapter() for consistency and to make the logic clearer.
>
> Note that the device list is only used at detach so the i2c-dev can be
> added after registering the class device.
>
> Signed-off-by: Johan Hovold <johan@xxxxxxxxxx>
> ---
I'm not convinced this results in better or cleaner code but I'll let
Wolfram be the judge here.
FWIW:
Acked-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>
Bartosz