]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i2c: nomadik: switch from of_device_is_compatible() to of_match_device()
authorThéo Lebrun <theo.lebrun@bootlin.com>
Wed, 9 Oct 2024 14:01:09 +0000 (16:01 +0200)
committerWolfram Sang <wsa+renesas@sang-engineering.com>
Sun, 24 Nov 2024 15:03:51 +0000 (16:03 +0100)
commita0d15cc47f29be6d588fa55bdbe116c26549178d
tree3a057095a0355681f5b6125ba5f56354b7cfdaaf
parent54202106c0fe23693c5e9e81e7587ce89e6dd182
i2c: nomadik: switch from of_device_is_compatible() to of_match_device()

Compatible-specific behavior is implemented using a if-condition on the
return value from of_device_is_compatible(), from probe. It does not
scale well when compatible number increases. Switch to using a match
table and a call to of_match_device().

We DO NOT attach a .of_match_table field to our amba driver, as we do
not use the table to match our driver to devices.

Sort probe variable declarations in reverse christmas tree to try and
introduce some logic into the ordering.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
drivers/i2c/busses/i2c-nomadik.c