Re: [PATCH] iio: dac: ad5755: fix unised of_match table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/03/2024 18:14, Ben Dooks wrote:
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@xxxxxxxxxxxxxxx>
---
  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

Just noticed the use of ifnded instead of ifdef here. Will fix Monday.

  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 = {

--
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius

https://www.codethink.co.uk/privacy.html





[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux