Skip to contentSkip to conversation

iio: adc: max14001: add missing MODULE_DEVICE_TABLE macro

PATCH In review Joshua Crofts 3 participants 5 messages Sep 9 – Sep 13

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 iio: adc: max14001: add missing MODULE_DEVICE_TABLE macro

The MAX14001 has an SPI ID table, but does not export it with the MODULE_DEVICE_TABLE(spi, ...) macro. Because of this, SPI-based module autoloading fails on systems that don't use devicetree (e.g. via spi_board_info).

Add the missing macro to export the alias information.

Fixes 59795109fa67 ("iio: adc: max14001: New driver")
---
 drivers/iio/adc/max14001.c | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/adc/max14001.c +1 -0
index 58adeac62dde..7694fbb6a9fd 100644
@@ -366,6 +366,7 @@ static const struct spi_device_id max14001_id_table[] = {
 	{ .name = "max14002", .driver_data = (kernel_ulong_t)&max14002_chip_info },
 	{ }
 };
+MODULE_DEVICE_TABLE(spi, max14001_id_table);
 
 static const struct of_device_id max14001_of_match[] = {
 	{ .compatible = "adi,max14001", .data = &max14001_chip_info },
Signature · 1 line
2.47.3
#1 lore raw
Quoted 11 lines · Joshua Crofts

The MAX14001 has an SPI ID table, but does not export it with the MODULE_DEVICE_TABLE(spi, ...) macro. Because of this, SPI-based module autoloading fails on systems that don't use devicetree (e.g. via spi_board_info).

Add the missing macro to export the alias information.

Fixes 59795109fa67 ("iio: adc: max14001: New driver")

---

Changelog?

Quoted 2 lines
 drivers/iio/adc/max14001.c | 1 +
 1 file changed, 1 insertion(+)

Code wise LGTM.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#2 lore raw
Quoted 6 lines · On Wed, 9 Sep 2026 16:38:50 +0300 Andy Shevchenko…
Quoted 5 lines · Joshua Crofts

The MAX14001 has an SPI ID table, but does not export it with the MODULE_DEVICE_TABLE(spi, ...) macro. Because of this, SPI-based module autoloading fails on systems that don't use devicetree (e.g. via spi_board_info).

Quoted 8 lines
Quoted 6 lines

Add the missing macro to export the alias information.

Fixes 59795109fa67 ("iio: adc: max14001: New driver")

---

Changelog?

God, I should start using AI to check my patches before sending. Appending below.

Changes in v2:
- edit commit message (expand on module autoloading and SPI)

Signature · 2 lines
Kind regards,
Joshua Crofts
Reviewed-by
#3 lore raw
Quoted 16 lines · Joshua Crofts
Quoted 13 lines · On Wed, 9 Sep 2026 16:38:50 +0300 Andy Shevchenko…
Quoted 11 lines · Joshua Crofts

The MAX14001 has an SPI ID table, but does not export it with the MODULE_DEVICE_TABLE(spi, ...) macro. Because of this, SPI-based module autoloading fails on systems that don't use devicetree (e.g. via spi_board_info).

Add the missing macro to export the alias information.

Fixes 59795109fa67 ("iio: adc: max14001: New driver")

---

Quoted 7 lines
Quoted 1 line

Changelog?

God, I should start using AI to check my patches before sending. Appending below.

Changes in v2:
- edit commit message (expand on module autoloading and SPI)

Thanks.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
maintainer
#4 lore raw
Quoted 19 lines · On Wed, 9 Sep 2026 17:05:50 +0300 Andy Shevchenko…
Quoted 18 lines · Joshua Crofts
Quoted 14 lines · On Wed, 9 Sep 2026 16:38:50 +0300 Andy Shevchenko…
Quoted 11 lines · Joshua Crofts

The MAX14001 has an SPI ID table, but does not export it with the MODULE_DEVICE_TABLE(spi, ...) macro. Because of this, SPI-based module autoloading fails on systems that don't use devicetree (e.g. via spi_board_info).

Add the missing macro to export the alias information.

Fixes 59795109fa67 ("iio: adc: max14001: New driver")

---

Changelog?

Quoted 9 lines
Quoted 5 lines

God, I should start using AI to check my patches before sending. Appending below.

Changes in v2:
- edit commit message (expand on module autoloading and SPI)

Thanks.

Applied to the testing branch of iio.git. Not rushing this in as for dt at least the other MODULE_DEVICE Table probably does the job (or the driver name fallback).

So nice to have rather than urgent

thanks,

Jonathan