On Fri, Nov 01, 2024 at 11:09:51PM +0100, Heiner Kallweit wrote: > So far a list is used to track auto-detected clients per driver. > The same functionality can be achieved much simpler by flagging > auto-detected clients. > > Two notes regarding the usage of driver_for_each_device: > In our case it can't fail, however the function is annotated __must_check. > So a little workaround is needed to avoid a compiler warning. > Then we may remove nodes from the list over which we iterate. > This is safe, see the explanation at the beginning of lib/klist.c. > > Signed-off-by: Heiner Kallweit <hkallweit1@xxxxxxxxx> Applied to for-next, thanks! One minor edit: > +#define I2C_CLIENT_AUTO 0x100 /* for board_info; auto-detected */ This is not for 'board_info'. I changed it to "client was auto-detected".
Attachment:
signature.asc
Description: PGP signature
- References:
- [PATCH v3 0/4] i2c: Replace lists of special clients with flagging of such clients
- From: Heiner Kallweit
- [PATCH v3 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- From: Heiner Kallweit
- [PATCH v3 0/4] i2c: Replace lists of special clients with flagging of such clients
- Prev by Date: Re: [PATCH v3 1/4] ALSA: ppc: Remove i2c client removal hack
- Next by Date: Re: [PATCH v3 3/4] i2c: Replace list-based mechanism for handling userspace-created clients
- Previous by thread: [PATCH v3 2/4] i2c: Replace list-based mechanism for handling auto-detected clients
- Next by thread: [PATCH v3 3/4] i2c: Replace list-based mechanism for handling userspace-created clients
- Index(es):