* [PATCH] iio: light: max44009: Remove the unused variable max44009_of_match
@ 2023-01-05 9:50 Jiapeng Chong
2023-01-05 9:58 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Jiapeng Chong @ 2023-01-05 9:50 UTC (permalink / raw)
To: jic23; +Cc: lars, linux-iio, linux-kernel, Jiapeng Chong, Abaci Robot
Variable max44009_of_match is not effectively used, so delete it.
drivers/iio/light/max44009.c:545:34: warning: ‘max44009_of_match’ defined but not used.
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3632
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
drivers/iio/light/max44009.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/iio/light/max44009.c b/drivers/iio/light/max44009.c
index 3dadace09fe2..2f80a654ad6a 100644
--- a/drivers/iio/light/max44009.c
+++ b/drivers/iio/light/max44009.c
@@ -542,12 +542,6 @@ static struct i2c_driver max44009_driver = {
};
module_i2c_driver(max44009_driver);
-static const struct of_device_id max44009_of_match[] = {
- { .compatible = "maxim,max44009" },
- { }
-};
-MODULE_DEVICE_TABLE(of, max44009_of_match);
-
MODULE_AUTHOR("Robert Eshleman <bobbyeshleman@gmail.com>");
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("MAX44009 ambient light sensor driver");
--
2.20.1.7.g153144c
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] iio: light: max44009: Remove the unused variable max44009_of_match
2023-01-05 9:50 [PATCH] iio: light: max44009: Remove the unused variable max44009_of_match Jiapeng Chong
@ 2023-01-05 9:58 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2023-01-05 9:58 UTC (permalink / raw)
To: Jiapeng Chong; +Cc: jic23, lars, linux-iio, linux-kernel, Abaci Robot
On Thu, 5 Jan 2023 17:50:38 +0800
Jiapeng Chong <jiapeng.chong@linux.alibaba.com> wrote:
> Variable max44009_of_match is not effectively used, so delete it.
>
> drivers/iio/light/max44009.c:545:34: warning: ‘max44009_of_match’ defined but not used.
>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3632
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Thanks, but a better fix would be to set the of_device_id element of the driver structure
to point to this (you'll need to move the of_device_id table up a few lines)
Also, the MODULE_DEVICE_TABLE() macro is using this if you are building
modules - so I'm fairly sure this is a false positive warning anyway.
The resulting alias can be used as part of a module autoloading.
Jonathan
> ---
> drivers/iio/light/max44009.c | 6 ------
> 1 file changed, 6 deletions(-)
>
> diff --git a/drivers/iio/light/max44009.c b/drivers/iio/light/max44009.c
> index 3dadace09fe2..2f80a654ad6a 100644
> --- a/drivers/iio/light/max44009.c
> +++ b/drivers/iio/light/max44009.c
> @@ -542,12 +542,6 @@ static struct i2c_driver max44009_driver = {
> };
> module_i2c_driver(max44009_driver);
>
> -static const struct of_device_id max44009_of_match[] = {
> - { .compatible = "maxim,max44009" },
> - { }
> -};
> -MODULE_DEVICE_TABLE(of, max44009_of_match);
> -
> MODULE_AUTHOR("Robert Eshleman <bobbyeshleman@gmail.com>");
> MODULE_LICENSE("GPL v2");
> MODULE_DESCRIPTION("MAX44009 ambient light sensor driver");
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-01-05 9:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-05 9:50 [PATCH] iio: light: max44009: Remove the unused variable max44009_of_match Jiapeng Chong
2023-01-05 9:58 ` Jonathan Cameron
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox