Skip to content

Commit 61e05ba

Browse files
andy-shevAndi Shyti
authored andcommitted
i2c: designware: Replace MODULE_ALIAS() with MODULE_DEVICE_TABLE()
As Krzysztof Kozlowski pointed out the better is to use MODULE_DEVICE_TABLE() as it will be consistent with the content of the real ID table of the platform devices. While at it, drop unneeded and unused module alias in PCI glue driver as PCI already has its own ID table and automatic loading should just work. Reviewed-by: Andi Shyti <[email protected]> Reviewed-by: Mario Limonciello <[email protected]> Acked-by: Jarkko Nikula <[email protected]> Tested-by: Jarkko Nikula <[email protected]> Tested-by: Serge Semin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 1ce1ad6 commit 61e05ba

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

drivers/i2c/busses/i2c-designware-pcidrv.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,8 +424,6 @@ static struct pci_driver dw_i2c_driver = {
424424
};
425425
module_pci_driver(dw_i2c_driver);
426426

427-
/* Work with hotplug and coldplug */
428-
MODULE_ALIAS("i2c_designware-pci");
429427
MODULE_AUTHOR("Baruch Siach <[email protected]>");
430428
MODULE_DESCRIPTION("Synopsys DesignWare PCI I2C bus adapter");
431429
MODULE_LICENSE("GPL");

drivers/i2c/busses/i2c-designware-platdrv.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,11 @@ static const struct dev_pm_ops dw_i2c_dev_pm_ops = {
480480
RUNTIME_PM_OPS(dw_i2c_plat_runtime_suspend, dw_i2c_plat_runtime_resume, NULL)
481481
};
482482

483-
/* Work with hotplug and coldplug */
484-
MODULE_ALIAS("platform:i2c_designware");
483+
static const struct platform_device_id dw_i2c_platform_ids[] = {
484+
{ "i2c_designware" },
485+
{}
486+
};
487+
MODULE_DEVICE_TABLE(platform, dw_i2c_platform_ids);
485488

486489
static struct platform_driver dw_i2c_driver = {
487490
.probe = dw_i2c_plat_probe,
@@ -492,6 +495,7 @@ static struct platform_driver dw_i2c_driver = {
492495
.acpi_match_table = ACPI_PTR(dw_i2c_acpi_match),
493496
.pm = pm_ptr(&dw_i2c_dev_pm_ops),
494497
},
498+
.id_table = dw_i2c_platform_ids,
495499
};
496500

497501
static int __init dw_i2c_init_driver(void)

0 commit comments

Comments
 (0)