[PATCH] hwmon: sy7636a: add aliases

Andreas Kemnade posted 1 patch 2 days, 6 hours ago
drivers/hwmon/sy7636a-hwmon.c | 8 ++++++++
1 file changed, 8 insertions(+)
[PATCH] hwmon: sy7636a: add aliases
Posted by Andreas Kemnade 2 days, 6 hours ago
Add module aliases via module devicetable to have it autoloaded.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
---
 drivers/hwmon/sy7636a-hwmon.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/hwmon/sy7636a-hwmon.c b/drivers/hwmon/sy7636a-hwmon.c
index ed110884786b4..74ee0e756ffdc 100644
--- a/drivers/hwmon/sy7636a-hwmon.c
+++ b/drivers/hwmon/sy7636a-hwmon.c
@@ -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);
 
-- 
2.39.5
Re: [PATCH] hwmon: sy7636a: add aliases
Posted by Guenter Roeck 2 days, 2 hours ago
On 9/6/25 02:43, Andreas Kemnade wrote:
> Add module aliases via module devicetable to have it autoloaded.
> 
> Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
> ---
>   drivers/hwmon/sy7636a-hwmon.c | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/hwmon/sy7636a-hwmon.c b/drivers/hwmon/sy7636a-hwmon.c
> index ed110884786b4..74ee0e756ffdc 100644
> --- a/drivers/hwmon/sy7636a-hwmon.c
> +++ b/drivers/hwmon/sy7636a-hwmon.c
> @@ -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);
>   

I would suggest to just add

MODULE_ALIAS("platform:sy7636a-temperature");

instead.

Guenter