Skip to content

Commit ff8a0ee

Browse files
Tzung-Bi Shihroxanan1996
authored andcommitted
platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback match
BugLink: https://bugs.launchpad.net/bugs/2075154 [ Upstream commit e0e59c5 ] 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]> 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 2932b76 commit ff8a0ee

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/platform/chrome/cros_usbpd_logger.c

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

88
#include <linux/ktime.h>
99
#include <linux/math64.h>
10+
#include <linux/mod_devicetable.h>
1011
#include <linux/module.h>
1112
#include <linux/platform_data/cros_ec_commands.h>
1213
#include <linux/platform_data/cros_ec_proto.h>
@@ -249,17 +250,23 @@ static int __maybe_unused cros_usbpd_logger_suspend(struct device *dev)
249250
static SIMPLE_DEV_PM_OPS(cros_usbpd_logger_pm_ops, cros_usbpd_logger_suspend,
250251
cros_usbpd_logger_resume);
251252

253+
static const struct platform_device_id cros_usbpd_logger_id[] = {
254+
{ DRV_NAME, 0 },
255+
{}
256+
};
257+
MODULE_DEVICE_TABLE(platform, cros_usbpd_logger_id);
258+
252259
static struct platform_driver cros_usbpd_logger_driver = {
253260
.driver = {
254261
.name = DRV_NAME,
255262
.pm = &cros_usbpd_logger_pm_ops,
256263
},
257264
.probe = cros_usbpd_logger_probe,
258265
.remove_new = cros_usbpd_logger_remove,
266+
.id_table = cros_usbpd_logger_id,
259267
};
260268

261269
module_platform_driver(cros_usbpd_logger_driver);
262270

263271
MODULE_LICENSE("GPL v2");
264272
MODULE_DESCRIPTION("Logging driver for ChromeOS EC USBPD Charger.");
265-
MODULE_ALIAS("platform:" DRV_NAME);

0 commit comments

Comments
 (0)