Skip to contentSkip to conversation

misc: gehc: Add SPI ID table

PATCH In review Mark Brown 2 participants 2 messages Sep 23, 2021 – Sep 28, 2021 Char and misc drivers

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 misc: gehc: Add SPI ID table

Currently autoloading for SPI devices does not use the DT ID table, it uses SPI modalises. Supporting OF modalises is going to be difficult if not impractical, an attempt was made but has been reverted, so ensure that module autoloading works for this driver by adding a SPI ID table entry for the device name part of the compatible - currently only the full compatible is listed which isn't very idiomatic and won't match the modalias that is generated.

Fixes 96c8395e2166 ("spi: Revert modalias changes")
---
 drivers/misc/gehc-achc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/gehc-achc.c +1 -0
index 02f33bc60c56..4c9c5394da6f 100644
@@ -539,6 +539,7 @@ static int gehc_achc_probe(struct spi_device *spi)
 
 static const struct spi_device_id gehc_achc_id[] = {
 	{ "ge,achc", 0 },
+	{ "achc", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(spi, gehc_achc_id);
Signature · 1 line
2.20.1
Tested-by on v1 1/1
#1 lore raw
Quoted 12 lines · Mark Brown

Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding a SPI ID table entry
for the device name part of the compatible - currently only the full compatible is listed which isn't very idiomatic and won't match the modalias that is generated.

Quoted 2 lines
Fixes 96c8395e2166 ("spi: Revert modalias changes")
Quoted 17 lines

---
 drivers/misc/gehc-achc.c | 1 +

 1 file changed, 1 insertion(+)
drivers/misc/gehc-achc.c +0 -0
index 02f33bc60c56..4c9c5394da6f 100644
@@ -539,6 +539,7 @@ static int gehc_achc_probe(struct spi_device
 *spi)


 static const struct spi_device_id gehc_achc_id[] = { { "ge,achc", 0 },
+       { "achc", 0 },
        { }
 };
 MODULE_DEVICE_TABLE(spi, gehc_achc_id);