gpio: 74x164: Add SPI device ID table
authorMark Brown <broonie@kernel.org>
Wed, 22 Sep 2021 16:17:36 +0000 (17:17 +0100)
committerBartosz Golaszewski <brgl@bgdev.pl>
Wed, 6 Oct 2021 11:01:45 +0000 (13:01 +0200)
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 a SPI device ID table.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
drivers/gpio/gpio-74x164.c

index 05637d58515269b75c5a279291744ca2b6ad2481..4a55cdf089d62a33a793b4eb402ff08a19df720f 100644 (file)
@@ -174,6 +174,13 @@ static int gen_74x164_remove(struct spi_device *spi)
        return 0;
 }
 
+static const struct spi_device_id gen_74x164_spi_ids[] = {
+       { .name = "74hc595" },
+       { .name = "74lvc594" },
+       {},
+};
+MODULE_DEVICE_TABLE(spi, gen_74x164_spi_ids);
+
 static const struct of_device_id gen_74x164_dt_ids[] = {
        { .compatible = "fairchild,74hc595" },
        { .compatible = "nxp,74lvc594" },
@@ -188,6 +195,7 @@ static struct spi_driver gen_74x164_driver = {
        },
        .probe          = gen_74x164_probe,
        .remove         = gen_74x164_remove,
+       .id_table       = gen_74x164_spi_ids,
 };
 module_spi_driver(gen_74x164_driver);