[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <02bcafff-ccd3-57f4-4a70-6a79320bbb23@roeck-us.net>
Date: Wed, 9 Nov 2016 06:51:01 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Javier Martinez Canillas <javier@....samsung.com>,
linux-kernel@...r.kernel.org
Cc: linux-hwmon@...r.kernel.org, Jean Delvare <jdelvare@...e.com>
Subject: Re: [PATCH] hwmon: (scpi) Fix module autoload
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@....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 = {
>
Powered by blists - more mailing lists