rtc: add prefix modalias for rtc modules
PATCH 1/1 rtc: add prefix modalias for rtc modules
From: huanglei <[email protected]>
When these rtc drivers is built as a module, To wire it up to udev, and let the module be loaded automatically, we need to export these alias from the modules.
--- drivers/rtc/rtc-ds1302.c | 1 + drivers/rtc/rtc-ds1307.c | 1 + drivers/rtc/rtc-ds1343.c | 1 + drivers/rtc/rtc-ds1347.c | 1 + drivers/rtc/rtc-ds1374.c | 1 + drivers/rtc/rtc-ds1672.c | 1 + 6 files changed, 6 insertions(+)
drivers/rtc/rtc-ds1302.c +1 -0
@@ -211,3 +211,4 @@ module_spi_driver(ds1302_driver);MODULE_DESCRIPTION ("Dallas DS1302 RTC driver" );MODULE_AUTHOR ("Paul Mundt, David McCullough" );MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("spi:rtc-ds1302" );
drivers/rtc/rtc-ds1307.c +1 -0
@@ -2024,3 +2024,4 @@ module_i2c_driver(ds1307_driver);MODULE_DESCRIPTION ("RTC driver for DS1307 and similar chips" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("i2c:rtc-ds1307" );
drivers/rtc/rtc-ds1343.c +1 -0
@@ -481,3 +481,4 @@ MODULE_DESCRIPTION("DS1343 RTC SPI Driver");MODULE_AUTHOR ("Raghavendra Chandra Ganiga <[email protected]>," "Ankur Srivastava <[email protected]>" );MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("spi:ds1343" );
drivers/rtc/rtc-ds1347.c +1 -0
@@ -181,3 +181,4 @@ module_spi_driver(ds1347_driver);MODULE_DESCRIPTION ("DS1347 SPI RTC DRIVER" );MODULE_AUTHOR ("Raghavendra C Ganiga <[email protected]>" );MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("spi:ds1347" );
drivers/rtc/rtc-ds1374.c +1 -0
@@ -582,3 +582,4 @@ module_i2c_driver(ds1374_driver);MODULE_AUTHOR ("Scott Wood <[email protected]>" );MODULE_DESCRIPTION ("Maxim/Dallas DS1374 RTC Driver" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("i2c:rtc-ds1374" );
drivers/rtc/rtc-ds1672.c +1 -0
@@ -158,3 +158,4 @@ module_i2c_driver(ds1672_driver);MODULE_AUTHOR ("Alessandro Zummo <[email protected]>" );MODULE_DESCRIPTION ("Dallas/Maxim DS1672 timekeeper driver" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("i2c:rtc-ds1672" );
Signature · 1 line
2.17.1
Quoted 21 lines · On 15/10/2024 04:43, huanglei814 wrote:
From: huanglei <[email protected]>
When these rtc drivers is built as a module, To wire it up to udev, and let the module be loaded automatically, we need to export these alias from the modules.
Signed-off-by huanglei <[email protected]>--- drivers/rtc/rtc-ds1302.c | 1 + drivers/rtc/rtc-ds1307.c | 1 + drivers/rtc/rtc-ds1343.c | 1 + drivers/rtc/rtc-ds1347.c | 1 + drivers/rtc/rtc-ds1374.c | 1 + drivers/rtc/rtc-ds1672.c | 1 + 6 files changed, 6 insertions(+)drivers/rtc/rtc-ds1302.c +0
-0
drivers/rtc/rtc-ds1302.c module_spi_driver(ds1302_driver); · line 214
Quoted 4 lines
drivers/rtc/rtc-ds1302.c +1
-0@@ -211,3 +211,4 @@ module_spi_driver(ds1302_driver);MODULE_DESCRIPTION ("Dallas DS1302 RTC driver" );MODULE_AUTHOR ("Paul Mundt, David McCullough" );MODULE_LICENSE ("GPL v2" ); +MODULE_ALIAS ("spi:rtc-ds1302" );
NAK. That's neither correct, nor necessary. Driver has proper tables and is loaded automatically in correct setup. I assume your setup is just incorrect, but without description tricky to say how.
Best regards,
Krzysztof
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 4 lines · huanglei
Thank you for your reply.
However, Most other drivers have already set MODULE_ALIAS, such as
rtc-efi.chave setMODULE_ALIAS("platform:rtc-efi");
That driver might need, but this not. It's not an argument in favor.
Quoted 7 lines
So I think this is necessary. If loaded automatically is required, sometimes it is necessary to match through this alias.
MODULE_ALIASadds some more info for the userspace programs. In/lib/modules/VERSION/modules.aliasyou can see the aliases that were parsed from the modules.
Don't explain what mod alias is. We know.
Quoted 3 lines
In this case running 'modprobe spi:rtc-ds1302' would insert the ds1302 module.
Which is wrong. There is proper alias already.
Quoted 32 lines
Now , you can see the difference between applying this patch and not applying it.
This is not applying this patch, part of the modules.alias related to rtc_ds1302/ds1347 rtc:
alias platform:rtc-ds1286
rtc_ds1286
alias spi:rtc-ds1305rtc_ds1305
alias spi:rtc-ds1390rtc_ds1390
alias platform:ds1511rtc_ds1511
alias platform:rtc-ds1553rtc_ds1553
alias platform:rtc-ds1685rtc_ds1685
alias platform:rtc-ds1742rtc_ds1742
alias platform:ds2404rtc_ds2404
alias platform:rtc-efirtc_efiAnd this is applying this patch, part of the modules.alias related to rtc_ds1302/ds1347 rtc:
alias platform:rtc-ds1286
rtc_ds1286
alias spi:rtc-ds1302rtc_ds1302
alias spi:rtc-ds1305rtc_ds1305
alias spi:ds1347rtc_ds1347
alias spi:rtc-ds1390rtc_ds1390
alias platform:ds1511rtc_ds1511
alias platform:rtc-ds1553rtc_ds1553
alias platform:rtc-ds1685rtc_ds1685
alias platform:rtc-ds1742rtc_ds1742
alias platform:ds2404rtc_ds2404
alias platform:rtc-efirtc_efi
Quoted 4 lines
So, if not applying this patch, use modprobe rtc-ds1302/ds1347 may be not to load automatically.
Therefore, it is strongly recommended applying this patch.
NAK. You do not understand aliases and you do not understand what is already in the driver.
Also, don't top post next time.
Best regards,
Krzysztof