Skip to content

Commit 02b496a

Browse files
author
Tzung-Bi Shih
committed
platform/chrome: wilco_ec: core: 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: Krzysztof Kozlowski <[email protected]> Reviewed-by: Benson Leung <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 3f638e4 commit 02b496a

File tree

1 file changed

+8
-1
lines changed
  • drivers/platform/chrome/wilco_ec

1 file changed

+8
-1
lines changed

drivers/platform/chrome/wilco_ec/core.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/acpi.h>
1111
#include <linux/device.h>
1212
#include <linux/ioport.h>
13+
#include <linux/mod_devicetable.h>
1314
#include <linux/module.h>
1415
#include <linux/platform_data/wilco-ec.h>
1516
#include <linux/platform_device.h>
@@ -150,13 +151,20 @@ static const struct acpi_device_id wilco_ec_acpi_device_ids[] = {
150151
};
151152
MODULE_DEVICE_TABLE(acpi, wilco_ec_acpi_device_ids);
152153

154+
static const struct platform_device_id wilco_ec_id[] = {
155+
{ DRV_NAME, 0 },
156+
{}
157+
};
158+
MODULE_DEVICE_TABLE(platform, wilco_ec_id);
159+
153160
static struct platform_driver wilco_ec_driver = {
154161
.driver = {
155162
.name = DRV_NAME,
156163
.acpi_match_table = wilco_ec_acpi_device_ids,
157164
},
158165
.probe = wilco_ec_probe,
159166
.remove_new = wilco_ec_remove,
167+
.id_table = wilco_ec_id,
160168
};
161169

162170
module_platform_driver(wilco_ec_driver);
@@ -165,4 +173,3 @@ MODULE_AUTHOR("Nick Crews <[email protected]>");
165173
MODULE_AUTHOR("Duncan Laurie <[email protected]>");
166174
MODULE_LICENSE("GPL v2");
167175
MODULE_DESCRIPTION("ChromeOS Wilco Embedded Controller driver");
168-
MODULE_ALIAS("platform:" DRV_NAME);

0 commit comments

Comments
 (0)