Skip to content

Commit 61c86d1

Browse files
Tzung-Bi Shihalexandrebelloni
authored andcommitted
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 <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexandre Belloni <[email protected]>
1 parent 4cece76 commit 61c86d1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/rtc/rtc-cros-ec.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// Author: Stephen Barber <[email protected]>
66

77
#include <linux/kernel.h>
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>
@@ -392,18 +393,24 @@ static void cros_ec_rtc_remove(struct platform_device *pdev)
392393
dev_err(dev, "failed to unregister notifier\n");
393394
}
394395

396+
static const struct platform_device_id cros_ec_rtc_id[] = {
397+
{ DRV_NAME, 0 },
398+
{}
399+
};
400+
MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
401+
395402
static struct platform_driver cros_ec_rtc_driver = {
396403
.probe = cros_ec_rtc_probe,
397404
.remove_new = cros_ec_rtc_remove,
398405
.driver = {
399406
.name = DRV_NAME,
400407
.pm = &cros_ec_rtc_pm_ops,
401408
},
409+
.id_table = cros_ec_rtc_id,
402410
};
403411

404412
module_platform_driver(cros_ec_rtc_driver);
405413

406414
MODULE_DESCRIPTION("RTC driver for Chrome OS ECs");
407415
MODULE_AUTHOR("Stephen Barber <[email protected]>");
408416
MODULE_LICENSE("GPL v2");
409-
MODULE_ALIAS("platform:" DRV_NAME);

0 commit comments

Comments
 (0)