Skip to content

Commit 6dd0137

Browse files
author
Tzung-Bi Shih
committed
platform/chrome: wilco_ec: telemetry: 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> Link: https://lore.kernel.org/r/20240329075630.2069474-16-tzungbi@kernel.org Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
1 parent 0cb7b26 commit 6dd0137

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

drivers/platform/chrome/wilco_ec/telemetry.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <linux/cdev.h>
3131
#include <linux/device.h>
3232
#include <linux/fs.h>
33+
#include <linux/mod_devicetable.h>
3334
#include <linux/module.h>
3435
#include <linux/platform_data/wilco-ec.h>
3536
#include <linux/platform_device.h>
@@ -409,12 +410,19 @@ static void telem_device_remove(struct platform_device *pdev)
409410
put_device(&dev_data->dev);
410411
}
411412

413+
static const struct platform_device_id telem_id[] = {
414+
{ DRV_NAME, 0 },
415+
{}
416+
};
417+
MODULE_DEVICE_TABLE(platform, telem_id);
418+
412419
static struct platform_driver telem_driver = {
413420
.probe = telem_device_probe,
414421
.remove_new = telem_device_remove,
415422
.driver = {
416423
.name = DRV_NAME,
417424
},
425+
.id_table = telem_id,
418426
};
419427

420428
static int __init telem_module_init(void)
@@ -466,4 +474,3 @@ module_exit(telem_module_exit);
466474
MODULE_AUTHOR("Nick Crews <ncrews@chromium.org>");
467475
MODULE_DESCRIPTION("Wilco EC telemetry driver");
468476
MODULE_LICENSE("GPL");
469-
MODULE_ALIAS("platform:" DRV_NAME);

0 commit comments

Comments
 (0)