Skip to contentSkip to conversation

hwmon: sy7636a: add aliases

PATCH Superseded Andreas Kemnade 2 participants 2 messages Sep 6, 2025 Hardware monitoring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: sy7636a: add aliases

Add module aliases via module devicetable to have it autoloaded.

---
 drivers/hwmon/sy7636a-hwmon.c | 8 ++++++++
 1 file changed, 8 insertions(+)
drivers/hwmon/sy7636a-hwmon.c +8 -0
index ed110884786b4..74ee0e756ffdc 100644
@@ -12,6 +12,7 @@
 #include <linux/hwmon.h>
 #include <linux/init.h>
 #include <linux/module.h>
+#include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/regmap.h>
 #include <linux/regulator/machine.h>
@@ -94,11 +95,18 @@ static int sy7636a_sensor_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct platform_device_id sy7636a_sensor_idtable[] = {
+	{ "sy7636a-temperature" },
+	{ },
+};
+MODULE_DEVICE_TABLE(platform, sy7636a_sensor_idtable);
+
 static struct platform_driver sy7636a_sensor_driver = {
 	.probe = sy7636a_sensor_probe,
 	.driver = {
 		.name = "sy7636a-temperature",
 	},
+	.id_table = sy7636a_sensor_idtable,
 };
 module_platform_driver(sy7636a_sensor_driver);
 
Signature · 1 line
2.39.5
maintainer
#1 lore raw
Quoted 28 lines · Andreas Kemnade

Add module aliases via module devicetable to have it autoloaded.

---
  drivers/hwmon/sy7636a-hwmon.c | 8 ++++++++
  1 file changed, 8 insertions(+)
drivers/hwmon/sy7636a-hwmon.c +6 -0
index ed110884786b4..74ee0e756ffdc 100644
@@ -12,6 +12,7 @@
  #include <linux/hwmon.h>
  #include <linux/init.h>
  #include <linux/module.h>
+#include <linux/mod_devicetable.h>
  #include <linux/platform_device.h>
  #include <linux/regmap.h>
  #include <linux/regulator/machine.h>
@@ -94,11 +95,18 @@ static int sy7636a_sensor_probe(struct platform_device *pdev)
  	return 0;
  }
 
+static const struct platform_device_id sy7636a_sensor_idtable[] = {
+	{ "sy7636a-temperature" },
+	{ },
+};
+MODULE_DEVICE_TABLE(platform, sy7636a_sensor_idtable);

drivers/hwmon/sy7636a-hwmon.c static int sy7636a_sensor_probe(struct platform_device *pdev) · line 112

Quoted 10 lines
drivers/hwmon/sy7636a-hwmon.c +2 -0
+
  static struct platform_driver sy7636a_sensor_driver = {
  	.probe = sy7636a_sensor_probe,
  	.driver = {
  		.name = "sy7636a-temperature",
  	},
+	.id_table = sy7636a_sensor_idtable,
  };
  module_platform_driver(sy7636a_sensor_driver);
 

I would suggest to just add

MODULE_ALIAS("platform:sy7636a-temperature");

instead.

Guenter