The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] rtc: add prefix modalias for rtc modules
@ 2024-10-15  2:43 huanglei814
  2024-10-15  7:52 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: huanglei814 @ 2024-10-15  2:43 UTC (permalink / raw)
  To: alexandre.belloni; +Cc: linux-rtc, linux-kernel, huanglei

From: huanglei <huanglei@kylinos.cn>

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 <huanglei@kylinos.cn>
---
 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(+)

diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c
index ecc7d0307932..cc82f8e6326b 100644
--- a/drivers/rtc/rtc-ds1302.c
+++ b/drivers/rtc/rtc-ds1302.c
@@ -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");
diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 872e0b679be4..c402ab5cf383 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -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");
diff --git a/drivers/rtc/rtc-ds1343.c b/drivers/rtc/rtc-ds1343.c
index ed5a6ba89a3e..e9183f745922 100644
--- a/drivers/rtc/rtc-ds1343.c
+++ b/drivers/rtc/rtc-ds1343.c
@@ -481,3 +481,4 @@ MODULE_DESCRIPTION("DS1343 RTC SPI Driver");
 MODULE_AUTHOR("Raghavendra Chandra Ganiga <ravi23ganiga@gmail.com>,"
 		"Ankur Srivastava <sankurece@gmail.com>");
 MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("spi:ds1343");
diff --git a/drivers/rtc/rtc-ds1347.c b/drivers/rtc/rtc-ds1347.c
index a40c1a52df65..babdd35cd82d 100644
--- a/drivers/rtc/rtc-ds1347.c
+++ b/drivers/rtc/rtc-ds1347.c
@@ -181,3 +181,4 @@ module_spi_driver(ds1347_driver);
 MODULE_DESCRIPTION("DS1347 SPI RTC DRIVER");
 MODULE_AUTHOR("Raghavendra C Ganiga <ravi23ganiga@gmail.com>");
 MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("spi:ds1347");
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c
index c2359eb86bc9..3d61ab23c41c 100644
--- a/drivers/rtc/rtc-ds1374.c
+++ b/drivers/rtc/rtc-ds1374.c
@@ -582,3 +582,4 @@ module_i2c_driver(ds1374_driver);
 MODULE_AUTHOR("Scott Wood <scottwood@freescale.com>");
 MODULE_DESCRIPTION("Maxim/Dallas DS1374 RTC Driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("i2c:rtc-ds1374");
diff --git a/drivers/rtc/rtc-ds1672.c b/drivers/rtc/rtc-ds1672.c
index 6e5314215d00..a2240cd92774 100644
--- a/drivers/rtc/rtc-ds1672.c
+++ b/drivers/rtc/rtc-ds1672.c
@@ -158,3 +158,4 @@ module_i2c_driver(ds1672_driver);
 MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
 MODULE_DESCRIPTION("Dallas/Maxim DS1672 timekeeper driver");
 MODULE_LICENSE("GPL");
+MODULE_ALIAS("i2c:rtc-ds1672");
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: add prefix modalias for rtc modules
  2024-10-15  2:43 [PATCH] rtc: add prefix modalias for rtc modules huanglei814
@ 2024-10-15  7:52 ` Krzysztof Kozlowski
       [not found]   ` <49a7b611-f6d4-3002-c3f7-e3da221efc7b@163.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-15  7:52 UTC (permalink / raw)
  To: huanglei814, alexandre.belloni; +Cc: linux-rtc, linux-kernel, huanglei

On 15/10/2024 04:43, huanglei814 wrote:
> From: huanglei <huanglei@kylinos.cn>
> 
> 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 <huanglei@kylinos.cn>
> ---
>  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(+)
> 
> diff --git a/drivers/rtc/rtc-ds1302.c b/drivers/rtc/rtc-ds1302.c
> index ecc7d0307932..cc82f8e6326b 100644
> --- a/drivers/rtc/rtc-ds1302.c
> +++ b/drivers/rtc/rtc-ds1302.c
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] rtc: add prefix modalias for rtc modules
       [not found]   ` <49a7b611-f6d4-3002-c3f7-e3da221efc7b@163.com>
@ 2024-10-16  6:14     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2024-10-16  6:14 UTC (permalink / raw)
  To: huanglei, alexandre.belloni; +Cc: linux-rtc, linux-kernel, huanglei

On 16/10/2024 08:07, huanglei wrote:
> Thank you for your reply.
> 
> However, Most other drivers have already set MODULE_ALIAS,  such as 
> rtc-efi.c have set MODULE_ALIAS("platform:rtc-efi");

That driver might need, but this not. It's not an argument in favor.

> 
> So I think this is necessary. If loaded automatically is required, 
> sometimes it is necessary to match through this alias.
> 
> MODULE_ALIAS adds some more info for the userspace programs. In 
> /lib/modules/VERSION/modules.alias you can see the aliases that were 
> parsed from the modules.

Don't explain what mod alias is. We know.

> 
> In this case running  'modprobe spi:rtc-ds1302' would insert the ds1302 
> module.

Which is wrong. There is proper alias already.

> 
> 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-ds1305 rtc_ds1305
> alias spi:rtc-ds1390 rtc_ds1390
> alias platform:ds1511 rtc_ds1511
> alias platform:rtc-ds1553 rtc_ds1553
> alias platform:rtc-ds1685 rtc_ds1685
> alias platform:rtc-ds1742 rtc_ds1742
> alias platform:ds2404 rtc_ds2404
> alias platform:rtc-efi rtc_efi
> 
> And 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-ds1302 rtc_ds1302
> alias spi:rtc-ds1305 rtc_ds1305
> alias spi:ds1347 rtc_ds1347
> alias spi:rtc-ds1390 rtc_ds1390
> alias platform:ds1511 rtc_ds1511
> alias platform:rtc-ds1553 rtc_ds1553
> alias platform:rtc-ds1685 rtc_ds1685
> alias platform:rtc-ds1742 rtc_ds1742
> alias platform:ds2404 rtc_ds2404
> alias platform:rtc-efi rtc_efi
> 
> 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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-16  6:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-15  2:43 [PATCH] rtc: add prefix modalias for rtc modules huanglei814
2024-10-15  7:52 ` Krzysztof Kozlowski
     [not found]   ` <49a7b611-f6d4-3002-c3f7-e3da221efc7b@163.com>
2024-10-16  6:14     ` Krzysztof Kozlowski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox