Skip to contentSkip to conversation

platform/chrome: provide ID table for avoiding fallback match

PATCH Applied Tzung-Bi Shih 8 participants 64 messages Mar 29, 2024 – Apr 4, 2024

Subsystems (8)

v1 of 2 Applied 13/18 Latest is v2 →

lore
Share & tools
lore

Tzung-Bi Shih

author maintainer
#0 lore raw

cover platform/chrome: provide ID table for avoiding fallback match

Inspired by [1]. Turn all MODULE_ALIAS() in ChromeOS EC platform drivers into proper platform_device_id table and MODULE_DEVICE_TABLE().

The series is basically looking for drivers from:
- struct mfd_cell in drivers/mfd/cros_ec_dev.c.
- grep -R MODULE_ALIAS drivers/platform/chrome/.

[1]: https://lore.kernel.org/chrome-platform/[email protected]/T/#m2cc7d6f770cf0a48fb537bbaed655169c974f067

Tzung-Bi Shih (18):
media: platform: cros-ec: provide ID table for avoiding fallback match
gpio: cros-ec: provide ID table for avoiding fallback match
rtc: cros-ec: provide ID table for avoiding fallback match platform/chrome: cros_ec_sensorhub: provide ID table for avoiding
fallback match
power: supply: cros_usbpd: provide ID table for avoiding fallback
match
platform/chrome: cros_usbpd_logger: provide ID table for avoiding
fallback match
platform/chrome: cros_usbpd_notify: provide ID table for avoiding
fallback match
platform/chrome: cros_ec_chardev: provide ID table for avoiding
fallback match
platform/chrome: cros_ec_debugfs: provide ID table for avoiding
fallback match
platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback
match
power: supply: cros_pchg: provide ID table for avoiding fallback match platform/chrome: cros_ec_lightbar: provide ID table for avoiding
fallback match
platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback
match
platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding
fallback match
platform/chrome: wilco_ec: telemetry: provide ID table for avoiding
fallback match
platform/chrome: wilco_ec: debugfs: provide ID table for avoiding
fallback match
platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS platform/chrome/wilco_ec: core: provide ID table for avoiding fallback
match

 drivers/gpio/gpio-cros-ec.c                      |  8 ++++++++
 drivers/media/cec/platform/cros-ec/cros-ec-cec.c |  9 ++++++++-
 drivers/platform/chrome/cros_ec_chardev.c        |  9 ++++++++-
 drivers/platform/chrome/cros_ec_debugfs.c        |  9 ++++++++-
 drivers/platform/chrome/cros_ec_lightbar.c       |  9 ++++++++-
 drivers/platform/chrome/cros_ec_sensorhub.c      |  9 ++++++++-
 drivers/platform/chrome/cros_ec_sysfs.c          |  9 ++++++++-
 drivers/platform/chrome/cros_ec_vbc.c            |  9 ++++++++-
 drivers/platform/chrome/cros_kbd_led_backlight.c | 11 +++++++++--
 drivers/platform/chrome/cros_usbpd_logger.c      |  9 ++++++++-
 drivers/platform/chrome/cros_usbpd_notify.c      |  9 ++++++++-
 drivers/platform/chrome/wilco_ec/core.c          |  9 ++++++++-
 drivers/platform/chrome/wilco_ec/debugfs.c       |  9 ++++++++-
 drivers/platform/chrome/wilco_ec/event.c         |  1 -
 drivers/platform/chrome/wilco_ec/telemetry.c     |  9 ++++++++-
 drivers/power/supply/cros_peripheral_charger.c   | 11 +++++++++--
 drivers/power/supply/cros_usbpd-charger.c        | 11 +++++++++--
 drivers/rtc/rtc-cros-ec.c                        |  9 ++++++++-
 18 files changed, 139 insertions(+), 20 deletions(-)
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#1 lore raw

PATCH 1/18 media: platform: 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

---
 drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/media/cec/platform/cros-ec/cros-ec-cec.c +8 -1
index 48ed2993d2f0..8fbbb4091455 100644
@@ -8,6 +8,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/dmi.h>
 #include <linux/pci.h>
@@ -573,6 +574,12 @@ static void cros_ec_cec_remove(struct platform_device *pdev)
 	}
 }
 
+static const struct platform_device_id cros_ec_cec_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_cec_id);
+
 static struct platform_driver cros_ec_cec_driver = {
 	.probe = cros_ec_cec_probe,
 	.remove_new = cros_ec_cec_remove,
@@ -580,6 +587,7 @@ static struct platform_driver cros_ec_cec_driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_cec_pm_ops,
 	},
+	.id_table = cros_ec_cec_id,
 };
 
 module_platform_driver(cros_ec_cec_driver);
@@ -587,4 +595,3 @@ module_platform_driver(cros_ec_cec_driver);
 MODULE_DESCRIPTION("CEC driver for ChromeOS ECs");
 MODULE_AUTHOR("Neil Armstrong <[email protected]>");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 1/18
#3 lore raw

Re: [PATCH 01/18] media: platform: cros-ec: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 46 lines
---
 drivers/media/cec/platform/cros-ec/cros-ec-cec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/media/cec/platform/cros-ec/cros-ec-cec.c +8 -1
index 48ed2993d2f0..8fbbb4091455 100644
@@ -8,6 +8,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/dmi.h>
 #include <linux/pci.h>
@@ -573,6 +574,12 @@ static void cros_ec_cec_remove(struct platform_device *pdev)
 	}
 }
 
+static const struct platform_device_id cros_ec_cec_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_cec_id);
+
 static struct platform_driver cros_ec_cec_driver = {
 	.probe = cros_ec_cec_probe,
 	.remove_new = cros_ec_cec_remove,
@@ -580,6 +587,7 @@ static struct platform_driver cros_ec_cec_driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_cec_pm_ops,
 	},
+	.id_table = cros_ec_cec_id,
 };
 
 module_platform_driver(cros_ec_cec_driver);
@@ -587,4 +595,3 @@ module_platform_driver(cros_ec_cec_driver);
 MODULE_DESCRIPTION("CEC driver for ChromeOS ECs");
 MODULE_AUTHOR("Neil Armstrong <[email protected]>");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#4 lore raw

PATCH 2/18 gpio: cros-ec: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match. Also allow automatic module loading by adding MODULE_DEVICE_TABLE().

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353

---
 drivers/gpio/gpio-cros-ec.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpio/gpio-cros-ec.c +8 -0
index 842e1c060414..0c09bb54dc0c 100644
@@ -12,6 +12,7 @@
 #include <linux/errno.h>
 #include <linux/gpio/driver.h>
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -197,11 +198,18 @@ static int cros_ec_gpio_probe(struct platform_device *pdev)
 	return devm_gpiochip_add_data(dev, gc, cros_ec);
 }
 
