i2c: davinci: Use platform table macro over module_alias
authorAndrew Davis <afd@ti.com>
Mon, 15 May 2023 17:50:41 +0000 (12:50 -0500)
committerWolfram Sang <wsa@kernel.org>
Fri, 23 Jun 2023 08:23:49 +0000 (10:23 +0200)
Generates the same platform module alias. More standard usage.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
[wsa: rebased to i2c/for-mergewindow]
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-davinci.c

index 78bd2a180e6d0c8473affcc2cb77251f050e09a0..71b60778c643ddb0d471ca96b0ef2346ec52bf7c 100644 (file)
@@ -935,12 +935,16 @@ static const struct dev_pm_ops davinci_i2c_pm = {
 #define davinci_i2c_pm_ops NULL
 #endif
 
-/* work with hotplug and coldplug */
-MODULE_ALIAS("platform:i2c_davinci");
+static const struct platform_device_id davinci_i2c_driver_ids[] = {
+       { .name = "i2c_davinci", },
+       { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(platform, davinci_i2c_driver_ids);
 
 static struct platform_driver davinci_i2c_driver = {
        .probe          = davinci_i2c_probe,
        .remove_new     = davinci_i2c_remove,
+       .id_table       = davinci_i2c_driver_ids,
        .driver         = {
                .name   = "i2c_davinci",
                .pm     = davinci_i2c_pm_ops,