2016-10-14 14:35:18

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 0/3] thermal: Fix module autoload for drivers

Hello,

This small series contains trivial fixes to allow modules to be autoloaded
when its correspoinding thermal device is registered.

Best regards,
Javier


Javier Martinez Canillas (3):
thermal: max77620: Fix module autoload
thermal: tango: Fix module autoload
thermal: db8500: Fix module autoload

drivers/thermal/db8500_thermal.c | 1 +
drivers/thermal/max77620_thermal.c | 1 +
drivers/thermal/tango_thermal.c | 1 +
3 files changed, 3 insertions(+)

--
2.7.4


2016-10-14 14:35:28

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 1/3] thermal: max77620: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/thermal/max77620_thermal.ko | grep alias
$

After this patch:

$ modinfo drivers/thermal/max77620_thermal.ko | grep alias
alias: platform:max77620-thermal

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/thermal/max77620_thermal.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/max77620_thermal.c b/drivers/thermal/max77620_thermal.c
index 83905ff46e40..e9a1fe342760 100644
--- a/drivers/thermal/max77620_thermal.c
+++ b/drivers/thermal/max77620_thermal.c
@@ -149,6 +149,7 @@ static struct platform_device_id max77620_thermal_devtype[] = {
{ .name = "max77620-thermal", },
{},
};
+MODULE_DEVICE_TABLE(platform, max77620_thermal_devtype);

static struct platform_driver max77620_thermal_driver = {
.driver = {
--
2.7.4

2016-10-14 14:35:44

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 2/3] thermal: tango: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/thermal/tango_thermal.ko | grep alias
$

After this patch:

$ modinfo drivers/thermal/tango_thermal.ko | grep alias
alias: of:N*T*Csigma,smp8758-thermalC*
alias: of:N*T*Csigma,smp8758-thermal

Signed-off-by: Javier Martinez Canillas <[email protected]>
---

drivers/thermal/tango_thermal.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/tango_thermal.c b/drivers/thermal/tango_thermal.c
index 201304aeafeb..4e67795cb6ce 100644
--- a/drivers/thermal/tango_thermal.c
+++ b/drivers/thermal/tango_thermal.c
@@ -107,6 +107,7 @@ static const struct of_device_id tango_sensor_ids[] = {
},
{ /* sentinel */ }
};
+MODULE_DEVICE_TABLE(of, tango_sensor_ids);

static struct platform_driver tango_thermal_driver = {
.probe = tango_thermal_probe,
--
2.7.4

2016-10-14 14:35:59

by Javier Martinez Canillas

[permalink] [raw]
Subject: [PATCH 3/3] thermal: db8500: Fix module autoload

If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/thermal/db8500_thermal.ko | grep alias
$

After this patch:

$ modinfo drivers/thermal/db8500_thermal.ko | grep alias
alias: of:N*T*Cstericsson,db8500-thermalC*
alias: of:N*T*Cstericsson,db8500-thermal

Signed-off-by: Javier Martinez Canillas <[email protected]>

---

drivers/thermal/db8500_thermal.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/db8500_thermal.c b/drivers/thermal/db8500_thermal.c
index e776cea80cfc..f491faf16592 100644
--- a/drivers/thermal/db8500_thermal.c
+++ b/drivers/thermal/db8500_thermal.c
@@ -512,6 +512,7 @@ static const struct of_device_id db8500_thermal_match[] = {
{ .compatible = "stericsson,db8500-thermal" },
{},
};
+MODULE_DEVICE_TABLE(of, db8500_thermal_match);
#endif

static struct platform_driver db8500_thermal_driver = {
--
2.7.4

2016-10-14 15:34:55

by Marc Gonzalez

[permalink] [raw]
Subject: Re: [PATCH 2/3] thermal: tango: Fix module autoload

On 14/10/2016 16:35, Javier Martinez Canillas wrote:

> If the driver is built as a module, autoload won't work because the module
> alias information is not filled. So user-space can't match the registered
> device with the corresponding module.
>
> Export the module alias information using the MODULE_DEVICE_TABLE() macro.
>
> Before this patch:
>
> $ modinfo drivers/thermal/tango_thermal.ko | grep alias
> $
>
> After this patch:
>
> $ modinfo drivers/thermal/tango_thermal.ko | grep alias
> alias: of:N*T*Csigma,smp8758-thermalC*
> alias: of:N*T*Csigma,smp8758-thermal
>
> Signed-off-by: Javier Martinez Canillas <[email protected]>
> ---
>
> drivers/thermal/tango_thermal.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/thermal/tango_thermal.c b/drivers/thermal/tango_thermal.c
> index 201304aeafeb..4e67795cb6ce 100644
> --- a/drivers/thermal/tango_thermal.c
> +++ b/drivers/thermal/tango_thermal.c
> @@ -107,6 +107,7 @@ static const struct of_device_id tango_sensor_ids[] = {
> },
> { /* sentinel */ }
> };
> +MODULE_DEVICE_TABLE(of, tango_sensor_ids);

Thanks for fixing it :-)

