* [PATCH] hwmon: (scpi) Fix module autoload
@ 2016-11-07 20:31 Javier Martinez Canillas
2016-11-09 14:51 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: Javier Martinez Canillas @ 2016-11-07 20:31 UTC (permalink / raw)
To: linux-kernel
Cc: Javier Martinez Canillas, linux-hwmon, Jean Delvare, Guenter Roeck
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] hwmon: (scpi) Fix module autoload
2016-11-07 20:31 [PATCH] hwmon: (scpi) Fix module autoload Javier Martinez Canillas
@ 2016-11-09 14:51 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2016-11-09 14:51 UTC (permalink / raw)
To: Javier Martinez Canillas, linux-kernel; +Cc: linux-hwmon, Jean Delvare
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 = {
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-11-09 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-07 20:31 [PATCH] hwmon: (scpi) Fix module autoload Javier Martinez Canillas
2016-11-09 14:51 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).