[PATCH -next 9/9] ipmi: ipmi_ssif: fix module autoloading

Yuntao Liu posted 9 patches 1 year, 5 months ago
[PATCH -next 9/9] ipmi: ipmi_ssif: fix module autoloading
Posted by Yuntao Liu 1 year, 5 months ago
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
based on the alias from platform_device_id table.

Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com>
---
 drivers/char/ipmi/ipmi_ssif.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/char/ipmi/ipmi_ssif.c b/drivers/char/ipmi/ipmi_ssif.c
index 96ad571d041a..e8e7b832c060 100644
--- a/drivers/char/ipmi/ipmi_ssif.c
+++ b/drivers/char/ipmi/ipmi_ssif.c
@@ -2085,6 +2085,7 @@ static const struct platform_device_id ssif_plat_ids[] = {
     { "dmi-ipmi-ssif", 0 },
     { }
 };
+MODULE_DEVICE_TABLE(platform, ssif_plat_ids);
 
 static struct platform_driver ipmi_driver = {
 	.driver = {
-- 
2.34.1
Re: [PATCH -next 9/9] ipmi: ipmi_ssif: fix module autoloading
Posted by Arnd Bergmann 1 year, 5 months ago
On Mon, Aug 19, 2024, at 13:38, Yuntao Liu wrote:
> Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
> based on the alias from platform_device_id table.
>
> Signed-off-by: Yuntao Liu <liuyuntao12@huawei.com>
> ---

The driver already has a MODULE_ALIAS() with the same string.

I think the MODULE_DEVICE_TABLE() entry is slightly cleaner here,
but it should only have one of the two, not both.

     Arnd