mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
	Mark Gross <markgross@kernel.org>,
	Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>,
	Daniel Oliveira Nascimento <don@syst.com.br>,
	Mattia Dongili <malattia@linux.it>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] platform: olpc: mark SPI related data as maybe unused
Date: Thu, 16 Mar 2023 13:50:10 +0100	[thread overview]
Message-ID: <63814b1b-1297-da4d-79fe-8f2e58e30482@redhat.com> (raw)
In-Reply-To: <20230312132624.352703-1-krzysztof.kozlowski@linaro.org>

Hi Krzysztof,

On 3/12/23 14:26, Krzysztof Kozlowski wrote:
> The driver can be compile tested as built-in making certain data unused:
> 
>   drivers/platform/olpc/olpc-xo175-ec.c:737:35: error: ‘olpc_xo175_ec_id_table’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/platform/olpc/olpc-xo175-ec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/olpc/olpc-xo175-ec.c b/drivers/platform/olpc/olpc-xo175-ec.c
> index 4823bd2819f6..04573495ef5a 100644
> --- a/drivers/platform/olpc/olpc-xo175-ec.c
> +++ b/drivers/platform/olpc/olpc-xo175-ec.c
> @@ -734,7 +734,7 @@ static const struct of_device_id olpc_xo175_ec_of_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, olpc_xo175_ec_of_match);
>  
> -static const struct spi_device_id olpc_xo175_ec_id_table[] = {
> +static const struct spi_device_id olpc_xo175_ec_id_table[] __maybe_unused = {
>  	{ "xo1.75-ec", 0 },
>  	{}
>  };
>  MODULE_DEVICE_TABLE(spi, olpc_xo175_ec_id_table);

The whole presence of the olpc_xo175_ec_id_table[] seems to make little sense.

This should be referenced by:

static struct spi_driver olpc_xo175_ec_spi_driver = {

Like this:

        .probe          = olpc_xo175_ec_probe,
        .remove         = olpc_xo175_ec_remove,
+       .id_table       = olpc_xo175_ec_id_table,

Otherwise those ids cannot be used to load the driver the non DT/of way. Since the driver assumingly does actually bind already this means that it is only used the DT/of way and it seems to me that the whole olpc_xo175_ec_id_table[] can be removed entirely.

Exposing modaliases for a non supported way of binding the driver does not really seem useful ?

Patches 2/3 and 3/3 do make sense, I'll merge those soonish.

Regards,

Hans







  parent reply	other threads:[~2023-03-16 12:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-12 13:26 Krzysztof Kozlowski
2023-03-12 13:26 ` [PATCH 2/3] platform: classmate: " Krzysztof Kozlowski
2023-03-16 15:14   ` Hans de Goede
2023-03-12 13:26 ` [PATCH 3/3] platform: sony: " Krzysztof Kozlowski
2023-03-16 12:50 ` Hans de Goede [this message]
2023-03-16 14:07   ` [PATCH 1/3] platform: olpc: " Krzysztof Kozlowski
2023-03-16 14:13     ` Hans de Goede
2023-03-16 14:17       ` Krzysztof Kozlowski
2023-03-16 17:31       ` Javier Martinez Canillas

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=63814b1b-1297-da4d-79fe-8f2e58e30482@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=cascardo@holoscopio.com \
    --cc=don@syst.com.br \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malattia@linux.it \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@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

all inboxes | Powered by JetHome®