Skip to content

Commit e3813bb

Browse files
Tzung-Bi Shihroxanan1996
authored andcommitted
platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback match
BugLink: https://bugs.launchpad.net/bugs/2075154 [ Upstream commit 8ad3b96 ] Instead of using fallback driver name match, provide ID table[1] for the primary match. [1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353 Reviewed-by: Benson Leung <[email protected]> Acked-by: Prashant Malani <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Manuel Diewald <[email protected]> Signed-off-by: Stefan Bader <[email protected]>
1 parent ff8a0ee commit e3813bb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/platform/chrome/cros_usbpd_notify.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include <linux/acpi.h>
9+
#include <linux/mod_devicetable.h>
910
#include <linux/module.h>
1011
#include <linux/platform_data/cros_ec_proto.h>
1112
#include <linux/platform_data/cros_usbpd_notify.h>
@@ -218,12 +219,19 @@ static void cros_usbpd_notify_remove_plat(struct platform_device *pdev)
218219
&pdnotify->nb);
219220
}
220221

222+
static const struct platform_device_id cros_usbpd_notify_id[] = {
223+
{ DRV_NAME, 0 },
224+
{}
225+
};
226+
MODULE_DEVICE_TABLE(platform, cros_usbpd_notify_id);
227+
221228
static struct platform_driver cros_usbpd_notify_plat_driver = {
222229
.driver = {
223230
.name = DRV_NAME,
224231
},
225232
.probe = cros_usbpd_notify_probe_plat,
226233
.remove_new = cros_usbpd_notify_remove_plat,
234+
.id_table = cros_usbpd_notify_id,
227235
};
228236

229237
static int __init cros_usbpd_notify_init(void)
@@ -258,4 +266,3 @@ module_exit(cros_usbpd_notify_exit);
258266
MODULE_LICENSE("GPL");
259267
MODULE_DESCRIPTION("ChromeOS power delivery notifier device");
260268
MODULE_AUTHOR("Jon Flatley <[email protected]>");
261-
MODULE_ALIAS("platform:" DRV_NAME);

0 commit comments

Comments
 (0)