diff options
author | 2024-04-09 17:45:52 +0300 | |
---|---|---|
committer | 2024-04-09 17:04:52 +0200 | |
commit | 8250b1c1fdf617e953511289b46c8a77d4d4457c (patch) | |
tree | 9487e8040cf093cca35f4c8933a1dd49804dd057 /drivers/tty | |
parent | serial: max3100: Switch to use dev_err_probe() (diff) | |
download | linux-8250b1c1fdf617e953511289b46c8a77d4d4457c.tar.gz linux-8250b1c1fdf617e953511289b46c8a77d4d4457c.tar.bz2 linux-8250b1c1fdf617e953511289b46c8a77d4d4457c.zip |
serial: max3100: Replace MODULE_ALIAS() with respective ID tables
MODULE_ALIAS() in most cases is a pure hack to avoid placing ID tables.
Replace it with the respective ID tables.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20240409144721.638326-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/max3100.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c index 09ec2ca06989..3004a95e573f 100644 --- a/drivers/tty/serial/max3100.c +++ b/drivers/tty/serial/max3100.c @@ -19,6 +19,7 @@ #include <linux/delay.h> #include <linux/slab.h> #include <linux/device.h> +#include <linux/mod_devicetable.h> #include <linux/module.h> #include <linux/property.h> #include <linux/serial_core.h> @@ -840,13 +841,27 @@ static SIMPLE_DEV_PM_OPS(max3100_pm_ops, max3100_suspend, max3100_resume); #define MAX3100_PM_OPS NULL #endif +static const struct spi_device_id max3100_spi_id[] = { + { "max3100" }, + { } +}; +MODULE_DEVICE_TABLE(spi, max3100_spi_id); + +static const struct of_device_id max3100_of_match[] = { + { .compatible = "maxim,max3100" }, + { } +}; +MODULE_DEVICE_TABLE(of, max3100_of_match); + static struct spi_driver max3100_driver = { .driver = { .name = "max3100", + .of_match_table = max3100_of_match, .pm = MAX3100_PM_OPS, }, .probe = max3100_probe, .remove = max3100_remove, + .id_table = max3100_spi_id, }; module_spi_driver(max3100_driver); @@ -854,4 +869,3 @@ module_spi_driver(max3100_driver); MODULE_DESCRIPTION("MAX3100 driver"); MODULE_AUTHOR("Christian Pellegrin <chripell@evolware.org>"); MODULE_LICENSE("GPL"); -MODULE_ALIAS("spi:max3100"); |