+static const struct platform_device_id cros_ec_gpio_id[] = {
+	{ "cros-ec-gpio", 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_gpio_id);
+
 static struct platform_driver cros_ec_gpio_driver = {
 	.probe = cros_ec_gpio_probe,
 	.driver = {
 		.name = "cros-ec-gpio",
 	},
+	.id_table = cros_ec_gpio_id,
 };
 module_platform_driver(cros_ec_gpio_driver);
 
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 2/18
#5 lore raw

Re: [PATCH 02/18] gpio: cros-ec: provide ID table for avoiding fallback match

Quoted 8 lines · Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match. Also allow automatic module loading by adding MODULE_DEVICE_TABLE().

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353

---

Best regards,
Krzysztof

Reviewed-by on v1 2/18
#6 lore raw

Re: [PATCH 02/18] gpio: cros-ec: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 7 lines · Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match. Also allow automatic module loading by adding MODULE_DEVICE_TABLE().

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353

Quoted 38 lines
---
 drivers/gpio/gpio-cros-ec.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/gpio/gpio-cros-ec.c +8 -0
index 842e1c060414..0c09bb54dc0c 100644
@@ -12,6 +12,7 @@
 #include <linux/errno.h>
 #include <linux/gpio/driver.h>
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -197,11 +198,18 @@ static int cros_ec_gpio_probe(struct platform_device *pdev)
 	return devm_gpiochip_add_data(dev, gc, cros_ec);
 }
 
+static const struct platform_device_id cros_ec_gpio_id[] = {
+	{ "cros-ec-gpio", 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_gpio_id);
+
 static struct platform_driver cros_ec_gpio_driver = {
 	.probe = cros_ec_gpio_probe,
 	.driver = {
 		.name = "cros-ec-gpio",
 	},
+	.id_table = cros_ec_gpio_id,
 };
 module_platform_driver(cros_ec_gpio_driver);
 
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Acked-by on v1 2/18
#7 lore raw

Re: [PATCH 02/18] gpio: cros-ec: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 7 lines · Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match. Also allow automatic module loading by adding MODULE_DEVICE_TABLE().

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353

Yours,
Linus Walleij

author maintainer
#8 lore raw

PATCH 3/18 rtc: cros-ec: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/rtc/rtc-cros-ec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/rtc/rtc-cros-ec.c +8 -1
index 0cd397c04ff0..f57462c7b2c6 100644
@@ -5,6 +5,7 @@
 // Author: Stephen Barber <[email protected]>
 
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -392,6 +393,12 @@ static void cros_ec_rtc_remove(struct platform_device *pdev)
 		dev_err(dev, "failed to unregister notifier\n");
 }
 
+static const struct platform_device_id cros_ec_rtc_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
+
 static struct platform_driver cros_ec_rtc_driver = {
 	.probe = cros_ec_rtc_probe,
 	.remove_new = cros_ec_rtc_remove,
@@ -399,6 +406,7 @@ static struct platform_driver cros_ec_rtc_driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_rtc_pm_ops,
 	},
+	.id_table = cros_ec_rtc_id,
 };
 
 module_platform_driver(cros_ec_rtc_driver);
@@ -406,4 +414,3 @@ module_platform_driver(cros_ec_rtc_driver);
 MODULE_DESCRIPTION("RTC driver for Chrome OS ECs");
 MODULE_AUTHOR("Stephen Barber <[email protected]>");
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
maintainer Applied
#10 lore raw

Re: (subset) [PATCH 03/18] rtc: cros-ec: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Applied, thanks!

[03/18] rtc: cros-ec: provide ID table for avoiding fallback match

        https://git.kernel.org/abelloni/c/61c86d14745d

Best regards,

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
Reviewed-by on v1 3/18
#11 lore raw

Re: [PATCH 03/18] rtc: cros-ec: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 46 lines
---
 drivers/rtc/rtc-cros-ec.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/rtc/rtc-cros-ec.c +8 -1
index 0cd397c04ff0..f57462c7b2c6 100644
@@ -5,6 +5,7 @@
 // Author: Stephen Barber <[email protected]>
 
 #include <linux/kernel.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -392,6 +393,12 @@ static void cros_ec_rtc_remove(struct platform_device *pdev)
 		dev_err(dev, "failed to unregister notifier\n");
 }
 
+static const struct platform_device_id cros_ec_rtc_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_rtc_id);
+
 static struct platform_driver cros_ec_rtc_driver = {
 	.probe = cros_ec_rtc_probe,
 	.remove_new = cros_ec_rtc_remove,
@@ -399,6 +406,7 @@ static struct platform_driver cros_ec_rtc_driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_rtc_pm_ops,
 	},
+	.id_table = cros_ec_rtc_id,
 };
 
 module_platform_driver(cros_ec_rtc_driver);
@@ -406,4 +414,3 @@ module_platform_driver(cros_ec_rtc_driver);
 MODULE_DESCRIPTION("RTC driver for Chrome OS ECs");
 MODULE_AUTHOR("Stephen Barber <[email protected]>");
 MODULE_LICENSE("GPL v2");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#12 lore raw

PATCH 4/18 platform/chrome: cros_ec_sensorhub: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_sensorhub.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_sensorhub.c +8 -1
index 31fb8bdaad5a..50cdae67fa32 100644
@@ -8,6 +8,7 @@
 
 #include <linux/init.h>
 #include <linux/device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -247,17 +248,23 @@ static SIMPLE_DEV_PM_OPS(cros_ec_sensorhub_pm_ops,
 		cros_ec_sensorhub_suspend,
 		cros_ec_sensorhub_resume);
 
+static const struct platform_device_id cros_ec_sensorhub_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_sensorhub_id);
+
 static struct platform_driver cros_ec_sensorhub_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_sensorhub_pm_ops,
 	},
 	.probe = cros_ec_sensorhub_probe,
+	.id_table = cros_ec_sensorhub_id,
 };
 
 module_platform_driver(cros_ec_sensorhub_driver);
 
-MODULE_ALIAS("platform:" DRV_NAME);
 MODULE_AUTHOR("Gwendal Grignou <[email protected]>");
 MODULE_DESCRIPTION("ChromeOS EC MEMS Sensor Hub Driver");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 4/18
#14 lore raw

Re: [PATCH 04/18] platform/chrome: cros_ec_sensorhub: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 45 lines
---
 drivers/platform/chrome/cros_ec_sensorhub.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_sensorhub.c +8 -1
index 31fb8bdaad5a..50cdae67fa32 100644
@@ -8,6 +8,7 @@
 
 #include <linux/init.h>
 #include <linux/device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -247,17 +248,23 @@ static SIMPLE_DEV_PM_OPS(cros_ec_sensorhub_pm_ops,
 		cros_ec_sensorhub_suspend,
 		cros_ec_sensorhub_resume);
 
+static const struct platform_device_id cros_ec_sensorhub_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_sensorhub_id);
+
 static struct platform_driver cros_ec_sensorhub_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &cros_ec_sensorhub_pm_ops,
 	},
 	.probe = cros_ec_sensorhub_probe,
+	.id_table = cros_ec_sensorhub_id,
 };
 
 module_platform_driver(cros_ec_sensorhub_driver);
 
