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

rtc: cros-ec: 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

Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240329075630.2069474-4-tzungbi@kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Tzung-Bi Shih and committed by
Alexandre Belloni
61c86d14 4cece764

+8 -1
+8 -1
drivers/rtc/rtc-cros-ec.c
··· 5 5 // Author: Stephen Barber <smbarber@chromium.org> 6 6 7 7 #include <linux/kernel.h> 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> ··· 393 392 dev_err(dev, "failed to unregister notifier\n"); 394 393 } 395 394 395 + static const struct platform_device_id cros_ec_rtc_id[] = { 396 + { DRV_NAME, 0 }, 397 + {} 398 + }; 399 + MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id); 400 + 396 401 static struct platform_driver cros_ec_rtc_driver = { 397 402 .probe = cros_ec_rtc_probe, 398 403 .remove_new = cros_ec_rtc_remove, ··· 406 399 .name = DRV_NAME, 407 400 .pm = &cros_ec_rtc_pm_ops, 408 401 }, 402 + .id_table = cros_ec_rtc_id, 409 403 }; 410 404 411 405 module_platform_driver(cros_ec_rtc_driver); ··· 414 406 MODULE_DESCRIPTION("RTC driver for Chrome OS ECs"); 415 407 MODULE_AUTHOR("Stephen Barber <smbarber@chromium.org>"); 416 408 MODULE_LICENSE("GPL v2"); 417 - MODULE_ALIAS("platform:" DRV_NAME);