From: Ben Dooks <ben.dooks@codethink.co.uk>
To: linux-iio@vger.kernel.org
Cc: lars@metafoo.de, jic23@kernel.org, Michael.Hennerich@analog.com
Subject: Re: [PATCH] iio: dac: ad5755: fix unised of_match table
Date: Fri, 8 Mar 2024 18:55:09 +0000 [thread overview]
Message-ID: <e0bee548-9a62-469a-8c2c-9548626616d6@codethink.co.uk> (raw)
In-Reply-To: <20240308181411.1916460-1-ben.dooks@codethink.co.uk>
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@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
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
next prev parent reply other threads:[~2024-03-08 18:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-08 18:14 [PATCH] iio: dac: ad5755: fix unised of_match table Ben Dooks
2024-03-08 18:55 ` Ben Dooks [this message]
2024-03-09 17:26 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e0bee548-9a62-469a-8c2c-9548626616d6@codethink.co.uk \
--to=ben.dooks@codethink.co.uk \
--cc=Michael.Hennerich@analog.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox