lkml.org 
[lkml]   [2024]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 16/34] iio: ad5755: hook up of_device_id lookup to platform driver
Date
From: Arnd Bergmann <arnd@arndb.de>

When the driver is built-in, 'make W=1' warns about an unused
ID table:

drivers/iio/dac/ad5755.c:866:34: error: 'ad5755_of_match' defined but not used [-Werror=unused-const-variable=]
866 | static const struct of_device_id ad5755_of_match[] = {

While the data is duplicated in the spi_device_id, it's common
to use the actual OF compatible strings in the driver.

Since there are no in-tree users of plain platform devices, the
spi_device_id table could actually be dropped entirely with this.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/iio/dac/ad5755.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
index 404865e35460..5c1e7f428c25 100644
--- a/drivers/iio/dac/ad5755.c
+++ b/drivers/iio/dac/ad5755.c
@@ -876,6 +876,7 @@ MODULE_DEVICE_TABLE(of, ad5755_of_match);
static struct spi_driver ad5755_driver = {
.driver = {
.name = "ad5755",
+ .of_match_table = ad5755_of_match,
},
.probe = ad5755_probe,
.id_table = ad5755_id,
--
2.39.2

\
 
 \ /
  Last update: 2024-05-27 16:20    [W:0.644 / U:0.488 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site