-MODULE_ALIAS("platform:" DRV_NAME);
 MODULE_AUTHOR("Gwendal Grignou <[email protected]>");
 MODULE_DESCRIPTION("ChromeOS EC MEMS Sensor Hub Driver");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#15 lore raw

PATCH 5/18 power: supply: cros_usbpd: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/power/supply/cros_usbpd-charger.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/power/supply/cros_usbpd-charger.c +9 -2
index b6c96376776a..8008e31c0c09 100644
@@ -5,6 +5,7 @@
  * Copyright (c) 2014 - 2018 Google, Inc
  */
 
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -711,16 +712,22 @@ static int cros_usbpd_charger_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL,
 			 cros_usbpd_charger_resume);
 
+static const struct platform_device_id cros_usbpd_charger_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_usbpd_charger_id);
+
 static struct platform_driver cros_usbpd_charger_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &cros_usbpd_charger_pm_ops,
 	},
-	.probe = cros_usbpd_charger_probe
+	.probe = cros_usbpd_charger_probe,
+	.id_table = cros_usbpd_charger_id,
 };
 
 module_platform_driver(cros_usbpd_charger_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("ChromeOS EC USBPD charger");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 5/18
#16 lore raw

Re: [PATCH 05/18] power: supply: cros_usbpd: provide ID table for avoiding fallback match

Quoted 6 lines · Tzung-Bi Shih

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

You could add everywhere:

but I also don't mind if that's skipped. Up to you folks.

Thanks for the changes.

Best regards,
Krzysztof

Reviewed-by on v1 5/18
#17 lore raw

Re: [PATCH 05/18] power: supply: cros_usbpd: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 44 lines
---
 drivers/power/supply/cros_usbpd-charger.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/power/supply/cros_usbpd-charger.c +9 -2
index b6c96376776a..8008e31c0c09 100644
@@ -5,6 +5,7 @@
  * Copyright (c) 2014 - 2018 Google, Inc
  */
 
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -711,16 +712,22 @@ static int cros_usbpd_charger_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_usbpd_charger_pm_ops, NULL,
 			 cros_usbpd_charger_resume);
 
+static const struct platform_device_id cros_usbpd_charger_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_usbpd_charger_id);
+
 static struct platform_driver cros_usbpd_charger_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &cros_usbpd_charger_pm_ops,
 	},
-	.probe = cros_usbpd_charger_probe
+	.probe = cros_usbpd_charger_probe,
+	.id_table = cros_usbpd_charger_id,
 };
 
 module_platform_driver(cros_usbpd_charger_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("ChromeOS EC USBPD charger");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#19 lore raw

PATCH 6/18 platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_usbpd_logger.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_usbpd_logger.c +8 -1
index f618757f8b32..930c2f47269f 100644
@@ -7,6 +7,7 @@
 
 #include <linux/ktime.h>
 #include <linux/math64.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -249,6 +250,12 @@ static int __maybe_unused cros_usbpd_logger_suspend(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_usbpd_logger_pm_ops, cros_usbpd_logger_suspend,
 			 cros_usbpd_logger_resume);
 
+static const struct platform_device_id cros_usbpd_logger_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_usbpd_logger_id);
+
 static struct platform_driver cros_usbpd_logger_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -256,10 +263,10 @@ static struct platform_driver cros_usbpd_logger_driver = {
 	},
 	.probe = cros_usbpd_logger_probe,
 	.remove_new = cros_usbpd_logger_remove,
+	.id_table = cros_usbpd_logger_id,
 };
 
 module_platform_driver(cros_usbpd_logger_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Logging driver for ChromeOS EC USBPD Charger.");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 6/18
#21 lore raw

Re: [PATCH 06/18] platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 45 lines
---
 drivers/platform/chrome/cros_usbpd_logger.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_usbpd_logger.c +8 -1
index f618757f8b32..930c2f47269f 100644
@@ -7,6 +7,7 @@
 
 #include <linux/ktime.h>
 #include <linux/math64.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -249,6 +250,12 @@ static int __maybe_unused cros_usbpd_logger_suspend(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_usbpd_logger_pm_ops, cros_usbpd_logger_suspend,
 			 cros_usbpd_logger_resume);
 
+static const struct platform_device_id cros_usbpd_logger_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_usbpd_logger_id);
+
 static struct platform_driver cros_usbpd_logger_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -256,10 +263,10 @@ static struct platform_driver cros_usbpd_logger_driver = {
 	},
 	.probe = cros_usbpd_logger_probe,
 	.remove_new = cros_usbpd_logger_remove,
+	.id_table = cros_usbpd_logger_id,
 };
 
 module_platform_driver(cros_usbpd_logger_driver);
 
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Logging driver for ChromeOS EC USBPD Charger.");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#22 lore raw

PATCH 7/18 platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_usbpd_notify.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_usbpd_notify.c +8 -1
index aacad022f21d..c83f81d86483 100644
@@ -6,6 +6,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_proto.h>
 #include <linux/platform_data/cros_usbpd_notify.h>
@@ -218,12 +219,19 @@ static void cros_usbpd_notify_remove_plat(struct platform_device *pdev)
 					   &pdnotify->nb);
 }
 
+static const struct platform_device_id cros_usbpd_notify_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_usbpd_notify_id);
+
 static struct platform_driver cros_usbpd_notify_plat_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_usbpd_notify_probe_plat,
 	.remove_new = cros_usbpd_notify_remove_plat,
+	.id_table = cros_usbpd_notify_id,
 };
 
 static int __init cros_usbpd_notify_init(void)
@@ -258,4 +266,3 @@ module_exit(cros_usbpd_notify_exit);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("ChromeOS power delivery notifier device");
 MODULE_AUTHOR("Jon Flatley <[email protected]>");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 7/18
#24 lore raw

Re: [PATCH 07/18] platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 45 lines
---
 drivers/platform/chrome/cros_usbpd_notify.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_usbpd_notify.c +8 -1
index aacad022f21d..c83f81d86483 100644
@@ -6,6 +6,7 @@
  */
 
 #include <linux/acpi.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_proto.h>
 #include <linux/platform_data/cros_usbpd_notify.h>
@@ -218,12 +219,19 @@ static void cros_usbpd_notify_remove_plat(struct platform_device *pdev)
 					   &pdnotify->nb);
 }
 
+static const struct platform_device_id cros_usbpd_notify_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_usbpd_notify_id);
+
 static struct platform_driver cros_usbpd_notify_plat_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_usbpd_notify_probe_plat,
 	.remove_new = cros_usbpd_notify_remove_plat,
+	.id_table = cros_usbpd_notify_id,
 };
 
 static int __init cros_usbpd_notify_init(void)
@@ -258,4 +266,3 @@ module_exit(cros_usbpd_notify_exit);
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("ChromeOS power delivery notifier device");
 MODULE_AUTHOR("Jon Flatley <[email protected]>");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#26 lore raw

PATCH 8/18 platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_chardev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_chardev.c +8 -1
index 81950bb2c6da..7f034ead7ae4 100644
@@ -14,6 +14,7 @@
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/platform_data/cros_ec_chardev.h>
@@ -403,17 +404,23 @@ static void cros_ec_chardev_remove(struct platform_device *pdev)
 	misc_deregister(&data->misc);
 }
 
+static const struct platform_device_id cros_ec_chardev_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_chardev_id);
+
 static struct platform_driver cros_ec_chardev_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_ec_chardev_probe,
 	.remove_new = cros_ec_chardev_remove,
+	.id_table = cros_ec_chardev_id,
 };
 
 module_platform_driver(cros_ec_chardev_driver);
 
-MODULE_ALIAS("platform:" DRV_NAME);
 MODULE_AUTHOR("Enric Balletbo i Serra <[email protected]>");
 MODULE_DESCRIPTION("ChromeOS EC Miscellaneous Character Driver");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 8/18
#27 lore raw

Re: [PATCH 08/18] platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback match

Quoted 9 lines · Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_chardev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Best regards,
Krzysztof

Reviewed-by on v1 8/18
#28 lore raw

Re: [PATCH 08/18] platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 45 lines
---
 drivers/platform/chrome/cros_ec_chardev.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_chardev.c +8 -1
index 81950bb2c6da..7f034ead7ae4 100644
@@ -14,6 +14,7 @@
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/platform_data/cros_ec_chardev.h>
@@ -403,17 +404,23 @@ static void cros_ec_chardev_remove(struct platform_device *pdev)
 	misc_deregister(&data->misc);
 }
 
+static const struct platform_device_id cros_ec_chardev_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_chardev_id);
+
 static struct platform_driver cros_ec_chardev_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_ec_chardev_probe,
 	.remove_new = cros_ec_chardev_remove,
+	.id_table = cros_ec_chardev_id,
 };
 
 module_platform_driver(cros_ec_chardev_driver);
 
-MODULE_ALIAS("platform:" DRV_NAME);
 MODULE_AUTHOR("Enric Balletbo i Serra <[email protected]>");
 MODULE_DESCRIPTION("ChromeOS EC Miscellaneous Character Driver");
 MODULE_LICENSE("GPL");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#29 lore raw

PATCH 9/18 platform/chrome: cros_ec_debugfs: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_debugfs.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_debugfs.c +8 -1
index 6bf6f0e7b597..e1d313246beb 100644
@@ -7,6 +7,7 @@
 #include <linux/debugfs.h>
 #include <linux/delay.h>
 #include <linux/fs.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/platform_data/cros_ec_commands.h>
@@ -564,6 +565,12 @@ static int __maybe_unused cros_ec_debugfs_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_ec_debugfs_pm_ops,
 			 cros_ec_debugfs_suspend, cros_ec_debugfs_resume);
 
+static const struct platform_device_id cros_ec_debugfs_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_debugfs_id);
+
 static struct platform_driver cros_ec_debugfs_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -572,10 +579,10 @@ static struct platform_driver cros_ec_debugfs_driver = {
 	},
 	.probe = cros_ec_debugfs_probe,
 	.remove_new = cros_ec_debugfs_remove,
+	.id_table = cros_ec_debugfs_id,
 };
 
 module_platform_driver(cros_ec_debugfs_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Debug logs for ChromeOS EC");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 9/18
#31 lore raw

Re: [PATCH 09/18] platform/chrome: cros_ec_debugfs: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 45 lines
---
 drivers/platform/chrome/cros_ec_debugfs.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_debugfs.c +8 -1
index 6bf6f0e7b597..e1d313246beb 100644
@@ -7,6 +7,7 @@
 #include <linux/debugfs.h>
 #include <linux/delay.h>
 #include <linux/fs.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/platform_data/cros_ec_commands.h>
@@ -564,6 +565,12 @@ static int __maybe_unused cros_ec_debugfs_resume(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_ec_debugfs_pm_ops,
 			 cros_ec_debugfs_suspend, cros_ec_debugfs_resume);
 
+static const struct platform_device_id cros_ec_debugfs_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_debugfs_id);
+
 static struct platform_driver cros_ec_debugfs_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -572,10 +579,10 @@ static struct platform_driver cros_ec_debugfs_driver = {
 	},
 	.probe = cros_ec_debugfs_probe,
 	.remove_new = cros_ec_debugfs_remove,
+	.id_table = cros_ec_debugfs_id,
 };
 
 module_platform_driver(cros_ec_debugfs_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Debug logs for ChromeOS EC");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#32 lore raw

PATCH 10/18 platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_sysfs.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_sysfs.c +8 -1
index 93e67ab4af06..9c944146ee50 100644
@@ -8,6 +8,7 @@
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/kobject.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -347,16 +348,22 @@ static void cros_ec_sysfs_remove(struct platform_device *pd)
 	sysfs_remove_group(&ec_dev->class_dev.kobj, &cros_ec_attr_group);
 }
 
+static const struct platform_device_id cros_ec_sysfs_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_sysfs_id);
+
 static struct platform_driver cros_ec_sysfs_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_ec_sysfs_probe,
 	.remove_new = cros_ec_sysfs_remove,
+	.id_table = cros_ec_sysfs_id,
 };
 
 module_platform_driver(cros_ec_sysfs_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Expose the ChromeOS EC through sysfs");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 10/18
#34 lore raw

Re: [PATCH 10/18] platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 44 lines
---
 drivers/platform/chrome/cros_ec_sysfs.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_sysfs.c +8 -1
index 93e67ab4af06..9c944146ee50 100644
@@ -8,6 +8,7 @@
 #include <linux/device.h>
 #include <linux/fs.h>
 #include <linux/kobject.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -347,16 +348,22 @@ static void cros_ec_sysfs_remove(struct platform_device *pd)
 	sysfs_remove_group(&ec_dev->class_dev.kobj, &cros_ec_attr_group);
 }
 
+static const struct platform_device_id cros_ec_sysfs_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_sysfs_id);
+
 static struct platform_driver cros_ec_sysfs_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_ec_sysfs_probe,
 	.remove_new = cros_ec_sysfs_remove,
+	.id_table = cros_ec_sysfs_id,
 };
 
 module_platform_driver(cros_ec_sysfs_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Expose the ChromeOS EC through sysfs");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#35 lore raw

PATCH 11/18 power: supply: cros_pchg: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/power/supply/cros_peripheral_charger.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/power/supply/cros_peripheral_charger.c +9 -2
index a204f2355be4..d406f2a78449 100644
@@ -5,6 +5,7 @@
  * Copyright 2020 Google LLC.
  */
 
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/platform_data/cros_ec_commands.h>
@@ -367,16 +368,22 @@ static int __maybe_unused cros_pchg_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(cros_pchg_pm_ops, NULL, cros_pchg_resume);
 
+static const struct platform_device_id cros_pchg_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_pchg_id);
+
 static struct platform_driver cros_pchg_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &cros_pchg_pm_ops,
 	},
