diff mbox series

[12/14] spi: spi-at91-usart: Make use of the defined 'struct of_device_id'

Message ID 20200715150632.409077-13-lee.jones@linaro.org (mailing list archive)
State New, archived
Headers show
Series Rid W=1 warnings in SPI | expand

Commit Message

Lee Jones July 15, 2020, 3:06 p.m. UTC
It's there so why not use it.

Fixes the following W=1 kernel build warning(s):

 drivers/spi/spi-at91-usart.c:684:34: warning: ‘at91_usart_spi_dt_ids’ defined but not used [-Wunused-const-variable=]
 684 | static const struct of_device_id at91_usart_spi_dt_ids[] = {
 | ^~~~~~~~~~~~~~~~~~~~~

Cc: Radu Pirea <radu_nicolae.pirea@upb.ro>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
 drivers/spi/spi-at91-usart.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Alexandre Belloni July 15, 2020, 9:24 p.m. UTC | #1
Hi Lee,

On 15/07/2020 16:06:30+0100, Lee Jones wrote:
> It's there so why not use it.
> 

Is that the correct resolution? Isn't the proper thing to do simply
removing at91_usart_spi_dt_ids as the only way it will ever be probed is
through drivers/mfd/at91-usart.c and I would think matching the driver
name is enough.

> Fixes the following W=1 kernel build warning(s):
> 
>  drivers/spi/spi-at91-usart.c:684:34: warning: ‘at91_usart_spi_dt_ids’ defined but not used [-Wunused-const-variable=]
>  684 | static const struct of_device_id at91_usart_spi_dt_ids[] = {
>  | ^~~~~~~~~~~~~~~~~~~~~
> 
> Cc: Radu Pirea <radu_nicolae.pirea@upb.ro>
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
> ---
>  drivers/spi/spi-at91-usart.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> index 88033422a42ae..d47a20be43ccd 100644
> --- a/drivers/spi/spi-at91-usart.c
> +++ b/drivers/spi/spi-at91-usart.c
> @@ -692,6 +692,7 @@ static struct platform_driver at91_usart_spi_driver = {
>  	.driver = {
>  		.name = "at91_usart_spi",
>  		.pm = &at91_usart_spi_pm_ops,
> +		.of_match_table = at91_usart_spi_dt_ids,
>  	},
>  	.probe = at91_usart_spi_probe,
>  	.remove = at91_usart_spi_remove,
> -- 
> 2.25.1
>
Lee Jones July 16, 2020, 7:56 a.m. UTC | #2
On Wed, 15 Jul 2020, Alexandre Belloni wrote:

> Hi Lee,
> 
> On 15/07/2020 16:06:30+0100, Lee Jones wrote:
> > It's there so why not use it.
> > 
> 
> Is that the correct resolution? Isn't the proper thing to do simply
> removing at91_usart_spi_dt_ids as the only way it will ever be probed is
> through drivers/mfd/at91-usart.c and I would think matching the driver
> name is enough.

I'm 50/50 on this.

Happy with whatever the authors/maintainers decide most appropriate.

> > Fixes the following W=1 kernel build warning(s):
> > 
> >  drivers/spi/spi-at91-usart.c:684:34: warning: ‘at91_usart_spi_dt_ids’ defined but not used [-Wunused-const-variable=]
> >  684 | static const struct of_device_id at91_usart_spi_dt_ids[] = {
> >  | ^~~~~~~~~~~~~~~~~~~~~
> > 
> > Cc: Radu Pirea <radu_nicolae.pirea@upb.ro>
> > Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > ---
> >  drivers/spi/spi-at91-usart.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> > index 88033422a42ae..d47a20be43ccd 100644
> > --- a/drivers/spi/spi-at91-usart.c
> > +++ b/drivers/spi/spi-at91-usart.c
> > @@ -692,6 +692,7 @@ static struct platform_driver at91_usart_spi_driver = {
> >  	.driver = {
> >  		.name = "at91_usart_spi",
> >  		.pm = &at91_usart_spi_pm_ops,
> > +		.of_match_table = at91_usart_spi_dt_ids,
> >  	},
> >  	.probe = at91_usart_spi_probe,
> >  	.remove = at91_usart_spi_remove,
>
Alexandre Belloni July 16, 2020, 8:50 a.m. UTC | #3
On 16/07/2020 08:56:06+0100, Lee Jones wrote:
> On Wed, 15 Jul 2020, Alexandre Belloni wrote:
> 
> > Hi Lee,
> > 
> > On 15/07/2020 16:06:30+0100, Lee Jones wrote:
> > > It's there so why not use it.
> > > 
> > 
> > Is that the correct resolution? Isn't the proper thing to do simply
> > removing at91_usart_spi_dt_ids as the only way it will ever be probed is
> > through drivers/mfd/at91-usart.c and I would think matching the driver
> > name is enough.
> 
> I'm 50/50 on this.
> 
> Happy with whatever the authors/maintainers decide most appropriate.
> 

Seeing that the compatible string is not documented or used by any dts,
I would go for the removal.

> > > Fixes the following W=1 kernel build warning(s):
> > > 
> > >  drivers/spi/spi-at91-usart.c:684:34: warning: ‘at91_usart_spi_dt_ids’ defined but not used [-Wunused-const-variable=]
> > >  684 | static const struct of_device_id at91_usart_spi_dt_ids[] = {
> > >  | ^~~~~~~~~~~~~~~~~~~~~
> > > 
> > > Cc: Radu Pirea <radu_nicolae.pirea@upb.ro>
> > > Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> > > Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > > Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> > > Signed-off-by: Lee Jones <lee.jones@linaro.org>
> > > ---
> > >  drivers/spi/spi-at91-usart.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
> > > index 88033422a42ae..d47a20be43ccd 100644
> > > --- a/drivers/spi/spi-at91-usart.c
> > > +++ b/drivers/spi/spi-at91-usart.c
> > > @@ -692,6 +692,7 @@ static struct platform_driver at91_usart_spi_driver = {
> > >  	.driver = {
> > >  		.name = "at91_usart_spi",
> > >  		.pm = &at91_usart_spi_pm_ops,
> > > +		.of_match_table = at91_usart_spi_dt_ids,
> > >  	},
> > >  	.probe = at91_usart_spi_probe,
> > >  	.remove = at91_usart_spi_remove,
> > 
> 
> -- 
> Lee Jones [李琼斯]
> Senior Technical Lead - Developer Services
> Linaro.org │ Open source software for Arm SoCs
> Follow Linaro: Facebook | Twitter | Blog
diff mbox series

Patch

diff --git a/drivers/spi/spi-at91-usart.c b/drivers/spi/spi-at91-usart.c
index 88033422a42ae..d47a20be43ccd 100644
--- a/drivers/spi/spi-at91-usart.c
+++ b/drivers/spi/spi-at91-usart.c
@@ -692,6 +692,7 @@  static struct platform_driver at91_usart_spi_driver = {
 	.driver = {
 		.name = "at91_usart_spi",
 		.pm = &at91_usart_spi_pm_ops,
+		.of_match_table = at91_usart_spi_dt_ids,
 	},
 	.probe = at91_usart_spi_probe,
 	.remove = at91_usart_spi_remove,