]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
i2c: Replace list-based mechanism for handling auto-detected clients
authorHeiner Kallweit <hkallweit1@gmail.com>
Fri, 1 Nov 2024 22:09:51 +0000 (23:09 +0100)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 3 Jan 2025 12:22:02 +0000 (13:22 +0100)
commit56a50667cbcfaf95eea9128d5676af94e54b51a8
tree44faa66a3ad994addac8fc7595ebb3276ad1c855
parent60be800603ff81d43b2fbb3c067bbef49f7d8414
i2c: Replace list-based mechanism for handling auto-detected clients

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@gmail.com>
[wsa: fixed description of the new flag]
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/i2c-core-base.c
include/linux/i2c.h