Skip to content

Commit 0f8678c

Browse files
Tzung-Bi Shihsre
authored andcommitted
power: supply: cros_usbpd: provide ID table for avoiding fallback match
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: Prashant Malani <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Tzung-Bi Shih <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 91b623c commit 0f8678c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/power/supply/cros_usbpd-charger.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright (c) 2014 - 2018 Google, Inc
66
*/
77

8+
#include <linux/mod_devicetable.h>
89
#include <linux/module.h>
910
#include <linux/platform_data/cros_ec_commands.h>
1011
#include <linux/platform_data/cros_ec_proto.h>
@@ -711,16 +712,22 @@ static int cros_usbpd_charger_resume(struct device *dev)
711712
static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL,
712713
cros_usbpd_charger_resume);
713714

715+
static const struct platform_device_id cros_usbpd_charger_id[] = {
716+
{ DRV_NAME, 0 },
717+
{}
718+
};
719+
MODULE_DEVICE_TABLE(platform, cros_usbpd_charger_id);
720+
714721
static struct platform_driver cros_usbpd_charger_driver = {
715722
.driver = {
716723
.name = DRV_NAME,
717724
.pm = &cros_usbpd_charger_pm_ops,
718725
},
719-
.probe = cros_usbpd_charger_probe
726+
.probe = cros_usbpd_charger_probe,
727+
.id_table = cros_usbpd_charger_id,
720728
};
721729

722730
module_platform_driver(cros_usbpd_charger_driver);
723731

724732
MODULE_LICENSE("GPL");
725733
MODULE_DESCRIPTION("ChromeOS EC USBPD charger");
726-
MODULE_ALIAS("platform:" DRV_NAME);

0 commit comments

Comments
 (0)