Acked-by: Marc Gonzalez <[email protected]>

Regards.

2016-11-17 11:50:16

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 0/3] thermal: Fix module autoload for drivers

Hello Eduardo,

On Fri, Oct 14, 2016 at 11:34 AM, Javier Martinez Canillas
<[email protected]> wrote:
> Hello,
>
> This small series contains trivial fixes to allow modules to be autoloaded
> when its correspoinding thermal device is registered.
>
> Best regards,
> Javier
>
>
> Javier Martinez Canillas (3):
> thermal: max77620: Fix module autoload
> thermal: tango: Fix module autoload
> thermal: db8500: Fix module autoload
>

Any comments about these patches?

Best regards,
Javier

2016-11-17 17:28:39

by Javier Martinez Canillas

[permalink] [raw]
Subject: Re: [PATCH 0/3] thermal: Fix module autoload for drivers

Hello Eduardo,

On 11/17/2016 11:53 AM, Eduardo Valentin wrote:
> On Thu, Nov 17, 2016 at 08:50:11AM -0300, Javier Martinez Canillas wrote:
>> Hello Eduardo,
>>
>> On Fri, Oct 14, 2016 at 11:34 AM, Javier Martinez Canillas
>> <[email protected]> wrote:
>>> Hello,
>>>
>>> This small series contains trivial fixes to allow modules to be autoloaded
>>> when its correspoinding thermal device is registered.
>>>
>>> Best regards,
>>> Javier
>>>
>>>
>>> Javier Martinez Canillas (3):
>>> thermal: max77620: Fix module autoload
>>> thermal: tango: Fix module autoload
>>> thermal: db8500: Fix module autoload
>>>
>>
>> Any comments about these patches?
>
> So far no. I am finalizing a couple of automated testing, but they are
> in my queue.
>

Ok, I also got your automated emails about them being applied.

> Thanks for the fixes.
>

Thanks.

> BR,
>
>>
>> Best regards,
>> Javier

Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America

2016-11-17 18:23:36

by Eduardo Valentin

[permalink] [raw]
Subject: Re: [PATCH 0/3] thermal: Fix module autoload for drivers

On Thu, Nov 17, 2016 at 08:50:11AM -0300, Javier Martinez Canillas wrote:
> Hello Eduardo,
>
> On Fri, Oct 14, 2016 at 11:34 AM, Javier Martinez Canillas
> <[email protected]> wrote:
> > Hello,
> >
> > This small series contains trivial fixes to allow modules to be autoloaded
> > when its correspoinding thermal device is registered.
> >
> > Best regards,
> > Javier
> >
> >
> > Javier Martinez Canillas (3):
> > thermal: max77620: Fix module autoload
> > thermal: tango: Fix module autoload
> > thermal: db8500: Fix module autoload
> >
>
> Any comments about these patches?

So far no. I am finalizing a couple of automated testing, but they are
in my queue.

Thanks for the fixes.

BR,

>
> Best regards,
> Javier