lkml.org 
[lkml]   [2023]   [Aug]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] iio: dac: ad5755: mark OF related data as maybe unused
On Thu, 10 Aug 2023 13:19:32 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:

> When compile tested with W=1 on x86_64 with driver as built-in:
>
> ad5755.c:866:34: error: unused variable 'ad5755_of_match' [-Werror,-Wunused-const-variable]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

I'd rather see the table used as relying on the fallback path via the spi_match_id table
is fragile as two tables may not have equivalent entries in the long run.
Entry missing in the spi_driver.driver structure.

Bonus points for adding the match data to the of table and making them all pointers
there and in spi_device_id table + using spi_get_device_match_data()

Jonathan


> ---
> drivers/iio/dac/ad5755.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iio/dac/ad5755.c b/drivers/iio/dac/ad5755.c
> index 404865e35460..823049ce2686 100644
> --- a/drivers/iio/dac/ad5755.c
> +++ b/drivers/iio/dac/ad5755.c
> @@ -863,7 +863,7 @@ static const struct spi_device_id ad5755_id[] = {
> };
> MODULE_DEVICE_TABLE(spi, ad5755_id);
>
> -static const struct of_device_id ad5755_of_match[] = {
> +static const struct of_device_id ad5755_of_match[] __maybe_unused = {
> { .compatible = "adi,ad5755" },
> { .compatible = "adi,ad5755-1" },
> { .compatible = "adi,ad5757" },

\
 
 \ /
  Last update: 2023-08-11 17:34    [W:0.152 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site