Linux kernel staging patches
 help / color / mirror / Atom feed
From: Alex Elder <elder@ieee.org>
To: Arnd Bergmann <arnd@kernel.org>,
	linux-kernel@vger.kernel.org,
	Vaibhav Hiremath <hvaibhav.linux@gmail.com>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Arnd Bergmann" <arnd@arndb.de>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Rob Herring" <robh@kernel.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev
Subject: Re: [PATCH 17/34] greybus: arche-ctrl: move device table to its right location
Date: Tue, 30 Apr 2024 18:41:42 -0500	[thread overview]
Message-ID: <506f15e3-b40e-481a-9eac-772faf4feb6b@ieee.org> (raw)
In-Reply-To: <20240403080702.3509288-18-arnd@kernel.org>

On 4/3/24 3:06 AM, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The arche-ctrl has two platform drivers and three of_device_id tables,
> but one table is only used for the the module loader, while the other
> two seem to be associated with their drivers.
> 
> This leads to a W=1 warning when the driver is built-in:
> 
> drivers/staging/greybus/arche-platform.c:623:34: error: 'arche_combined_id' defined but not used [-Werror=unused-const-variable=]
>    623 | static const struct of_device_id arche_combined_id[] = {
> 
> Drop the extra table and register both tables that are actually
> used as the ones for the module loader instead.

So what I see is that this commit added arche_combined_id[]:
   1e5dd1f8279a8 greybus: arche-platform: merge arche-apb-ctrl and 
arche-platform

That moved the arche_apb_ctrl_device_driver struct and some other
associated bits out of arche-apb-ctrl.c and into arche-platform.c.
It *kept* arche_platform_of_match[] as the of_match_table for
arche_platform_device_driver, but defined arche_combined_id[] and
declared it for modalias to indicate both drivers were implemented
in the single kernel module.

The later commit (the one you references in "Fixes") then moved
the arche_apb_ctrl_device_driver etc. back to arche-apb-ctrl.c.
That commit did *not* use MODULE_DEVICE_TABLE() to declare
arche_apb_ctrl_of_match[] for modalias.  And it simply kept the
(no longer correct) arche_combined_id[] table to be used by the
arche_platform_device_driver.

So your fix:
- Declares for modalias that arche_apb_ctrl_of_match[] is the
   of_match_table for arche_apb_ctrl_device_driver.
- Declares for modalias that arche_platform_of_match[] is the
   of_match_table for arche_platform_device_driver.
- Gets rid of arche_combined_id[], which is no longer used.

In short:  looks good to me.

Reviewed-by: Alex Elder <elder@linaro.org>

> 
> Fixes: 7b62b61c752a ("greybus: arche-ctrl: Don't expose driver internals to arche-platform driver")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>   drivers/staging/greybus/arche-apb-ctrl.c | 1 +
>   drivers/staging/greybus/arche-platform.c | 9 +--------
>   2 files changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/greybus/arche-apb-ctrl.c b/drivers/staging/greybus/arche-apb-ctrl.c
> index 8541995008da..aa6f266b62a1 100644
> --- a/drivers/staging/greybus/arche-apb-ctrl.c
> +++ b/drivers/staging/greybus/arche-apb-ctrl.c
> @@ -466,6 +466,7 @@ static const struct of_device_id arche_apb_ctrl_of_match[] = {
>   	{ .compatible = "usbffff,2", },
>   	{ },
>   };
> +MODULE_DEVICE_TABLE(of, arche_apb_ctrl_of_match);
>   
>   static struct platform_driver arche_apb_ctrl_device_driver = {
>   	.probe		= arche_apb_ctrl_probe,
> diff --git a/drivers/staging/greybus/arche-platform.c b/drivers/staging/greybus/arche-platform.c
> index 891b75327d7f..b33977ccd527 100644
> --- a/drivers/staging/greybus/arche-platform.c
> +++ b/drivers/staging/greybus/arche-platform.c
> @@ -619,14 +619,7 @@ static const struct of_device_id arche_platform_of_match[] = {
>   	{ .compatible = "google,arche-platform", },
>   	{ },
>   };
> -
> -static const struct of_device_id arche_combined_id[] = {
> -	/* Use PID/VID of SVC device */
> -	{ .compatible = "google,arche-platform", },
> -	{ .compatible = "usbffff,2", },
> -	{ },
> -};
> -MODULE_DEVICE_TABLE(of, arche_combined_id);
> +MODULE_DEVICE_TABLE(of, arche_platform_of_match);
>   
>   static struct platform_driver arche_platform_device_driver = {
>   	.probe		= arche_platform_probe,


  reply	other threads:[~2024-04-30 23:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03  8:06 [PATCH 00/34] address all -Wunused-const warnings Arnd Bergmann
2024-04-03  8:06 ` [PATCH 17/34] greybus: arche-ctrl: move device table to its right location Arnd Bergmann
2024-04-30 23:41   ` Alex Elder [this message]
2024-04-03  8:06 ` [PATCH 33/34] drivers: remove incorrect of_match_ptr/ACPI_PTR annotations Arnd Bergmann
2024-04-03  9:13   ` Krzysztof Kozlowski
2024-04-03  9:30   ` Andy Shevchenko
2024-04-03 12:47     ` Corey Minyard
2024-04-03 13:23       ` Andy Shevchenko
2024-04-03 12:47   ` Corey Minyard
2024-04-03 16:09   ` Jarkko Sakkinen
2024-04-09 13:48   ` Greg Kroah-Hartman
2024-04-23  7:33   ` Xu Yilun
2024-04-23  9:52   ` Peter Rosin
2024-04-06  5:20 ` [PATCH 00/34] address all -Wunused-const warnings patchwork-bot+netdevbpf
2024-04-10  8:02 ` (subset) " Sebastian Reichel
2024-04-22  8:16 ` Michael Ellerman

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=506f15e3-b40e-481a-9eac-772faf4feb6b@ieee.org \
    --to=elder@ieee.org \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=hvaibhav.linux@gmail.com \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=luca.ceresoli@bootlin.com \
    --cc=robh@kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=viresh.kumar@linaro.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).