Skip to contentSkip to conversation

i2c: hix5hd2: Fix modalias to make module auto-loading work

PATCH Applied Axel Lin 3 participants 5 messages May 8, 2015 – May 12, 2015 2 messages not in the archive I2C subsystem host drivers

lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 i2c: hix5hd2: Fix modalias to make module auto-loading work

Make the modalias match driver name, this is required to make module auto-loading work.

---
 drivers/i2c/busses/i2c-hix5hd2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-hix5hd2.c +1 -1
index 8fe78d0..7c696643 100644
@@ -554,4 +554,4 @@ module_platform_driver(hix5hd2_i2c_driver);
 MODULE_DESCRIPTION("Hix5hd2 I2C Bus driver");
 MODULE_AUTHOR("Wei Yan <[email protected]>");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:i2c-hix5hd2");
+MODULE_ALIAS("platform:hix5hd2-i2c");
Signature · 1 line
2.1.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 4 lines · Axel Lin

Make the modalias match driver name, this is required to make module auto-loading work.

Thanks Axel

Could you also share the info what's the condition of auto-loading module.

What I am test here is change the names works.

-               .name   = "hix5hd2-i2c",
+               .name   = "i2c-hix5hd2",

Change MODULE_ALIAS("platform:hix5hd2-i2c") does not works here. Do I make some mistake?

Quoted 15 lines
---
  drivers/i2c/busses/i2c-hix5hd2.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-hix5hd2.c +1 -1
index 8fe78d0..7c696643 100644
@@ -554,4 +554,4 @@ module_platform_driver(hix5hd2_i2c_driver);
  MODULE_DESCRIPTION("Hix5hd2 I2C Bus driver");
  MODULE_AUTHOR("Wei Yan <[email protected]>");
  MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:i2c-hix5hd2");
+MODULE_ALIAS("platform:hix5hd2-i2c");

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#4 lore raw

2015-05-08 22:56 GMT+08:00 zhangfei <[email protected]>:

Quoted 18 lines · Axel Lin
Quoted 5 lines

Make the modalias match driver name, this is required to make module auto-loading work.

Thanks Axel

Could you also share the info what's the condition of auto-loading module.

What I am test here is change the names works.

(quoted diff) +1 -1
-               .name   = "hix5hd2-i2c",
+               .name   = "i2c-hix5hd2",
Quoted 2 lines

Change MODULE_ALIAS("platform:hix5hd2-i2c") does not works here. Do I make some mistake?

The driver name needs to match the platform device name. I have no idea why you change the driver name and it still work.

In drivers/base/platform.c, the platform_uevent sends uevenet with MODALIAS=platform:pdev->name. so the MODULE_ALIAS needs to match pdev->name. Maybe forgot running depmod -a?

Acked-by
#5 lore raw
In reply to a message not in the archive
Quoted 4 lines · Axel Lin

Make the modalias match driver name, this is required to make module auto-loading work.

Thanks for the patch,
Also checked MODULE_ALIAS notes in Documentation/i2c/writing-clients.

Quoted 19 lines
---
 drivers/i2c/busses/i2c-hix5hd2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/i2c/busses/i2c-hix5hd2.c +1 -2
index 8fe78d0..7c696643 100644
@@ -554,4 +554,4 @@ module_platform_driver(hix5hd2_i2c_driver);
 MODULE_DESCRIPTION("Hix5hd2 I2C Bus driver");
 MODULE_AUTHOR("Wei Yan <[email protected]>");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:i2c-hix5hd2");
+MODULE_ALIAS("platform:hix5hd2-i2c");
--

2.1.0