Skip to contentSkip to conversation

serial: 8250_aspeed_vuart: Enable module autoloading

PATCH In review Liao Chen 4 participants 5 messages Sep 3, 2024 – Sep 12, 2024

Subsystems (2)
lore
Share & tools
lore

Liao Chen

author
#0 lore raw

PATCH 1/1 serial: 8250_aspeed_vuart: Enable module autoloading

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/tty/serial/8250/8250_aspeed_vuart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/8250/8250_aspeed_vuart.c +1 -0
index 53d8eee9b1c8..25c201cfb91e 100644
@@ -561,6 +561,7 @@ static const struct of_device_id aspeed_vuart_table[] = {
 	{ .compatible = "aspeed,ast2500-vuart" },
 	{ },
 };
+MODULE_DEVICE_TABLE(of, aspeed_vuart_table);
 
 static struct platform_driver aspeed_vuart_driver = {
 	.driver = {
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 13 lines · Liao Chen

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
 drivers/tty/serial/8250/8250_aspeed_vuart.c | 1 +
 1 file changed, 1 insertion(+)
drivers/tty/serial/8250/8250_aspeed_vuart.c +0 -0
index 53d8eee9b1c8..25c201cfb91e 100644

drivers/tty/serial/8250/8250_aspeed_vuart.c static const struct of_device_id aspeed_vuart_table[] = { · line 564

Quoted 4 lines
drivers/tty/serial/8250/8250_aspeed_vuart.c +1 -0
@@ -561,6 +561,7 @@ static const struct of_device_id aspeed_vuart_table[] = {
 	{ .compatible = "aspeed,ast2500-vuart" },
 	{ },
 };
+MODULE_DEVICE_TABLE(of, aspeed_vuart_table);

I wonder if you found this entry missing by code review, or if you have a machine with that UART and so you actually benefit.

Otherwise looks right to me.

Best regards
Uwe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/linux-aspeed/attachments/20240903/ce209493/attachment-0001.sig>

#2 lore raw
Quoted 1 line · Uwe Kleine-K?nig

On Tue, Sep 03, 2024 at 01:15:03PM +0000, Liao Chen wrote:

...

Quoted 2 lines

I wonder if you found this entry missing by code review, or if you have a machine with that UART and so you actually benefit.

Using arch/arm/boot/dts/aspeed/aspeed-bmc-ibm-rainier.dts in QEMU I never experienced an issue. Seems due to defconfig having it =y. (used arch/arm/configs/aspeed_g5_defconfig)

Quoted 3 lines

Otherwise looks right to me.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
In reply to Uwe Kleine-König
Quoted 11 lines · Uwe Kleine-K?nig

Hello,

Quoted 8 lines · Liao Chen

Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded based on the alias from of_device_id table.

---
  drivers/tty/serial/8250/8250_aspeed_vuart.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 12 lines

drivers/tty/serial/8250/8250_aspeed_vuart.c static const struct of_device_id aspeed_vuart_table[] = { · line 564

Quoted 9 lines
drivers/tty/serial/8250/8250_aspeed_vuart.c +1 -0
index 53d8eee9b1c8..25c201cfb91e 100644
@@ -561,6 +561,7 @@ static const struct of_device_id aspeed_vuart_table[] = {
  	{ .compatible = "aspeed,ast2500-vuart" },
  	{ },
  };
+MODULE_DEVICE_TABLE(of, aspeed_vuart_table);

I wonder if you found this entry missing by code review, or if you have a machine with that UART and so you actually benefit.

I found it from code review. Since this device could be compiled as a module, I think it is better to add this entry.

Thanks,
Chen

Quoted 7 lines

Otherwise looks right to me.

Best regards
Uwe