-	.probe = cros_pchg_probe
+	.probe = cros_pchg_probe,
+	.id_table = cros_pchg_id,
 };
 
 module_platform_driver(cros_pchg_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("ChromeOS EC peripheral device charger");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 11/18
#37 lore raw

Re: [PATCH 11/18] power: supply: cros_pchg: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 44 lines
---
 drivers/power/supply/cros_peripheral_charger.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/power/supply/cros_peripheral_charger.c +9 -2
index a204f2355be4..d406f2a78449 100644
@@ -5,6 +5,7 @@
  * Copyright 2020 Google LLC.
  */
 
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/notifier.h>
 #include <linux/platform_data/cros_ec_commands.h>
@@ -367,16 +368,22 @@ static int __maybe_unused cros_pchg_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(cros_pchg_pm_ops, NULL, cros_pchg_resume);
 
+static const struct platform_device_id cros_pchg_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_pchg_id);
+
 static struct platform_driver cros_pchg_driver = {
 	.driver = {
 		.name = DRV_NAME,
 		.pm = &cros_pchg_pm_ops,
 	},
-	.probe = cros_pchg_probe
+	.probe = cros_pchg_probe,
+	.id_table = cros_pchg_id,
 };
 
 module_platform_driver(cros_pchg_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("ChromeOS EC peripheral device charger");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#38 lore raw

PATCH 12/18 platform/chrome: cros_ec_lightbar: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_lightbar.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_lightbar.c +8 -1
index 6677cc6c4984..1e69f61115a4 100644
@@ -9,6 +9,7 @@
 #include <linux/fs.h>
 #include <linux/kobject.h>
 #include <linux/kstrtox.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -594,6 +595,12 @@ static int __maybe_unused cros_ec_lightbar_suspend(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_ec_lightbar_pm_ops,
 			 cros_ec_lightbar_suspend, cros_ec_lightbar_resume);
 
+static const struct platform_device_id cros_ec_lightbar_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_lightbar_id);
+
 static struct platform_driver cros_ec_lightbar_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -602,10 +609,10 @@ static struct platform_driver cros_ec_lightbar_driver = {
 	},
 	.probe = cros_ec_lightbar_probe,
 	.remove_new = cros_ec_lightbar_remove,
+	.id_table = cros_ec_lightbar_id,
 };
 
 module_platform_driver(cros_ec_lightbar_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Expose the Chromebook Pixel's lightbar to userspace");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 12/18
#40 lore raw

Re: [PATCH 12/18] platform/chrome: cros_ec_lightbar: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 45 lines
---
 drivers/platform/chrome/cros_ec_lightbar.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_lightbar.c +8 -1
index 6677cc6c4984..1e69f61115a4 100644
@@ -9,6 +9,7 @@
 #include <linux/fs.h>
 #include <linux/kobject.h>
 #include <linux/kstrtox.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -594,6 +595,12 @@ static int __maybe_unused cros_ec_lightbar_suspend(struct device *dev)
 static SIMPLE_DEV_PM_OPS(cros_ec_lightbar_pm_ops,
 			 cros_ec_lightbar_suspend, cros_ec_lightbar_resume);
 
+static const struct platform_device_id cros_ec_lightbar_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_lightbar_id);
+
 static struct platform_driver cros_ec_lightbar_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -602,10 +609,10 @@ static struct platform_driver cros_ec_lightbar_driver = {
 	},
 	.probe = cros_ec_lightbar_probe,
 	.remove_new = cros_ec_lightbar_remove,
+	.id_table = cros_ec_lightbar_id,
 };
 
 module_platform_driver(cros_ec_lightbar_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Expose the Chromebook Pixel's lightbar to userspace");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#41 lore raw

PATCH 13/18 platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_vbc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_vbc.c +8 -1
index 274ea0c64b33..787a19db4911 100644
@@ -6,6 +6,7 @@
 
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -133,16 +134,22 @@ static void cros_ec_vbc_remove(struct platform_device *pd)
 			   &cros_ec_vbc_attr_group);
 }
 
+static const struct platform_device_id cros_ec_vbc_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_vbc_id);
+
 static struct platform_driver cros_ec_vbc_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_ec_vbc_probe,
 	.remove_new = cros_ec_vbc_remove,
+	.id_table = cros_ec_vbc_id,
 };
 
 module_platform_driver(cros_ec_vbc_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Expose the vboot context nvram to userspace");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 13/18
#42 lore raw

Re: [PATCH 13/18] platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback match

Quoted 8 lines · Tzung-Bi Shih

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

---
 drivers/platform/chrome/cros_ec_vbc.c | 9 ++++++++-

Best regards,
Krzysztof

Reviewed-by on v1 13/18
#43 lore raw

Re: [PATCH 13/18] platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 44 lines
---
 drivers/platform/chrome/cros_ec_vbc.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/cros_ec_vbc.c +8 -1
index 274ea0c64b33..787a19db4911 100644
@@ -6,6 +6,7 @@
 
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/cros_ec_commands.h>
 #include <linux/platform_data/cros_ec_proto.h>
@@ -133,16 +134,22 @@ static void cros_ec_vbc_remove(struct platform_device *pd)
 			   &cros_ec_vbc_attr_group);
 }
 
+static const struct platform_device_id cros_ec_vbc_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, cros_ec_vbc_id);
+
 static struct platform_driver cros_ec_vbc_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = cros_ec_vbc_probe,
 	.remove_new = cros_ec_vbc_remove,
