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

PM / devfreq: rockchip-dfi: 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/devfreq/event/rockchip-dfi.ko | grep alias
$

After this patch:

$ modinfo drivers/devfreq/event/rockchip-dfi.ko | grep alias
alias: of:N*T*Crockchip,rk3399-dfiC*
alias: of:N*T*Crockchip,rk3399-dfi

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

authored by

Javier Martinez Canillas and committed by
MyungJoo Ham
dfd7c845 ca5c3b21

+1
+1
drivers/devfreq/event/rockchip-dfi.c
··· 188 188 { .compatible = "rockchip,rk3399-dfi" }, 189 189 { }, 190 190 }; 191 + MODULE_DEVICE_TABLE(of, rockchip_dfi_id_match); 191 192 192 193 static int rockchip_dfi_probe(struct platform_device *pdev) 193 194 {