Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno 
	<angelogioacchino.delregno@collabora.com>,
	Tony Lindgren <tony@atomide.com>, Andy Gross <agross@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-omap@vger.kernel.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH 2/9] regulator: max20086: Mark OF related data as maybe unused
Date: Sun, 12 Mar 2023 11:42:16 +0200	[thread overview]
Message-ID: <20230312094216.GC707@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20230310214553.275450-2-krzysztof.kozlowski@linaro.org>

Hi Krzysztof,

Thank you for the patch.

On Fri, Mar 10, 2023 at 10:45:46PM +0100, Krzysztof Kozlowski wrote:
> The driver can be compile tested with !CONFIG_OF making certain data
> unused:
> 
>   drivers/regulator/max20086-regulator.c:289:34: error: ‘max20086_dt_ids’ defined but not used [-Werror=unused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> ---
>  drivers/regulator/max20086-regulator.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/regulator/max20086-regulator.c b/drivers/regulator/max20086-regulator.c
> index b8bf76c170fe..c98a72f43935 100644
> --- a/drivers/regulator/max20086-regulator.c
> +++ b/drivers/regulator/max20086-regulator.c
> @@ -286,7 +286,7 @@ static const struct i2c_device_id max20086_i2c_id[] = {
>  
>  MODULE_DEVICE_TABLE(i2c, max20086_i2c_id);
>  
> -static const struct of_device_id max20086_dt_ids[] = {
> +static const struct of_device_id max20086_dt_ids[] __maybe_unused = {

The following change would also work, as the of_match_table field of
struct device_driver isn't conditioned by CONFIG_OF:

diff --git a/drivers/regulator/max20086-regulator.c b/drivers/regulator/max20086-regulator.c
index b8bf76c170fe..ad92f84b4abb 100644
--- a/drivers/regulator/max20086-regulator.c
+++ b/drivers/regulator/max20086-regulator.c
@@ -320,7 +320,7 @@ MODULE_DEVICE_TABLE(of, max20086_dt_ids);
 static struct i2c_driver max20086_regulator_driver = {
 	.driver = {
 		.name = "max20086",
-		.of_match_table = of_match_ptr(max20086_dt_ids),
+		.of_match_table = max20086_dt_ids,
 	},
 	.probe_new = max20086_i2c_probe,
 	.id_table = max20086_i2c_id,

Your patch should reduce the module size without any real drawback as
far as I can see, so that's probably best. I'm fine with either
approach, so

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>  	{
>  		.compatible = "maxim,max20086",
>  		.data = &(const struct max20086_chip_info) {

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-03-12  9:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 21:45 [PATCH 1/9] regulator: lp872x: Mark OF related data as maybe unused Krzysztof Kozlowski
2023-03-10 21:45 ` [PATCH 2/9] regulator: max20086: " Krzysztof Kozlowski
2023-03-12  9:42   ` Laurent Pinchart [this message]
2023-03-12 10:03     ` Krzysztof Kozlowski
2023-03-10 21:45 ` [PATCH 3/9] regulator: mp8859: " Krzysztof Kozlowski
2023-03-10 21:45 ` [PATCH 4/9] regulator: mt6397-regulator: " Krzysztof Kozlowski
2023-03-13  8:45   ` AngeloGioacchino Del Regno
2023-03-10 21:45 ` [PATCH 5/9] regulator: qcom_rpm: Drop of_match_ptr for ID table Krzysztof Kozlowski
2023-03-10 21:45 ` [PATCH 6/9] regulator: pbias: " Krzysztof Kozlowski
2023-03-10 21:45 ` [PATCH 7/9] regulator: rpi-panel-attiny: " Krzysztof Kozlowski
2023-03-15  9:12   ` Neil Armstrong
2023-03-10 21:45 ` [PATCH 8/9] regulator: twl: " Krzysztof Kozlowski
2023-03-10 21:45 ` [PATCH 9/9] regulator: twl6030: " Krzysztof Kozlowski
2023-03-13 13:58 ` [PATCH 1/9] regulator: lp872x: Mark OF related data as maybe unused Mark Brown
2023-03-13 19:07 ` (subset) " Mark Brown

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=20230312094216.GC707@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=matthias.bgg@gmail.com \
    --cc=tony@atomide.com \
    /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