[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <gh4slqpbzul67vni6hv2opjuvccokfwqnnroxbpqt5oc3kiz65@nbqaxhwltb3z>
Date: Wed, 3 Apr 2024 15:17:21 +0200
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Arnd Bergmann <arnd@...nel.org>
Cc: linux-kernel@...r.kernel.org,
Dmitry Torokhov <dmitry.torokhov@...il.com>, Maxime Coquelin <mcoquelin.stm32@...il.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>, Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
Arnd Bergmann <arnd@...db.de>, linux-input@...r.kernel.org,
linux-stm32@...md-mailman.stormreply.com, linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 07/34] Input: stmpe-ts - mark OF related data as maybe
unused
Hello,
On Wed, Apr 03, 2024 at 10:06:25AM +0200, Arnd Bergmann wrote:
> From: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
>
> When compile tested with W=1 on x86_64 with driver as built-in:
>
> stmpe-ts.c:371:34: error: unused variable 'stmpe_ts_ids' [-Werror,-Wunused-const-variable]
>
> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
> drivers/input/touchscreen/stmpe-ts.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
> index b204fdb2d22c..022b3e94266d 100644
> --- a/drivers/input/touchscreen/stmpe-ts.c
> +++ b/drivers/input/touchscreen/stmpe-ts.c
> @@ -366,7 +366,7 @@ static struct platform_driver stmpe_ts_driver = {
> };
> module_platform_driver(stmpe_ts_driver);
>
> -static const struct of_device_id stmpe_ts_ids[] = {
> +static const struct of_device_id stmpe_ts_ids[] __maybe_unused = {
> { .compatible = "st,stmpe-ts", },
> { },
> };
I'd suggest the following instead:
diff --git a/drivers/input/touchscreen/stmpe-ts.c b/drivers/input/touchscreen/stmpe-ts.c
index b204fdb2d22c..e1afebc641ec 100644
--- a/drivers/input/touchscreen/stmpe-ts.c
+++ b/drivers/input/touchscreen/stmpe-ts.c
@@ -357,21 +357,22 @@ static void stmpe_ts_remove(struct platform_device *pdev)
stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN);
}
-static struct platform_driver stmpe_ts_driver = {
- .driver = {
- .name = STMPE_TS_NAME,
- },
- .probe = stmpe_input_probe,
- .remove_new = stmpe_ts_remove,
-};
-module_platform_driver(stmpe_ts_driver);
-
static const struct of_device_id stmpe_ts_ids[] = {
{ .compatible = "st,stmpe-ts", },
{ },
};
MODULE_DEVICE_TABLE(of, stmpe_ts_ids);
+static struct platform_driver stmpe_ts_driver = {
+ .driver = {
+ .name = STMPE_TS_NAME,
+ .of_match_table = stmpe_ts_ids,
+ },
+ .probe = stmpe_input_probe,
+ .remove_new = stmpe_ts_remove,
+};
+module_platform_driver(stmpe_ts_driver);
+
MODULE_AUTHOR("Luotao Fu <l.fu@...gutronix.de>");
MODULE_DESCRIPTION("STMPEXXX touchscreen driver");
MODULE_LICENSE("GPL");
I wonder if with the status quo binding via dt works at all with
stmpe_ts_driver.driver.of_match_table unset?!
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists