Commit 558c5eb5 authored by Javier Martinez Canillas's avatar Javier Martinez Canillas Committed by David S. Miller

net: wan: slic_ds26522: add SPI device ID table to fix module autoload

If the driver is built as a module, module alias information isn't filled
so the module won't be autoloaded. Add a SPI device ID table and use the
MODULE_DEVICE_TABLE() macro so the information is exported in the module.

Before this patch:

$ modinfo drivers/net/wan/slic_ds26522.ko | grep alias
$

After this patch:

$ modinfo drivers/net/wan/slic_ds26522.ko | grep alias
alias:          spi:ds26522
Signed-off-by: default avatarJavier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a220445f
...@@ -223,6 +223,12 @@ static int slic_ds26522_probe(struct spi_device *spi) ...@@ -223,6 +223,12 @@ static int slic_ds26522_probe(struct spi_device *spi)
return ret; return ret;
} }
static const struct spi_device_id slic_ds26522_id[] = {
{ .name = "ds26522" },
{ /* sentinel */ },
};
MODULE_DEVICE_TABLE(spi, slic_ds26522_id);
static const struct of_device_id slic_ds26522_match[] = { static const struct of_device_id slic_ds26522_match[] = {
{ {
.compatible = "maxim,ds26522", .compatible = "maxim,ds26522",
...@@ -239,6 +245,7 @@ static struct spi_driver slic_ds26522_driver = { ...@@ -239,6 +245,7 @@ static struct spi_driver slic_ds26522_driver = {
}, },
.probe = slic_ds26522_probe, .probe = slic_ds26522_probe,
.remove = slic_ds26522_remove, .remove = slic_ds26522_remove,
.id_table = slic_ds26522_id,
}; };
static int __init slic_ds26522_init(void) static int __init slic_ds26522_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment