Skip to content

Commit 7c7b1be

Browse files
tq-steinadtor
authored andcommitted
Input: ads7846 - use spi_device_id table
As the driver supports more devices over time the single MODULE_ALIAS is complete and raises several warnings: SPI driver ads7846 has no spi_device_id for ti,tsc2046 SPI driver ads7846 has no spi_device_id for ti,ads7843 SPI driver ads7846 has no spi_device_id for ti,ads7845 SPI driver ads7846 has no spi_device_id for ti,ads7873 Fix this by adding a spi_device_id table and removing the manual MODULE_ALIAS. Signed-off-by: Alexander Stein <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent cee7714 commit 7c7b1be

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/input/touchscreen/ads7846.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,16 @@ static const struct of_device_id ads7846_dt_ids[] = {
11111111
};
11121112
MODULE_DEVICE_TABLE(of, ads7846_dt_ids);
11131113

1114+
static const struct spi_device_id ads7846_spi_ids[] = {
1115+
{ "tsc2046", 7846 },
1116+
{ "ads7843", 7843 },
1117+
{ "ads7845", 7845 },
1118+
{ "ads7846", 7846 },
1119+
{ "ads7873", 7873 },
1120+
{ },
1121+
};
1122+
MODULE_DEVICE_TABLE(spi, ads7846_spi_ids);
1123+
11141124
static const struct ads7846_platform_data *ads7846_get_props(struct device *dev)
11151125
{
11161126
struct ads7846_platform_data *pdata;
@@ -1386,10 +1396,10 @@ static struct spi_driver ads7846_driver = {
13861396
},
13871397
.probe = ads7846_probe,
13881398
.remove = ads7846_remove,
1399+
.id_table = ads7846_spi_ids,
13891400
};
13901401

13911402
module_spi_driver(ads7846_driver);
13921403

13931404
MODULE_DESCRIPTION("ADS7846 TouchScreen Driver");
13941405
MODULE_LICENSE("GPL");
1395-
MODULE_ALIAS("spi:ads7846");

0 commit comments

Comments
 (0)