Skip to content
Commit 62d3fb9d authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Jonathan Cameron
Browse files

iio: dac: ad5755: make use of of_device_id table



Store pointers to chip info (struct ad5755_chip_info) in driver match
data, instead of enum, so every value will be != 0, populate the
of_device_id table and use it in driver.  Even though it is one change,
it gives multiple benefits:
1. Allows to use spi_get_device_match_data() dropping local 'type'
   variable.
2. Makes both ID tables usable, so kernel can match via any of these
   methods.
3. Code is more obvious as both tables are properly filled.
4. Fixes W=1 warning:
   ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable]

Cc: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240413154511.52576-1-krzysztof.kozlowski@linaro.org


Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 88b49449
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment