diff mbox series

[v2,1/3] mtd: dataflash: Add SPI ID table

Message ID 20220202143404.16070-2-broonie@kernel.org
State Superseded
Headers show
Series mtd: Ensure DT compatibles have SPI device IDs | expand

Commit Message

Mark Brown Feb. 2, 2022, 2:34 p.m. UTC
Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding an id_table listing the
SPI IDs for everything.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/mtd/devices/mtd_dataflash.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Michael Walle Feb. 3, 2022, 8:50 a.m. UTC | #1
> Currently autoloading for SPI devices does not use the DT ID table, it uses
> SPI modalises. Supporting OF modalises is going to be difficult if not
> impractical, an attempt was made but has been reverted, so ensure that
> module autoloading works for this driver by adding an id_table listing the
> SPI IDs for everything.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  drivers/mtd/devices/mtd_dataflash.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
> index 734878abaa23..3ae18cbf5cd1 100644
> --- a/drivers/mtd/devices/mtd_dataflash.c
> +++ b/drivers/mtd/devices/mtd_dataflash.c
> @@ -112,6 +112,13 @@ static const struct of_device_id dataflash_dt_ids[] = {
>  MODULE_DEVICE_TABLE(of, dataflash_dt_ids);
>  #endif
>  
> +static const struct spi_device_id dataflash_spi_ids[] = {
> +	{ .name = "at45", },
> +	{ .name = "dataflash", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(spi, dataflash_spi_ids);
> +
>  /* ......................................................................... */
>  
>  /*
> @@ -938,6 +945,7 @@ static struct spi_driver dataflash_driver = {
>  
>  	.probe		= dataflash_probe,
>  	.remove		= dataflash_remove,
> +	.id_table	= dataflash_spi_ids,
>  
>  	/* FIXME:  investigate suspend and resume... */
>  };
> -- 
> 2.30.2

Looks like a duplicate of 27a030e872925.

-michael
diff mbox series

Patch

diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 734878abaa23..3ae18cbf5cd1 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -112,6 +112,13 @@  static const struct of_device_id dataflash_dt_ids[] = {
 MODULE_DEVICE_TABLE(of, dataflash_dt_ids);
 #endif
 
+static const struct spi_device_id dataflash_spi_ids[] = {
+	{ .name = "at45", },
+	{ .name = "dataflash", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(spi, dataflash_spi_ids);
+
 /* ......................................................................... */
 
 /*
@@ -938,6 +945,7 @@  static struct spi_driver dataflash_driver = {
 
 	.probe		= dataflash_probe,
 	.remove		= dataflash_remove,
+	.id_table	= dataflash_spi_ids,
 
 	/* FIXME:  investigate suspend and resume... */
 };