* [PATCH] drm/ssd130x: Only define a SPI device ID table when built as a module
@ 2022-05-30 14:02 ` Javier Martinez Canillas
0 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2022-05-30 14:02 UTC (permalink / raw)
To: linux-kernel
Cc: kernel test robot, Geert Uytterhoeven, David Airlie,
Javier Martinez Canillas, dri-devel, Nathan Chancellor,
Mark Brown, Geert Uytterhoeven
The kernel test robot reports a compile warning due the ssd130x_spi_table
variable being defined but not used. This happen when ssd130x-spi driver
is built-in instead of being built as a module, i.e:
CC drivers/gpu/drm/solomon/ssd130x-spi.o
AR drivers/base/firmware_loader/built-in.a
AR drivers/base/built-in.a
CC kernel/trace/trace.o
drivers/gpu/drm/solomon/ssd130x-spi.c:155:35: warning: ‘ssd130x_spi_table’ defined but not used [-Wunused-const-variable=]
155 | static const struct spi_device_id ssd130x_spi_table[] = {
| ^~~~~~~~~~~~~~~~~
The driver shouldn't need a SPI device ID table and only have an OF device
ID table, but the former is needed to workaround an issue in the SPI core.
This always reports a MODALIAS of the form "spi:<device>" even for devices
registered through Device Trees.
But the table is only needed when the driver built as a module to populate
the .ko alias info. It's not needed when the driver is built-in the kernel.
Fixes: 74373977d2ca ("drm/solomon: Add SSD130x OLED displays SPI support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/gpu/drm/solomon/ssd130x-spi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/solomon/ssd130x-spi.c b/drivers/gpu/drm/solomon/ssd130x-spi.c
index 43722adab1f8..07802907e39a 100644
--- a/drivers/gpu/drm/solomon/ssd130x-spi.c
+++ b/drivers/gpu/drm/solomon/ssd130x-spi.c
@@ -143,6 +143,7 @@ static const struct of_device_id ssd130x_of_match[] = {
};
MODULE_DEVICE_TABLE(of, ssd130x_of_match);
+#if IS_MODULE(CONFIG_DRM_SSD130X_SPI)
/*
* The SPI core always reports a MODALIAS uevent of the form "spi:<dev>", even
* if the device was registered via OF. This means that the module will not be
@@ -160,6 +161,7 @@ static const struct spi_device_id ssd130x_spi_table[] = {
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(spi, ssd130x_spi_table);
+#endif
static struct spi_driver ssd130x_spi_driver = {
.driver = {
--
2.36.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] drm/ssd130x: Only define a SPI device ID table when built as a module
@ 2022-05-30 14:02 ` Javier Martinez Canillas
0 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2022-05-30 14:02 UTC (permalink / raw)
To: linux-kernel
Cc: Nathan Chancellor, Geert Uytterhoeven, Javier Martinez Canillas,
kernel test robot, Daniel Vetter, David Airlie,
Geert Uytterhoeven, Mark Brown, dri-devel
The kernel test robot reports a compile warning due the ssd130x_spi_table
variable being defined but not used. This happen when ssd130x-spi driver
is built-in instead of being built as a module, i.e:
CC drivers/gpu/drm/solomon/ssd130x-spi.o
AR drivers/base/firmware_loader/built-in.a
AR drivers/base/built-in.a
CC kernel/trace/trace.o
drivers/gpu/drm/solomon/ssd130x-spi.c:155:35: warning: ‘ssd130x_spi_table’ defined but not used [-Wunused-const-variable=]
155 | static const struct spi_device_id ssd130x_spi_table[] = {
| ^~~~~~~~~~~~~~~~~
The driver shouldn't need a SPI device ID table and only have an OF device
ID table, but the former is needed to workaround an issue in the SPI core.
This always reports a MODALIAS of the form "spi:<device>" even for devices
registered through Device Trees.
But the table is only needed when the driver built as a module to populate
the .ko alias info. It's not needed when the driver is built-in the kernel.
Fixes: 74373977d2ca ("drm/solomon: Add SSD130x OLED displays SPI support")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
---
drivers/gpu/drm/solomon/ssd130x-spi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/solomon/ssd130x-spi.c b/drivers/gpu/drm/solomon/ssd130x-spi.c
index 43722adab1f8..07802907e39a 100644
--- a/drivers/gpu/drm/solomon/ssd130x-spi.c
+++ b/drivers/gpu/drm/solomon/ssd130x-spi.c
@@ -143,6 +143,7 @@ static const struct of_device_id ssd130x_of_match[] = {
};
MODULE_DEVICE_TABLE(of, ssd130x_of_match);
+#if IS_MODULE(CONFIG_DRM_SSD130X_SPI)
/*
* The SPI core always reports a MODALIAS uevent of the form "spi:<dev>", even
* if the device was registered via OF. This means that the module will not be
@@ -160,6 +161,7 @@ static const struct spi_device_id ssd130x_spi_table[] = {
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(spi, ssd130x_spi_table);
+#endif
static struct spi_driver ssd130x_spi_driver = {
.driver = {
--
2.36.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/ssd130x: Only define a SPI device ID table when built as a module
2022-05-30 14:02 ` Javier Martinez Canillas
@ 2022-05-31 15:10 ` Nathan Chancellor
-1 siblings, 0 replies; 5+ messages in thread
From: Nathan Chancellor @ 2022-05-31 15:10 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: linux-kernel, Geert Uytterhoeven, kernel test robot,
Daniel Vetter, David Airlie, Geert Uytterhoeven, Mark Brown,
dri-devel
On Mon, May 30, 2022 at 04:02:46PM +0200, Javier Martinez Canillas wrote:
> The kernel test robot reports a compile warning due the ssd130x_spi_table
> variable being defined but not used. This happen when ssd130x-spi driver
> is built-in instead of being built as a module, i.e:
>
> CC drivers/gpu/drm/solomon/ssd130x-spi.o
> AR drivers/base/firmware_loader/built-in.a
> AR drivers/base/built-in.a
> CC kernel/trace/trace.o
> drivers/gpu/drm/solomon/ssd130x-spi.c:155:35: warning: ‘ssd130x_spi_table’ defined but not used [-Wunused-const-variable=]
> 155 | static const struct spi_device_id ssd130x_spi_table[] = {
> | ^~~~~~~~~~~~~~~~~
>
> The driver shouldn't need a SPI device ID table and only have an OF device
> ID table, but the former is needed to workaround an issue in the SPI core.
> This always reports a MODALIAS of the form "spi:<device>" even for devices
> registered through Device Trees.
>
> But the table is only needed when the driver built as a module to populate
> the .ko alias info. It's not needed when the driver is built-in the kernel.
>
> Fixes: 74373977d2ca ("drm/solomon: Add SSD130x OLED displays SPI support")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
>
> drivers/gpu/drm/solomon/ssd130x-spi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/solomon/ssd130x-spi.c b/drivers/gpu/drm/solomon/ssd130x-spi.c
> index 43722adab1f8..07802907e39a 100644
> --- a/drivers/gpu/drm/solomon/ssd130x-spi.c
> +++ b/drivers/gpu/drm/solomon/ssd130x-spi.c
> @@ -143,6 +143,7 @@ static const struct of_device_id ssd130x_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, ssd130x_of_match);
>
> +#if IS_MODULE(CONFIG_DRM_SSD130X_SPI)
> /*
> * The SPI core always reports a MODALIAS uevent of the form "spi:<dev>", even
> * if the device was registered via OF. This means that the module will not be
> @@ -160,6 +161,7 @@ static const struct spi_device_id ssd130x_spi_table[] = {
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(spi, ssd130x_spi_table);
> +#endif
>
> static struct spi_driver ssd130x_spi_driver = {
> .driver = {
> --
> 2.36.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/ssd130x: Only define a SPI device ID table when built as a module
@ 2022-05-31 15:10 ` Nathan Chancellor
0 siblings, 0 replies; 5+ messages in thread
From: Nathan Chancellor @ 2022-05-31 15:10 UTC (permalink / raw)
To: Javier Martinez Canillas
Cc: kernel test robot, Geert Uytterhoeven, David Airlie,
linux-kernel, dri-devel, Mark Brown, Geert Uytterhoeven
On Mon, May 30, 2022 at 04:02:46PM +0200, Javier Martinez Canillas wrote:
> The kernel test robot reports a compile warning due the ssd130x_spi_table
> variable being defined but not used. This happen when ssd130x-spi driver
> is built-in instead of being built as a module, i.e:
>
> CC drivers/gpu/drm/solomon/ssd130x-spi.o
> AR drivers/base/firmware_loader/built-in.a
> AR drivers/base/built-in.a
> CC kernel/trace/trace.o
> drivers/gpu/drm/solomon/ssd130x-spi.c:155:35: warning: ‘ssd130x_spi_table’ defined but not used [-Wunused-const-variable=]
> 155 | static const struct spi_device_id ssd130x_spi_table[] = {
> | ^~~~~~~~~~~~~~~~~
>
> The driver shouldn't need a SPI device ID table and only have an OF device
> ID table, but the former is needed to workaround an issue in the SPI core.
> This always reports a MODALIAS of the form "spi:<device>" even for devices
> registered through Device Trees.
>
> But the table is only needed when the driver built as a module to populate
> the .ko alias info. It's not needed when the driver is built-in the kernel.
>
> Fixes: 74373977d2ca ("drm/solomon: Add SSD130x OLED displays SPI support")
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
>
> drivers/gpu/drm/solomon/ssd130x-spi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/solomon/ssd130x-spi.c b/drivers/gpu/drm/solomon/ssd130x-spi.c
> index 43722adab1f8..07802907e39a 100644
> --- a/drivers/gpu/drm/solomon/ssd130x-spi.c
> +++ b/drivers/gpu/drm/solomon/ssd130x-spi.c
> @@ -143,6 +143,7 @@ static const struct of_device_id ssd130x_of_match[] = {
> };
> MODULE_DEVICE_TABLE(of, ssd130x_of_match);
>
> +#if IS_MODULE(CONFIG_DRM_SSD130X_SPI)
> /*
> * The SPI core always reports a MODALIAS uevent of the form "spi:<dev>", even
> * if the device was registered via OF. This means that the module will not be
> @@ -160,6 +161,7 @@ static const struct spi_device_id ssd130x_spi_table[] = {
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(spi, ssd130x_spi_table);
> +#endif
>
> static struct spi_driver ssd130x_spi_driver = {
> .driver = {
> --
> 2.36.1
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/ssd130x: Only define a SPI device ID table when built as a module
2022-05-31 15:10 ` Nathan Chancellor
(?)
@ 2022-06-01 22:38 ` Javier Martinez Canillas
-1 siblings, 0 replies; 5+ messages in thread
From: Javier Martinez Canillas @ 2022-06-01 22:38 UTC (permalink / raw)
To: Nathan Chancellor
Cc: kernel test robot, Geert Uytterhoeven, David Airlie,
linux-kernel, dri-devel, Mark Brown, Geert Uytterhoeven
On 5/31/22 17:10, Nathan Chancellor wrote:
> On Mon, May 30, 2022 at 04:02:46PM +0200, Javier Martinez Canillas wrote:
>> The kernel test robot reports a compile warning due the ssd130x_spi_table
>> variable being defined but not used. This happen when ssd130x-spi driver
>> is built-in instead of being built as a module, i.e:
>>
>> CC drivers/gpu/drm/solomon/ssd130x-spi.o
>> AR drivers/base/firmware_loader/built-in.a
>> AR drivers/base/built-in.a
>> CC kernel/trace/trace.o
>> drivers/gpu/drm/solomon/ssd130x-spi.c:155:35: warning: ‘ssd130x_spi_table’ defined but not used [-Wunused-const-variable=]
>> 155 | static const struct spi_device_id ssd130x_spi_table[] = {
>> | ^~~~~~~~~~~~~~~~~
>>
>> The driver shouldn't need a SPI device ID table and only have an OF device
>> ID table, but the former is needed to workaround an issue in the SPI core.
>> This always reports a MODALIAS of the form "spi:<device>" even for devices
>> registered through Device Trees.
>>
>> But the table is only needed when the driver built as a module to populate
>> the .ko alias info. It's not needed when the driver is built-in the kernel.
>>
>> Fixes: 74373977d2ca ("drm/solomon: Add SSD130x OLED displays SPI support")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
>
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
>
Thanks! Pushed this to drm-misc (drm-misc-next).
--
Best regards,
Javier Martinez Canillas
Linux Engineering
Red Hat
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-06-01 22:38 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-30 14:02 [PATCH] drm/ssd130x: Only define a SPI device ID table when built as a module Javier Martinez Canillas
2022-05-30 14:02 ` Javier Martinez Canillas
2022-05-31 15:10 ` Nathan Chancellor
2022-05-31 15:10 ` Nathan Chancellor
2022-06-01 22:38 ` Javier Martinez Canillas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.