Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1516566 > unrolled thread

[PATCH] hwmon: (scpi) Fix module autoload

Started byJavier Martinez Canillas <javier@osg.samsung.com>
First post2016-11-07 21:40 +0100
Last post2016-11-09 16:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] hwmon: (scpi) Fix module autoload Javier Martinez Canillas <javier@osg.samsung.com> - 2016-11-07 21:40 +0100
    Re: [PATCH] hwmon: (scpi) Fix module autoload Guenter Roeck <linux@roeck-us.net> - 2016-11-09 16:00 +0100

#1516566 — [PATCH] hwmon: (scpi) Fix module autoload

FromJavier Martinez Canillas <javier@osg.samsung.com>
Date2016-11-07 21:40 +0100
Subject[PATCH] hwmon: (scpi) Fix module autoload
Message-ID<sAYRY-8aE-5@gated-at.bofh.it>
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/hwmon/scpi-hwmon.ko | grep alias
$

After this patch:

$ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias
alias:          of:N*T*Carm,scpi-sensorsC*
alias:          of:N*T*Carm,scpi-sensors

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
---

 drivers/hwmon/scpi-hwmon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c
index 559a3dcd64d8..094f948f99ff 100644
--- a/drivers/hwmon/scpi-hwmon.c
+++ b/drivers/hwmon/scpi-hwmon.c
@@ -251,6 +251,7 @@ static const struct of_device_id scpi_of_match[] = {
 	{.compatible = "arm,scpi-sensors"},
 	{},
 };
+MODULE_DEVICE_TABLE(of, scpi_of_match);
 
 static struct platform_driver scpi_hwmon_platdrv = {
 	.driver = {
-- 
2.7.4

[toc] | [next] | [standalone]


#1518236

FromGuenter Roeck <linux@roeck-us.net>
Date2016-11-09 16:00 +0100
Message-ID<sBCw2-el-29@gated-at.bofh.it>
In reply to#1516566
On 11/07/2016 12:31 PM, 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/hwmon/scpi-hwmon.ko | grep alias
> $
>
> After this patch:
>
> $ modinfo drivers/hwmon/scpi-hwmon.ko | grep alias
> alias:          of:N*T*Carm,scpi-sensorsC*
> alias:          of:N*T*Carm,scpi-sensors
>
> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>

Applied.

Thanks,
Guenter

> ---
>
>  drivers/hwmon/scpi-hwmon.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hwmon/scpi-hwmon.c b/drivers/hwmon/scpi-hwmon.c
> index 559a3dcd64d8..094f948f99ff 100644
> --- a/drivers/hwmon/scpi-hwmon.c
> +++ b/drivers/hwmon/scpi-hwmon.c
> @@ -251,6 +251,7 @@ static const struct of_device_id scpi_of_match[] = {
>  	{.compatible = "arm,scpi-sensors"},
>  	{},
>  };
> +MODULE_DEVICE_TABLE(of, scpi_of_match);
>
>  static struct platform_driver scpi_hwmon_platdrv = {
>  	.driver = {
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web