Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

Acked-by: Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>

authored by

Javier Martinez Canillas and committed by
Zhang Rui
26d9339d 3f2883e5

+1
+1
drivers/thermal/tango_thermal.c
··· 107 107 }, 108 108 { /* sentinel */ } 109 109 }; 110 + MODULE_DEVICE_TABLE(of, tango_sensor_ids); 110 111 111 112 static struct platform_driver tango_thermal_driver = { 112 113 .probe = tango_thermal_probe,