diff mbox series

[4/6] clk: qcom: apss-ipq6018: add MODULE_ALIAS

Message ID 20220711104719.40939-4-robimarko@gmail.com (mailing list archive)
State Superseded
Headers show
Series [1/6] clk: qcom: clk-rcg2: add rcg2 mux ops | expand

Commit Message

Robert Marko July 11, 2022, 10:47 a.m. UTC
Add MODULE_ALIAS so that driver will be autoloaded if built as a module.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
 drivers/clk/qcom/apss-ipq6018.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Krzysztof Kozlowski July 11, 2022, 11:05 a.m. UTC | #1
On 11/07/2022 12:47, Robert Marko wrote:
> Add MODULE_ALIAS so that driver will be autoloaded if built as a module.
> 
> Signed-off-by: Robert Marko <robimarko@gmail.com>
> ---
>  drivers/clk/qcom/apss-ipq6018.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c
> index f2f502e2d5a4..963c69f2c0c2 100644
> --- a/drivers/clk/qcom/apss-ipq6018.c
> +++ b/drivers/clk/qcom/apss-ipq6018.c
> @@ -101,5 +101,6 @@ static struct platform_driver apss_ipq6018_driver = {
>  
>  module_platform_driver(apss_ipq6018_driver);
>  
> +MODULE_ALIAS("platform:qcom,apss-ipq6018-clk");

That's not correct alias (no commas) and usually alias is not needed at
all. If you need one, please explain why it is needed. Module
autoloading works fine without aliases...

Best regards,
Krzysztof
Robert Marko July 11, 2022, 11:46 a.m. UTC | #2
On Mon, 11 Jul 2022 at 13:05, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 11/07/2022 12:47, Robert Marko wrote:
> > Add MODULE_ALIAS so that driver will be autoloaded if built as a module.
> >
> > Signed-off-by: Robert Marko <robimarko@gmail.com>
> > ---
> >  drivers/clk/qcom/apss-ipq6018.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c
> > index f2f502e2d5a4..963c69f2c0c2 100644
> > --- a/drivers/clk/qcom/apss-ipq6018.c
> > +++ b/drivers/clk/qcom/apss-ipq6018.c
> > @@ -101,5 +101,6 @@ static struct platform_driver apss_ipq6018_driver = {
> >
> >  module_platform_driver(apss_ipq6018_driver);
> >
> > +MODULE_ALIAS("platform:qcom,apss-ipq6018-clk");
>
> That's not correct alias (no commas) and usually alias is not needed at
> all. If you need one, please explain why it is needed. Module
> autoloading works fine without aliases...

Hi Krzysztof,
alias is required here as the driver does not use a DT compatible but
is registered
by the APCS driver, if built as a module, it won't get autoloaded
without an alias.

I can only fix up the driver name here and in APCS first to have an
alias without commas.

Regards,
Robert
>
> Best regards,
> Krzysztof
Krzysztof Kozlowski July 11, 2022, 12:02 p.m. UTC | #3
On 11/07/2022 13:46, Robert Marko wrote:
> On Mon, 11 Jul 2022 at 13:05, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 11/07/2022 12:47, Robert Marko wrote:
>>> Add MODULE_ALIAS so that driver will be autoloaded if built as a module.
>>>
>>> Signed-off-by: Robert Marko <robimarko@gmail.com>
>>> ---
>>>  drivers/clk/qcom/apss-ipq6018.c | 1 +
>>>  1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c
>>> index f2f502e2d5a4..963c69f2c0c2 100644
>>> --- a/drivers/clk/qcom/apss-ipq6018.c
>>> +++ b/drivers/clk/qcom/apss-ipq6018.c
>>> @@ -101,5 +101,6 @@ static struct platform_driver apss_ipq6018_driver = {
>>>
>>>  module_platform_driver(apss_ipq6018_driver);
>>>
>>> +MODULE_ALIAS("platform:qcom,apss-ipq6018-clk");
>>
>> That's not correct alias (no commas) and usually alias is not needed at
>> all. If you need one, please explain why it is needed. Module
>> autoloading works fine without aliases...
> 
> Hi Krzysztof,
> alias is required here as the driver does not use a DT compatible but
> is registered
> by the APCS driver, if built as a module, it won't get autoloaded
> without an alias.

Instead you need device ID table. Aliases are not a workaround for
missing core driver elements.

> 
> I can only fix up the driver name here and in APCS first to have an
> alias without commas.

I see that the comma is used in driver name, so this is an independent
issue. Maybe change it to '-' in separate commit?


Best regards,
Krzysztof
Robert Marko July 11, 2022, 12:45 p.m. UTC | #4
On Mon, 11 Jul 2022 at 14:02, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 11/07/2022 13:46, Robert Marko wrote:
> > On Mon, 11 Jul 2022 at 13:05, Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> On 11/07/2022 12:47, Robert Marko wrote:
> >>> Add MODULE_ALIAS so that driver will be autoloaded if built as a module.
> >>>
> >>> Signed-off-by: Robert Marko <robimarko@gmail.com>
> >>> ---
> >>>  drivers/clk/qcom/apss-ipq6018.c | 1 +
> >>>  1 file changed, 1 insertion(+)
> >>>
> >>> diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c
> >>> index f2f502e2d5a4..963c69f2c0c2 100644
> >>> --- a/drivers/clk/qcom/apss-ipq6018.c
> >>> +++ b/drivers/clk/qcom/apss-ipq6018.c
> >>> @@ -101,5 +101,6 @@ static struct platform_driver apss_ipq6018_driver = {
> >>>
> >>>  module_platform_driver(apss_ipq6018_driver);
> >>>
> >>> +MODULE_ALIAS("platform:qcom,apss-ipq6018-clk");
> >>
> >> That's not correct alias (no commas) and usually alias is not needed at
> >> all. If you need one, please explain why it is needed. Module
> >> autoloading works fine without aliases...
> >
> > Hi Krzysztof,
> > alias is required here as the driver does not use a DT compatible but
> > is registered
> > by the APCS driver, if built as a module, it won't get autoloaded
> > without an alias.
>
> Instead you need device ID table. Aliases are not a workaround for
> missing core driver elements.

Thanks for pointing this out, it looks like a proper solution for this.
I will drop this patch and fix up autoloading after this series gets merged
as APCS also requires a fixup, especially since the name in the platform
table is limited to 20 characters and the current name does not fit.
>
> >
> > I can only fix up the driver name here and in APCS first to have an
> > alias without commas.
>
> I see that the comma is used in driver name, so this is an independent
> issue. Maybe change it to '-' in separate commit?

Like with the previous point, I will drop this patch and fix it after
this series gets merged.

Regards,
Robert
>
>
> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/drivers/clk/qcom/apss-ipq6018.c b/drivers/clk/qcom/apss-ipq6018.c
index f2f502e2d5a4..963c69f2c0c2 100644
--- a/drivers/clk/qcom/apss-ipq6018.c
+++ b/drivers/clk/qcom/apss-ipq6018.c
@@ -101,5 +101,6 @@  static struct platform_driver apss_ipq6018_driver = {
 
 module_platform_driver(apss_ipq6018_driver);
 
+MODULE_ALIAS("platform:qcom,apss-ipq6018-clk");
 MODULE_DESCRIPTION("QCOM APSS IPQ 6018 CLK Driver");
 MODULE_LICENSE("GPL v2");