Linux IIO development
 help / color / mirror / Atom feed
* [PATCH] iio: dac: ad5755: fix unised of_match table
@ 2024-03-08 18:14 Ben Dooks
  2024-03-08 18:55 ` Ben Dooks
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Dooks @ 2024-03-08 18:14 UTC (permalink / raw)
  To: linux-iio; +Cc: lars, jic23, Michael.Hennerich, Ben Dooks

If the ad5755 is not being built as a module, then we get an unused warning
about the ad5755_of_match[] array as this is only used by the macro
MODULE_DEVICE_TABLE. Fix this by adding an #ifdef MODULE around it to
silence:

drivers/iio/dac/ad5755.c:866:34: warning: ‘ad5755_of_match’ defined but not used [-Wunused-const-variable=]
  866 | static const struct of_device_id ad5755_of_match[] = {

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
---
 drivers/iio/dac/ad5755.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
index 404865e35460..fb99c8472788 100644
--- a/drivers/iio/dac/ad5755.c
+++ b/drivers/iio/dac/ad5755.c
@@ -863,6 +863,7 @@ static const struct spi_device_id ad5755_id[] = {
 };
 MODULE_DEVICE_TABLE(spi, ad5755_id);
 
+#ifndef MODULE
 static const struct of_device_id ad5755_of_match[] = {
 	{ .compatible = "adi,ad5755" },
 	{ .compatible = "adi,ad5755-1" },
@@ -872,6 +873,7 @@ static const struct of_device_id ad5755_of_match[] = {
 	{ }
 };
 MODULE_DEVICE_TABLE(of, ad5755_of_match);
+#endif
 
 static struct spi_driver ad5755_driver = {
 	.driver = {
-- 
2.37.2.352.g3c44437643


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-03-09 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-08 18:14 [PATCH] iio: dac: ad5755: fix unised of_match table Ben Dooks
2024-03-08 18:55 ` Ben Dooks
2024-03-09 17:26   ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox