Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <bleung@chromium.org>
Reviewed-by: Prashant Malani <pmalani@chromium.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Link: https://lore.kernel.org/r/20240401030052.2887845-4-tzungbi@kernel.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Tzung-Bi Shih and committed by
Sebastian Reichel
0f8678c3 91b623cd

+9 -2
+9 -2
drivers/power/supply/cros_usbpd-charger.c
··· 5 5 * Copyright (c) 2014 - 2018 Google, Inc 6 6 */ 7 7 8 + #include <linux/mod_devicetable.h> 8 9 #include <linux/module.h> 9 10 #include <linux/platform_data/cros_ec_commands.h> 10 11 #include <linux/platform_data/cros_ec_proto.h> ··· 712 711 static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL, 713 712 cros_usbpd_charger_resume); 714 713 714 + static const struct platform_device_id cros_usbpd_charger_id[] = { 715 + { DRV_NAME, 0 }, 716 + {} 717 + }; 718 + MODULE_DEVICE_TABLE(platform, cros_usbpd_charger_id); 719 + 715 720 static struct platform_driver cros_usbpd_charger_driver = { 716 721 .driver = { 717 722 .name = DRV_NAME, 718 723 .pm = &cros_usbpd_charger_pm_ops, 719 724 }, 720 - .probe = cros_usbpd_charger_probe 725 + .probe = cros_usbpd_charger_probe, 726 + .id_table = cros_usbpd_charger_id, 721 727 }; 722 728 723 729 module_platform_driver(cros_usbpd_charger_driver); 724 730 725 731 MODULE_LICENSE("GPL"); 726 732 MODULE_DESCRIPTION("ChromeOS EC USBPD charger"); 727 - MODULE_ALIAS("platform:" DRV_NAME);