iio: proximity: isl29501: make use of of_device_id table
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 25 Feb 2024 20:16:54 +0000 (21:16 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Wed, 28 Feb 2024 19:26:38 +0000 (19:26 +0000)
Reference the of_device_id table in the driver structure, so it will be
used for module autoloading and device matching.  This fixes clang W=1
warning:

  isl29501.c:999:34: error: unused variable 'isl29501_i2c_matches' [-Werror,-Wunused-const-variable]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240225201654.49450-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/proximity/isl29501.c

index bcebacaf3dab0d444dc683ec13ae3e888cf17053..4982686fb4c3091486f7851ed045292d4aad8f6b 100644 (file)
@@ -995,17 +995,16 @@ static const struct i2c_device_id isl29501_id[] = {
 
 MODULE_DEVICE_TABLE(i2c, isl29501_id);
 
-#if defined(CONFIG_OF)
 static const struct of_device_id isl29501_i2c_matches[] = {
        { .compatible = "renesas,isl29501" },
        { }
 };
 MODULE_DEVICE_TABLE(of, isl29501_i2c_matches);
-#endif
 
 static struct i2c_driver isl29501_driver = {
        .driver = {
                .name   = "isl29501",
+               .of_match_table = isl29501_i2c_matches,
        },
        .id_table       = isl29501_id,
        .probe          = isl29501_probe,