]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
spi: spidev: Add SPI ID table
authorMark Brown <broonie@kernel.org>
Thu, 23 Sep 2021 17:00:23 +0000 (18:00 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Oct 2021 09:57:56 +0000 (11:57 +0200)
commit 6840615f85f6046039ebc4989870ddb12892b7fc upstream.

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>
Link: https://lore.kernel.org/r/20210923170023.1683-1-broonie@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/spi/spidev.c

index 24e9469ea35bbc6375eea15e8782f4a0818fd20c..515466c60f77fcfe52ca7c1ad4a1e695a4f68223 100644 (file)
@@ -673,6 +673,19 @@ static const struct file_operations spidev_fops = {
 
 static struct class *spidev_class;
 
+static const struct spi_device_id spidev_spi_ids[] = {
+       { .name = "dh2228fv" },
+       { .name = "ltc2488" },
+       { .name = "sx1301" },
+       { .name = "bk4" },
+       { .name = "dhcom-board" },
+       { .name = "m53cpld" },
+       { .name = "spi-petra" },
+       { .name = "spi-authenta" },
+       {},
+};
+MODULE_DEVICE_TABLE(spi, spidev_spi_ids);
+
 #ifdef CONFIG_OF
 static const struct of_device_id spidev_dt_ids[] = {
        { .compatible = "rohm,dh2228fv" },
@@ -819,6 +832,7 @@ static struct spi_driver spidev_spi_driver = {
        },
        .probe =        spidev_probe,
        .remove =       spidev_remove,
+       .id_table =     spidev_spi_ids,
 
        /* NOTE:  suspend/resume methods are not necessary here.
         * We don't do anything except pass the requests to/from