Skip to content

Commit d6486a1

Browse files
Tzung-Bi Shihsre
authored andcommitted
power: supply: cros_pchg: 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: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org> Link: https://lore.kernel.org/r/20240401030052.2887845-5-tzungbi@kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
1 parent 0f8678c commit d6486a1

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

drivers/power/supply/cros_peripheral_charger.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* Copyright 2020 Google LLC.
66
*/
77

8+
#include <linux/mod_devicetable.h>
89
#include <linux/module.h>
910
#include <linux/notifier.h>
1011
#include <linux/platform_data/cros_ec_commands.h>
@@ -367,16 +368,22 @@ static int __maybe_unused cros_pchg_resume(struct device *dev)
367368

368369
static SIMPLE_DEV_PM_OPS(cros_pchg_pm_ops, NULL, cros_pchg_resume);
369370

371+
static const struct platform_device_id cros_pchg_id[] = {
372+
{ DRV_NAME, 0 },
373+
{}
374+
};
375+
MODULE_DEVICE_TABLE(platform, cros_pchg_id);
376+
370377
static struct platform_driver cros_pchg_driver = {
371378
.driver = {
372379
.name = DRV_NAME,
373380
.pm = &cros_pchg_pm_ops,
374381
},
375-
.probe = cros_pchg_probe
382+
.probe = cros_pchg_probe,
383+
.id_table = cros_pchg_id,
376384
};
377385

378386
module_platform_driver(cros_pchg_driver);
379387

380388
MODULE_LICENSE("GPL");
381389
MODULE_DESCRIPTION("ChromeOS EC peripheral device charger");
382-
MODULE_ALIAS("platform:" DRV_NAME);

0 commit comments

Comments
 (0)