Skip to content

Commit

Permalink
spi: spi-mux: Add module info needed for autoloading
Browse files Browse the repository at this point in the history
[ Upstream commit 1d5ccab ]

With the spi device table udev can autoload the spi-mux module in
the presence of an spi-mux device.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210721095321.2165453-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ukleinek authored and Sasha Levin committed Aug 26, 2021
1 parent b618a32 commit f1c0533
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/spi/spi-mux.c
Expand Up @@ -167,17 +167,25 @@ static int spi_mux_probe(struct spi_device *spi)
return ret;
}

static const struct spi_device_id spi_mux_id[] = {
{ "spi-mux" },
{ }
};
MODULE_DEVICE_TABLE(spi, spi_mux_id);

static const struct of_device_id spi_mux_of_match[] = {
{ .compatible = "spi-mux" },
{ }
};
MODULE_DEVICE_TABLE(of, spi_mux_of_match);

static struct spi_driver spi_mux_driver = {
.probe = spi_mux_probe,
.driver = {
.name = "spi-mux",
.of_match_table = spi_mux_of_match,
},
.id_table = spi_mux_id,
};

module_spi_driver(spi_mux_driver);
Expand Down

0 comments on commit f1c0533

Please sign in to comment.