Skip to content

Commit 80a20cf

Browse files
author
Tzung-Bi Shih
committed
platform/chrome: cros_ec_sensorhub: 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 <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Tzung-Bi Shih <[email protected]>
1 parent 41f4bc6 commit 80a20cf

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/platform/chrome/cros_ec_sensorhub.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/init.h>
1010
#include <linux/device.h>
11+
#include <linux/mod_devicetable.h>
1112
#include <linux/module.h>
1213
#include <linux/platform_data/cros_ec_commands.h>
1314
#include <linux/platform_data/cros_ec_proto.h>
@@ -247,17 +248,23 @@ static SIMPLE_DEV_PM_OPS(cros_ec_sensorhub_pm_ops,
247248
cros_ec_sensorhub_suspend,
248249
cros_ec_sensorhub_resume);
249250

251+
static const struct platform_device_id cros_ec_sensorhub_id[] = {
252+
{ DRV_NAME, 0 },
253+
{}
254+
};
255+
MODULE_DEVICE_TABLE(platform, cros_ec_sensorhub_id);
256+
250257
static struct platform_driver cros_ec_sensorhub_driver = {
251258
.driver = {
252259
.name = DRV_NAME,
253260
.pm = &cros_ec_sensorhub_pm_ops,
254261
},
255262
.probe = cros_ec_sensorhub_probe,
263+
.id_table = cros_ec_sensorhub_id,
256264
};
257265

258266
module_platform_driver(cros_ec_sensorhub_driver);
259267

260-
MODULE_ALIAS("platform:" DRV_NAME);
261268
MODULE_AUTHOR("Gwendal Grignou <[email protected]>");
262269
MODULE_DESCRIPTION("ChromeOS EC MEMS Sensor Hub Driver");
263270
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)