diff mbox series

[v2] gpio: 74x164: Add SPI device ID table

Message ID 20210922161736.9064-1-broonie@kernel.org
State Accepted
Commit be4491838359e78e42e88db4ac479e21c5eda1e0
Headers show
Series [v2] gpio: 74x164: Add SPI device ID table | expand

Commit Message

Mark Brown Sept. 22, 2021, 4:17 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 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>
---

v2: Fix typos in the device names, sorry.

 drivers/gpio/gpio-74x164.c | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.20.1

Comments

Bartosz Golaszewski Oct. 1, 2021, 9:51 a.m. UTC | #1
On Wed, Sep 22, 2021 at 6:18 PM Mark Brown <broonie@kernel.org> wrote:
>

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

> ---

>

> v2: Fix typos in the device names, sorry.

>

>  drivers/gpio/gpio-74x164.c | 8 ++++++++

>  1 file changed, 8 insertions(+)

>

> diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c

> index 05637d585152..4a55cdf089d6 100644

> --- a/drivers/gpio/gpio-74x164.c

> +++ b/drivers/gpio/gpio-74x164.c

> @@ -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);

>

> --

> 2.20.1

>


Applied, thanks!

Bartosz
diff mbox series

Patch

diff --git a/drivers/gpio/gpio-74x164.c b/drivers/gpio/gpio-74x164.c
index 05637d585152..4a55cdf089d6 100644
--- a/drivers/gpio/gpio-74x164.c
+++ b/drivers/gpio/gpio-74x164.c
@@ -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);