+	.id_table = cros_ec_vbc_id,
 };
 
 module_platform_driver(cros_ec_vbc_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("Expose the vboot context nvram to userspace");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#44 lore raw

PATCH 14/18 platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match.

Also shrink the name for fitting to [2].

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353
[2]: https://elixir.bootlin.com/linux/v6.8/source/include/linux/mod_devicetable.h#L608

---
 drivers/platform/chrome/cros_kbd_led_backlight.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/platform/chrome/cros_kbd_led_backlight.c +9 -2
index 793fd3f1015d..b83e4f328620 100644
@@ -9,6 +9,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_data/cros_ec_commands.h>
@@ -247,17 +248,23 @@ static const struct of_device_id keyboard_led_of_match[] = {
 MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
 #endif
 
+static const struct platform_device_id keyboard_led_id[] = {
+	{ "cros-keyboard-leds", 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, keyboard_led_id);
+
 static struct platform_driver keyboard_led_driver = {
 	.driver		= {
-		.name	= "chromeos-keyboard-leds",
+		.name	= "cros-keyboard-leds",
 		.acpi_match_table = ACPI_PTR(keyboard_led_acpi_match),
 		.of_match_table = of_match_ptr(keyboard_led_of_match),
 	},
 	.probe		= keyboard_led_probe,
+	.id_table	= keyboard_led_id,
 };
 module_platform_driver(keyboard_led_driver);
 
 MODULE_AUTHOR("Simon Que <[email protected]>");
 MODULE_DESCRIPTION("ChromeOS Keyboard backlight LED Driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:chromeos-keyboard-leds");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
#45 lore raw

Re: [PATCH 14/18] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match

Quoted 8 lines · Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match.

Also shrink the name for fitting to [2].

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353
[2]: https://elixir.bootlin.com/linux/v6.8/source/include/linux/mod_devicetable.h#L608

I think this should be two commits, where the first one is a fix (Fixes tag) for the size of name.

Best regards,
Krzysztof

author maintainer
#46 lore raw

Re: [PATCH 14/18] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match

Quoted 4 lines · Krzysztof Kozlowski
Quoted 3 lines · Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match.

Quoted 8 lines
Quoted 5 lines

Also shrink the name for fitting to [2].

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353
[2]: https://elixir.bootlin.com/linux/v6.8/source/include/linux/mod_devicetable.h#L608

I think this should be two commits, where the first one is a fix (Fixes tag) for the size of name.

Splitted to 2 commits in v2[3]. It doesn't include a Fixes tag as the compiler complaints the oversize only if putting the original driver name to struct platform_device_id.

[3]: https://patchwork.kernel.org/project/chrome-platform/patch/[email protected]/

Reviewed-by on v1 14/18
#47 lore raw

Re: [PATCH 14/18] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 9 lines · Tzung-Bi Shih

Instead of using fallback driver name match, provide ID table[1] for the primary match.

Also shrink the name for fitting to [2].

[1]: https://elixir.bootlin.com/linux/v6.8/source/drivers/base/platform.c#L1353
[2]: https://elixir.bootlin.com/linux/v6.8/source/include/linux/mod_devicetable.h#L608

Quoted 46 lines
---
 drivers/platform/chrome/cros_kbd_led_backlight.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/platform/chrome/cros_kbd_led_backlight.c +9 -2
index 793fd3f1015d..b83e4f328620 100644
@@ -9,6 +9,7 @@
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/leds.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/platform_data/cros_ec_commands.h>
@@ -247,17 +248,23 @@ static const struct of_device_id keyboard_led_of_match[] = {
 MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
 #endif
 
+static const struct platform_device_id keyboard_led_id[] = {
+	{ "cros-keyboard-leds", 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, keyboard_led_id);
+
 static struct platform_driver keyboard_led_driver = {
 	.driver		= {
-		.name	= "chromeos-keyboard-leds",
+		.name	= "cros-keyboard-leds",
 		.acpi_match_table = ACPI_PTR(keyboard_led_acpi_match),
 		.of_match_table = of_match_ptr(keyboard_led_of_match),
 	},
 	.probe		= keyboard_led_probe,
+	.id_table	= keyboard_led_id,
 };
 module_platform_driver(keyboard_led_driver);
 
 MODULE_AUTHOR("Simon Que <[email protected]>");
 MODULE_DESCRIPTION("ChromeOS Keyboard backlight LED Driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:chromeos-keyboard-leds");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#48 lore raw

PATCH 15/18 platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/wilco_ec/telemetry.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/wilco_ec/telemetry.c +8 -1
index b7c616f3d179..21d4cbbb009a 100644
@@ -30,6 +30,7 @@
 #include <linux/cdev.h>
 #include <linux/device.h>
 #include <linux/fs.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/platform_device.h>
@@ -409,12 +410,19 @@ static void telem_device_remove(struct platform_device *pdev)
 	put_device(&dev_data->dev);
 }
 
+static const struct platform_device_id telem_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, telem_id);
+
 static struct platform_driver telem_driver = {
 	.probe = telem_device_probe,
 	.remove_new = telem_device_remove,
 	.driver = {
 		.name = DRV_NAME,
 	},
+	.id_table = telem_id,
 };
 
 static int __init telem_module_init(void)
@@ -466,4 +474,3 @@ module_exit(telem_module_exit);
 MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_DESCRIPTION("Wilco EC telemetry driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 15/18
#49 lore raw

Re: [PATCH 15/18] platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match

Quoted 6 lines · Tzung-Bi Shih

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

Best regards,
Krzysztof

Reviewed-by on v1 15/18
#50 lore raw

Re: [PATCH 15/18] platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 45 lines
---
 drivers/platform/chrome/wilco_ec/telemetry.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/wilco_ec/telemetry.c +8 -1
index b7c616f3d179..21d4cbbb009a 100644
@@ -30,6 +30,7 @@
 #include <linux/cdev.h>
 #include <linux/device.h>
 #include <linux/fs.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/platform_device.h>
@@ -409,12 +410,19 @@ static void telem_device_remove(struct platform_device *pdev)
 	put_device(&dev_data->dev);
 }
 
+static const struct platform_device_id telem_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, telem_id);
+
 static struct platform_driver telem_driver = {
 	.probe = telem_device_probe,
 	.remove_new = telem_device_remove,
 	.driver = {
 		.name = DRV_NAME,
 	},
+	.id_table = telem_id,
 };
 
 static int __init telem_module_init(void)
@@ -466,4 +474,3 @@ module_exit(telem_module_exit);
 MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_DESCRIPTION("Wilco EC telemetry driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#51 lore raw

PATCH 16/18 platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/wilco_ec/debugfs.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/wilco_ec/debugfs.c +8 -1
index 93c11f81ca45..983f2fa44ba5 100644
@@ -10,6 +10,7 @@
 #include <linux/ctype.h>
 #include <linux/debugfs.h>
 #include <linux/fs.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/platform_device.h>
@@ -265,17 +266,23 @@ static void wilco_ec_debugfs_remove(struct platform_device *pdev)
 	debugfs_remove_recursive(debug_info->dir);
 }
 
+static const struct platform_device_id wilco_ec_debugfs_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, wilco_ec_debugfs_id);
+
 static struct platform_driver wilco_ec_debugfs_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = wilco_ec_debugfs_probe,
 	.remove_new = wilco_ec_debugfs_remove,
+	.id_table = wilco_ec_debugfs_id,
 };
 
 module_platform_driver(wilco_ec_debugfs_driver);
 
-MODULE_ALIAS("platform:" DRV_NAME);
 MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Wilco EC debugfs driver");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 16/18
#52 lore raw

Re: [PATCH 16/18] platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback match

Quoted 7 lines · Tzung-Bi Shih

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

---

Best regards,
Krzysztof

Reviewed-by on v1 16/18
#53 lore raw

Re: [PATCH 16/18] platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 44 lines
---
 drivers/platform/chrome/wilco_ec/debugfs.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/wilco_ec/debugfs.c +8 -1
index 93c11f81ca45..983f2fa44ba5 100644
@@ -10,6 +10,7 @@
 #include <linux/ctype.h>
 #include <linux/debugfs.h>
 #include <linux/fs.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/platform_device.h>
@@ -265,17 +266,23 @@ static void wilco_ec_debugfs_remove(struct platform_device *pdev)
 	debugfs_remove_recursive(debug_info->dir);
 }
 
