提交 ac1fd0da 编写于 作者: U Uwe Kleine-König 提交者: Zheng Zengkai

spi: spi-mux: Add module info needed for autoloading

stable inclusion
from stable-5.10.61
commit f1c0533fae5956d49f232255799b725c4b810abd
bugzilla: 177029 https://gitee.com/openeuler/kernel/issues/I4EAXD

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=f1c0533fae5956d49f232255799b725c4b810abd

--------------------------------

[ Upstream commit 1d5ccab9 ]

With the spi device table udev can autoload the spi-mux module in
the presence of an spi-mux device.
Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20210721095321.2165453-1-u.kleine-koenig@pengutronix.deSigned-off-by: NMark Brown <broonie@kernel.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 e74a73b8
...@@ -167,10 +167,17 @@ static int spi_mux_probe(struct spi_device *spi) ...@@ -167,10 +167,17 @@ static int spi_mux_probe(struct spi_device *spi)
return ret; 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[] = { static const struct of_device_id spi_mux_of_match[] = {
{ .compatible = "spi-mux" }, { .compatible = "spi-mux" },
{ } { }
}; };
MODULE_DEVICE_TABLE(of, spi_mux_of_match);
static struct spi_driver spi_mux_driver = { static struct spi_driver spi_mux_driver = {
.probe = spi_mux_probe, .probe = spi_mux_probe,
...@@ -178,6 +185,7 @@ static struct spi_driver spi_mux_driver = { ...@@ -178,6 +185,7 @@ static struct spi_driver spi_mux_driver = {
.name = "spi-mux", .name = "spi-mux",
.of_match_table = spi_mux_of_match, .of_match_table = spi_mux_of_match,
}, },
.id_table = spi_mux_id,
}; };
module_spi_driver(spi_mux_driver); module_spi_driver(spi_mux_driver);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册