diff mbox series

clk: sifive: prci: fix module autoloading

Message ID 20240410155342.224061-1-krzk@kernel.org (mailing list archive)
State Awaiting Upstream, archived
Headers show
Series clk: sifive: prci: fix module autoloading | expand

Commit Message

Krzysztof Kozlowski April 10, 2024, 3:53 p.m. UTC
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
based on the alias from of_device_id table.  Clocks are considered core
components, so usually they are built-in, however these can be built and
used as modules on some generic kernel.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/clk/sifive/sifive-prci.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Samuel Holland April 10, 2024, 4:03 p.m. UTC | #1
On 2024-04-10 10:53 AM, Krzysztof Kozlowski wrote:
> Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
> based on the alias from of_device_id table.  Clocks are considered core
> components, so usually they are built-in, however these can be built and
> used as modules on some generic kernel.
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/clk/sifive/sifive-prci.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c
> index 25b8e1a80ddc..700a1be9ec47 100644
> --- a/drivers/clk/sifive/sifive-prci.c
> +++ b/drivers/clk/sifive/sifive-prci.c
> @@ -611,6 +611,7 @@ static const struct of_device_id sifive_prci_of_match[] = {
>  	{.compatible = "sifive,fu740-c000-prci", .data = &prci_clk_fu740},
>  	{}
>  };
> +MODULE_DEVICE_TABLE(of, sifive_prci_of_match);
>  
>  static struct platform_driver sifive_prci_driver = {
>  	.driver = {

Reviewed-by: Samuel Holland <samuel.holland@sifive.com>
diff mbox series

Patch

diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c
index 25b8e1a80ddc..700a1be9ec47 100644
--- a/drivers/clk/sifive/sifive-prci.c
+++ b/drivers/clk/sifive/sifive-prci.c
@@ -611,6 +611,7 @@  static const struct of_device_id sifive_prci_of_match[] = {
 	{.compatible = "sifive,fu740-c000-prci", .data = &prci_clk_fu740},
 	{}
 };
+MODULE_DEVICE_TABLE(of, sifive_prci_of_match);
 
 static struct platform_driver sifive_prci_driver = {
 	.driver = {