+static const struct platform_device_id wilco_ec_debugfs_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, wilco_ec_debugfs_id);
+
 static struct platform_driver wilco_ec_debugfs_driver = {
 	.driver = {
 		.name = DRV_NAME,
 	},
 	.probe = wilco_ec_debugfs_probe,
 	.remove_new = wilco_ec_debugfs_remove,
+	.id_table = wilco_ec_debugfs_id,
 };
 
 module_platform_driver(wilco_ec_debugfs_driver);
 
-MODULE_ALIAS("platform:" DRV_NAME);
 MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("Wilco EC debugfs driver");
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#54 lore raw

PATCH 17/18 platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS

In reply to Tzung-Bi Shih

There is no platform driver in the file. Remove the redundant MODULE_ALIAS().

---
 drivers/platform/chrome/wilco_ec/event.c | 1 -
 1 file changed, 1 deletion(-)
drivers/platform/chrome/wilco_ec/event.c +0 -1
index 13291fb4214e..49043c644572 100644
@@ -575,4 +575,3 @@ module_exit(event_module_exit);
 MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_DESCRIPTION("Wilco EC ACPI event driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 17/18
#55 lore raw

Re: [PATCH 17/18] platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS

Quoted 13 lines · Tzung-Bi Shih

There is no platform driver in the file. Remove the redundant MODULE_ALIAS().

---
 drivers/platform/chrome/wilco_ec/event.c | 1 -
 1 file changed, 1 deletion(-)
drivers/platform/chrome/wilco_ec/event.c +0 -0
index 13291fb4214e..49043c644572 100644

drivers/platform/chrome/wilco_ec/event.c module_exit(event_module_exit); · line 578

Quoted 4 lines
drivers/platform/chrome/wilco_ec/event.c +0 -1
@@ -575,4 +575,3 @@ module_exit(event_module_exit);
 MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_DESCRIPTION("Wilco EC ACPI event driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);

In this case some sort of alias, maybe not necessarily platform, could have sense. I see there ACPI ID table, so it is fine for me.

Best regards,
Krzysztof

Reviewed-by on v1 17/18
#56 lore raw

Re: [PATCH 17/18] platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS

In reply to Tzung-Bi Shih
Quoted 4 lines · Tzung-Bi Shih

There is no platform driver in the file. Remove the redundant MODULE_ALIAS().

Quoted 17 lines
---
 drivers/platform/chrome/wilco_ec/event.c | 1 -
 1 file changed, 1 deletion(-)
drivers/platform/chrome/wilco_ec/event.c +0 -1
index 13291fb4214e..49043c644572 100644
@@ -575,4 +575,3 @@ module_exit(event_module_exit);
 MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_DESCRIPTION("Wilco EC ACPI event driver");
 MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
author maintainer
#57 lore raw

PATCH 18/18 platform/chrome/wilco_ec: core: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih

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

---
 drivers/platform/chrome/wilco_ec/core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/wilco_ec/core.c +8 -1
index 9b59a1bed286..3e6b6cd81a9b 100644
@@ -10,6 +10,7 @@
 #include <linux/acpi.h>
 #include <linux/device.h>
 #include <linux/ioport.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/platform_device.h>
@@ -150,6 +151,12 @@ static const struct acpi_device_id wilco_ec_acpi_device_ids[] = {
 };
 MODULE_DEVICE_TABLE(acpi, wilco_ec_acpi_device_ids);
 
+static const struct platform_device_id wilco_ec_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, wilco_ec_id);
+
 static struct platform_driver wilco_ec_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -157,6 +164,7 @@ static struct platform_driver wilco_ec_driver = {
 	},
 	.probe = wilco_ec_probe,
 	.remove_new = wilco_ec_remove,
+	.id_table = wilco_ec_id,
 };
 
 module_platform_driver(wilco_ec_driver);
