From: Jonathan Cameron <jic23@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Maxime Coquelin <mcoquelin.stm32@gmail.com>,
Alexandre Torgue <alexandre.torgue@foss.st.com>,
linux-iio@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching
Date: Sun, 1 May 2022 19:00:15 +0100 [thread overview]
Message-ID: <20220501190015.48d6acd3@jic23-huawei> (raw)
In-Reply-To: <20220501103447.111392-1-krzysztof.kozlowski@linaro.org>
On Sun, 1 May 2022 12:34:46 +0200
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> wrote:
> The of_device_id was added to allow module autoloading, but it should be
> also used to allow driver matching via Devicetree.
>
> This also fixes W=1 warning:
> drivers/iio/adc/stmpe-adc.c:357:34: error: ‘stmpe_adc_ids’ defined but not used [-Werror=unused-const-variable=]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Series applied to the togreg branch of iio.git and pushed out as testing for 0-day
to poke at it.
Thanks,
Jonathan
> ---
> drivers/iio/adc/stmpe-adc.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c
> index d2d405388499..0208789fc0f5 100644
> --- a/drivers/iio/adc/stmpe-adc.c
> +++ b/drivers/iio/adc/stmpe-adc.c
> @@ -345,21 +345,22 @@ static int __maybe_unused stmpe_adc_resume(struct device *dev)
>
> static SIMPLE_DEV_PM_OPS(stmpe_adc_pm_ops, NULL, stmpe_adc_resume);
>
> +static const struct of_device_id stmpe_adc_ids[] = {
> + { .compatible = "st,stmpe-adc", },
> + { },
> +};
> +MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> +
> static struct platform_driver stmpe_adc_driver = {
> .probe = stmpe_adc_probe,
> .driver = {
> .name = "stmpe-adc",
> .pm = &stmpe_adc_pm_ops,
> + .of_match_table = stmpe_adc_ids,
> },
> };
> module_platform_driver(stmpe_adc_driver);
>
> -static const struct of_device_id stmpe_adc_ids[] = {
> - { .compatible = "st,stmpe-adc", },
> - { },
> -};
> -MODULE_DEVICE_TABLE(of, stmpe_adc_ids);
> -
> MODULE_AUTHOR("Stefan Agner <stefan.agner@toradex.com>");
> MODULE_DESCRIPTION("STMPEXXX ADC driver");
> MODULE_LICENSE("GPL v2");
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-05-01 17:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-01 10:34 [PATCH 1/2] iio: stmpe-adc: use of_device_id for OF matching Krzysztof Kozlowski
2022-05-01 10:34 ` [PATCH 2/2] iio: ti-ads8688: " Krzysztof Kozlowski
2022-05-01 18:00 ` Jonathan Cameron [this message]
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=20220501190015.48d6acd3@jic23-huawei \
--to=jic23@kernel.org \
--cc=alexandre.torgue@foss.st.com \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mcoquelin.stm32@gmail.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;
as well as URLs for NNTP newsgroup(s).