linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fpga: xilinx-spi: Add missing spi_device_id table
@ 2025-10-26 11:02 Fabio Estevam
  2025-11-03 14:57 ` Xu Yilun
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2025-10-26 11:02 UTC (permalink / raw)
  To: mdf; +Cc: yilun.xu, trix, linux-fpga, Fabio Estevam

The "xlnx,fpga-slave-serial" devicetree compatible string currently misses
its SPI device ID entry. Without an spi_device_id table, the driver still
works with device tree, but triggers the following runtime warning when
registered via SPI core:

SPI driver xlnx-slave-spi has no spi_device_id for xlnx,fpga-slave-serial

Fix it by adding a corresponding spi_device_id table entry.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 drivers/fpga/xilinx-spi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/fpga/xilinx-spi.c b/drivers/fpga/xilinx-spi.c
index 8756504340de..26348a768bbc 100644
--- a/drivers/fpga/xilinx-spi.c
+++ b/drivers/fpga/xilinx-spi.c
@@ -57,6 +57,12 @@ static int xilinx_spi_probe(struct spi_device *spi)
 	return xilinx_core_probe(core);
 }
 
+static const struct spi_device_id xilinx_spi_ids[] = {
+	{ "fpga-slave-serial" },
+	{ },
+};
+MODULE_DEVICE_TABLE(spi, xilinx_spi_ids);
+
 #ifdef CONFIG_OF
 static const struct of_device_id xlnx_spi_of_match[] = {
 	{
@@ -73,6 +79,7 @@ static struct spi_driver xilinx_slave_spi_driver = {
 		.of_match_table = of_match_ptr(xlnx_spi_of_match),
 	},
 	.probe = xilinx_spi_probe,
+	.id_table       = xilinx_spi_ids,
 };
 
 module_spi_driver(xilinx_slave_spi_driver)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fpga: xilinx-spi: Add missing spi_device_id table
  2025-10-26 11:02 [PATCH] fpga: xilinx-spi: Add missing spi_device_id table Fabio Estevam
@ 2025-11-03 14:57 ` Xu Yilun
  0 siblings, 0 replies; 2+ messages in thread
From: Xu Yilun @ 2025-11-03 14:57 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: mdf, yilun.xu, trix, linux-fpga

On Sun, Oct 26, 2025 at 08:02:37AM -0300, Fabio Estevam wrote:
> The "xlnx,fpga-slave-serial" devicetree compatible string currently misses
> its SPI device ID entry. Without an spi_device_id table, the driver still
> works with device tree, but triggers the following runtime warning when
> registered via SPI core:
> 
> SPI driver xlnx-slave-spi has no spi_device_id for xlnx,fpga-slave-serial
> 
> Fix it by adding a corresponding spi_device_id table entry.
> 
> Signed-off-by: Fabio Estevam <festevam@gmail.com>
> ---
>  drivers/fpga/xilinx-spi.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/fpga/xilinx-spi.c b/drivers/fpga/xilinx-spi.c
> index 8756504340de..26348a768bbc 100644
> --- a/drivers/fpga/xilinx-spi.c
> +++ b/drivers/fpga/xilinx-spi.c
> @@ -57,6 +57,12 @@ static int xilinx_spi_probe(struct spi_device *spi)
>  	return xilinx_core_probe(core);
>  }
>  
> +static const struct spi_device_id xilinx_spi_ids[] = {
> +	{ "fpga-slave-serial" },
> +	{ },
> +};
> +MODULE_DEVICE_TABLE(spi, xilinx_spi_ids);
> +
>  #ifdef CONFIG_OF
>  static const struct of_device_id xlnx_spi_of_match[] = {
>  	{
> @@ -73,6 +79,7 @@ static struct spi_driver xilinx_slave_spi_driver = {
>  		.of_match_table = of_match_ptr(xlnx_spi_of_match),
>  	},
>  	.probe = xilinx_spi_probe,
> +	.id_table       = xilinx_spi_ids,

One whitespace is enough, I fixed it in place.

Others look good to me.

Reviewed-by: Xu Yilun <yilun.xu@linux.intel.com>

Applied to for-next, thanks

>  };
>  
>  module_spi_driver(xilinx_slave_spi_driver)
> -- 
> 2.34.1
> 
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-11-03 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-26 11:02 [PATCH] fpga: xilinx-spi: Add missing spi_device_id table Fabio Estevam
2025-11-03 14:57 ` Xu Yilun

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).