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

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>

authored by

Tzung-Bi Shih and committed by
Sebastian Reichel
d6486a13 0f8678c3

+9 -2
+9 -2
drivers/power/supply/cros_peripheral_charger.c
··· 5 5 * Copyright 2020 Google LLC. 6 6 */ 7 7 8 + #include <linux/mod_devicetable.h> 8 9 #include <linux/module.h> 9 10 #include <linux/notifier.h> 10 11 #include <linux/platform_data/cros_ec_commands.h> ··· 368 367 369 368 static SIMPLE_DEV_PM_OPS(cros_pchg_pm_ops, NULL, cros_pchg_resume); 370 369 370 + static const struct platform_device_id cros_pchg_id[] = { 371 + { DRV_NAME, 0 }, 372 + {} 373 + }; 374 + MODULE_DEVICE_TABLE(platform, cros_pchg_id); 375 + 371 376 static struct platform_driver cros_pchg_driver = { 372 377 .driver = { 373 378 .name = DRV_NAME, 374 379 .pm = &cros_pchg_pm_ops, 375 380 }, 376 - .probe = cros_pchg_probe 381 + .probe = cros_pchg_probe, 382 + .id_table = cros_pchg_id, 377 383 }; 378 384 379 385 module_platform_driver(cros_pchg_driver); 380 386 381 387 MODULE_LICENSE("GPL"); 382 388 MODULE_DESCRIPTION("ChromeOS EC peripheral device charger"); 383 - MODULE_ALIAS("platform:" DRV_NAME);