@@ -165,4 +173,3 @@ MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_AUTHOR("Duncan Laurie <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("ChromeOS Wilco Embedded Controller driver");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
Reviewed-by on v1 18/18
#59 lore raw

Re: [PATCH 18/18] platform/chrome/wilco_ec: core: provide ID table for avoiding fallback match

In reply to Tzung-Bi Shih
Quoted 6 lines · Tzung-Bi Shih

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

Quoted 46 lines
---
 drivers/platform/chrome/wilco_ec/core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/chrome/wilco_ec/core.c +8 -1
index 9b59a1bed286..3e6b6cd81a9b 100644
@@ -10,6 +10,7 @@
 #include <linux/acpi.h>
 #include <linux/device.h>
 #include <linux/ioport.h>
+#include <linux/mod_devicetable.h>
 #include <linux/module.h>
 #include <linux/platform_data/wilco-ec.h>
 #include <linux/platform_device.h>
@@ -150,6 +151,12 @@ static const struct acpi_device_id wilco_ec_acpi_device_ids[] = {
 };
 MODULE_DEVICE_TABLE(acpi, wilco_ec_acpi_device_ids);
 
+static const struct platform_device_id wilco_ec_id[] = {
+	{ DRV_NAME, 0 },
+	{}
+};
+MODULE_DEVICE_TABLE(platform, wilco_ec_id);
+
 static struct platform_driver wilco_ec_driver = {
 	.driver = {
 		.name = DRV_NAME,
@@ -157,6 +164,7 @@ static struct platform_driver wilco_ec_driver = {
 	},
 	.probe = wilco_ec_probe,
 	.remove_new = wilco_ec_remove,
+	.id_table = wilco_ec_id,
 };
 
 module_platform_driver(wilco_ec_driver);
@@ -165,4 +173,3 @@ MODULE_AUTHOR("Nick Crews <[email protected]>");
 MODULE_AUTHOR("Duncan Laurie <[email protected]>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("ChromeOS Wilco Embedded Controller driver");
-MODULE_ALIAS("platform:" DRV_NAME);
Signature · 1 line
2.44.0.478.gd926399ef9-goog
#60 lore raw
In reply to Tzung-Bi Shih
This series was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Hello:

This series was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Fri, 29 Mar 2024 15:56:12 +0800 you wrote:

Inspired by [1]. Turn all MODULE_ALIAS() in ChromeOS EC platform drivers into proper platform_device_id table and MODULE_DEVICE_TABLE().

The series is basically looking for drivers from:
- struct mfd_cell in drivers/mfd/cros_ec_dev.c.
- grep -R MODULE_ALIAS drivers/platform/chrome/.

[...]

Here is the summary with links:
- [01/18] media: platform: cros-ec: provide ID table for avoiding fallback match (no matching commit)
- [02/18] gpio: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [03/18] rtc: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [04/18] platform/chrome: cros_ec_sensorhub: provide ID table for avoiding fallback match

    https://git.kernel.org/chrome-platform/c/12e981d4d643
  - [05/18] power: supply: cros_usbpd: provide ID table for avoiding fallback match
    (no matching commit)
  - [06/18] platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/2b895835bd56
  - [07/18] platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/522b9910fa25
  - [08/18] platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/e4d063f262df
  - [09/18] platform/chrome: cros_ec_debugfs: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/e26205b5728f
  - [10/18] platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/6e92e7f792eb
  - [11/18] power: supply: cros_pchg: provide ID table for avoiding fallback match
    (no matching commit)
  - [12/18] platform/chrome: cros_ec_lightbar: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/4f6b823b5caa
  - [13/18] platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/883030dae2d2
  - [14/18] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match
    (no matching commit)
  - [15/18] platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/b17dd111645b
  - [16/18] platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/c0649ca22fe8
  - [17/18] platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS
    https://git.kernel.org/chrome-platform/c/fc87ba8e4525
  - [18/18] platform/chrome/wilco_ec: core: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/d8db2c6d7b0e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#61 lore raw
In reply to Tzung-Bi Shih
This series was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Hello:

This series was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Fri, 29 Mar 2024 15:56:12 +0800 you wrote:

Inspired by [1]. Turn all MODULE_ALIAS() in ChromeOS EC platform drivers into proper platform_device_id table and MODULE_DEVICE_TABLE().

The series is basically looking for drivers from:
- struct mfd_cell in drivers/mfd/cros_ec_dev.c.
- grep -R MODULE_ALIAS drivers/platform/chrome/.

[...]

Here is the summary with links:
- [01/18] media: platform: cros-ec: provide ID table for avoiding fallback match (no matching commit)
- [02/18] gpio: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [03/18] rtc: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [04/18] platform/chrome: cros_ec_sensorhub: provide ID table for avoiding fallback match

    https://git.kernel.org/chrome-platform/c/12e981d4d643
  - [05/18] power: supply: cros_usbpd: provide ID table for avoiding fallback match
    (no matching commit)
  - [06/18] platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/2b895835bd56
  - [07/18] platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/522b9910fa25
  - [08/18] platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/e4d063f262df
  - [09/18] platform/chrome: cros_ec_debugfs: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/e26205b5728f
  - [10/18] platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/6e92e7f792eb
  - [11/18] power: supply: cros_pchg: provide ID table for avoiding fallback match
    (no matching commit)
  - [12/18] platform/chrome: cros_ec_lightbar: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/4f6b823b5caa
  - [13/18] platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/883030dae2d2
  - [14/18] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match
    (no matching commit)
  - [15/18] platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/b17dd111645b
  - [16/18] platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/c0649ca22fe8
  - [17/18] platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS
    https://git.kernel.org/chrome-platform/c/fc87ba8e4525
  - [18/18] platform/chrome/wilco_ec: core: provide ID table for avoiding fallback match
    https://git.kernel.org/chrome-platform/c/d8db2c6d7b0e

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#62 lore raw
In reply to Tzung-Bi Shih
This series was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Hello:

This series was applied to chrome-platform/linux.git (for-kernelci) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Fri, 29 Mar 2024 15:56:12 +0800 you wrote:

Inspired by [1]. Turn all MODULE_ALIAS() in ChromeOS EC platform drivers into proper platform_device_id table and MODULE_DEVICE_TABLE().

The series is basically looking for drivers from:
- struct mfd_cell in drivers/mfd/cros_ec_dev.c.
- grep -R MODULE_ALIAS drivers/platform/chrome/.

[...]

Here is the summary with links:
- [01/18] media: platform: cros-ec: provide ID table for avoiding fallback match (no matching commit)
- [02/18] gpio: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [03/18] rtc: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [04/18] platform/chrome: cros_ec_sensorhub: provide ID table for avoiding fallback match (no matching commit)
- [05/18] power: supply: cros_usbpd: provide ID table for avoiding fallback match (no matching commit)
- [06/18] platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback match (no matching commit)
- [07/18] platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback match (no matching commit)
- [08/18] platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback match (no matching commit)
- [09/18] platform/chrome: cros_ec_debugfs: provide ID table for avoiding fallback match (no matching commit)
- [10/18] platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback match (no matching commit)
- [11/18] power: supply: cros_pchg: provide ID table for avoiding fallback match (no matching commit)
- [12/18] platform/chrome: cros_ec_lightbar: provide ID table for avoiding fallback match (no matching commit)
- [13/18] platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback match (no matching commit)
- [14/18] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match

    https://git.kernel.org/chrome-platform/c/d91ca83599cd

- [15/18] platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match (no matching commit)
- [16/18] platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback match (no matching commit)
- [17/18] platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS
(no matching commit)
- [18/18] platform/chrome/wilco_ec: core: provide ID table for avoiding fallback match (no matching commit)

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#63 lore raw
In reply to Tzung-Bi Shih
This series was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Hello:

This series was applied to chrome-platform/linux.git (for-next) by Tzung-Bi Shih <[email protected]>:

Quoted 8 lines · On Fri, 29 Mar 2024 15:56:12 +0800 you wrote:

Inspired by [1]. Turn all MODULE_ALIAS() in ChromeOS EC platform drivers into proper platform_device_id table and MODULE_DEVICE_TABLE().

The series is basically looking for drivers from:
- struct mfd_cell in drivers/mfd/cros_ec_dev.c.
- grep -R MODULE_ALIAS drivers/platform/chrome/.

[...]

Here is the summary with links:
- [01/18] media: platform: cros-ec: provide ID table for avoiding fallback match (no matching commit)
- [02/18] gpio: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [03/18] rtc: cros-ec: provide ID table for avoiding fallback match
(no matching commit)
- [04/18] platform/chrome: cros_ec_sensorhub: provide ID table for avoiding fallback match (no matching commit)
- [05/18] power: supply: cros_usbpd: provide ID table for avoiding fallback match (no matching commit)
- [06/18] platform/chrome: cros_usbpd_logger: provide ID table for avoiding fallback match (no matching commit)
- [07/18] platform/chrome: cros_usbpd_notify: provide ID table for avoiding fallback match (no matching commit)
- [08/18] platform/chrome: cros_ec_chardev: provide ID table for avoiding fallback match (no matching commit)
- [09/18] platform/chrome: cros_ec_debugfs: provide ID table for avoiding fallback match (no matching commit)
- [10/18] platform/chrome: cros_ec_sysfs: provide ID table for avoiding fallback match (no matching commit)
- [11/18] power: supply: cros_pchg: provide ID table for avoiding fallback match (no matching commit)
- [12/18] platform/chrome: cros_ec_lightbar: provide ID table for avoiding fallback match (no matching commit)
- [13/18] platform/chrome: cros_ec_vbc: provide ID table for avoiding fallback match (no matching commit)
- [14/18] platform/chrome: cros_kbd_led_backlight: provide ID table for avoiding fallback match

    https://git.kernel.org/chrome-platform/c/d91ca83599cd

- [15/18] platform/chrome: wilco_ec: telemetry: provide ID table for avoiding fallback match (no matching commit)
- [16/18] platform/chrome: wilco_ec: debugfs: provide ID table for avoiding fallback match (no matching commit)
- [17/18] platform/chrome: wilco_ec: event: remove redundant MODULE_ALIAS
(no matching commit)
- [18/18] platform/chrome/wilco_ec: core: provide ID table for avoiding fallback match (no matching commit)

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html