]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: Use non-OF thermal cooling device registration API
authorDaniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Tue, 26 May 2026 14:08:04 +0000 (16:08 +0200)
committerDaniel Lezcano <daniel.lezcano@kernel.org>
Wed, 3 Jun 2026 07:12:45 +0000 (09:12 +0200)
Some HWMON drivers register cooling devices using the OF helper
devm_thermal_of_cooling_device_register() with a NULL device node.

With the introduction of a dedicated non-OF registration API,
switch these users to devm_thermal_cooling_device_register()
to make the intent explicit and avoid relying on OF-specific helpers.

This is a pure refactoring with no functional change.

Signed-off-by: Daniel Lezcano <daniel.lezcano@oss.qualcomm.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@kernel.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Rafael J. Wysocki (Intel) <rafael@kernel.org>
Link: https://patch.msgid.link/20260526140802.1059293-15-daniel.lezcano@oss.qualcomm.com
drivers/hwmon/cros_ec_hwmon.c
drivers/hwmon/dell-smm-hwmon.c
drivers/hwmon/mlxreg-fan.c

index 6cf5ab0f4b738027972657ec5c80cb487eb28b64..77dd9f28962db4dd46ad29f87561c7bca1cec191 100644 (file)
@@ -532,8 +532,8 @@ static void cros_ec_hwmon_register_fan_cooling_devices(struct device *dev,
 
                cpriv->hwmon_priv = priv;
                cpriv->index = i;
-               cdev = devm_thermal_of_cooling_device_register(dev, NULL, type, cpriv,
-                                                              &cros_ec_thermal_cooling_ops);
+               cdev = devm_thermal_cooling_device_register(dev, type, cpriv,
+                                                           &cros_ec_thermal_cooling_ops);
                if (IS_ERR(cdev)) {
                        dev_warn(dev, "failed to register fan %zu as a cooling device: %pe\n", i,
                                 cdev);
index 038edffc1ac747c18ab71eb78313626f4fa13175..47b373ea6db411d88016c1b64910d6655668794e 100644 (file)
@@ -1161,8 +1161,8 @@ static int dell_smm_init_cdev(struct device *dev, u8 fan_num)
        if (cdata) {
                cdata->fan_num = fan_num;
                cdata->data = data;
-               cdev = devm_thermal_of_cooling_device_register(dev, NULL, name, cdata,
-                                                              &dell_smm_cooling_ops);
+               cdev = devm_thermal_cooling_device_register(dev, name, cdata,
+                                                           &dell_smm_cooling_ops);
                if (IS_ERR(cdev)) {
                        devm_kfree(dev, cdata);
                        ret = PTR_ERR(cdev);
index 137a90dd207523c085d42dbfa78bfbb3066408c3..860de6cfd8a4da49450d9a32d534acd8eb92c3ec 100644 (file)
@@ -583,8 +583,8 @@ static int mlxreg_fan_cooling_config(struct device *dev, struct mlxreg_fan *fan)
                pwm->fan = fan;
                /* Set minimal PWM speed. */
                pwm->last_hwmon_state = MLXREG_FAN_PWM_DUTY2STATE(MLXREG_FAN_MIN_DUTY);
-               pwm->cdev = devm_thermal_of_cooling_device_register(dev, NULL, mlxreg_fan_name[i],
-                                                                   pwm, &mlxreg_fan_cooling_ops);
+               pwm->cdev = devm_thermal_cooling_device_register(dev, mlxreg_fan_name[i],
+                                                                pwm, &mlxreg_fan_cooling_ops);
                if (IS_ERR(pwm->cdev)) {
                        dev_err(dev, "Failed to register cooling device\n");
                        return PTR_ERR(pwm->cdev);