Use devm_thermal_zone_of_sensor_register_params() with thermal zone
params to enable the hwmon sysfs interface.

Signed-off-by: Marek Vasut <[email protected]>
Cc: Daniel Lezcano <[email protected]>
Cc: Eduardo Valentin <[email protected]>
Cc: Wolfram Sang <[email protected]>
Cc: Zhang Rui <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: No change
---
 drivers/thermal/rcar_gen3_thermal.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/thermal/rcar_gen3_thermal.c 
b/drivers/thermal/rcar_gen3_thermal.c
index 75786cc8e2f9..d86b8e746313 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -85,6 +85,10 @@ struct rcar_gen3_thermal_priv {
        void (*thermal_init)(struct rcar_gen3_thermal_tsc *tsc);
 };
 
+static struct thermal_zone_params rcar_gen3_tz_of_params = {
+       .no_hwmon       = false,
+};
+
 static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc,
                                         u32 reg)
 {
@@ -416,8 +420,8 @@ static int rcar_gen3_thermal_probe(struct platform_device 
*pdev)
                priv->thermal_init(tsc);
                rcar_gen3_thermal_calc_coefs(&tsc->coef, ptat, thcode[i]);
 
-               zone = devm_thermal_zone_of_sensor_register(dev, i, tsc,
-                                                           
&rcar_gen3_tz_of_ops);
+               zone = devm_thermal_zone_of_sensor_register_params(dev, i, tsc,
+                               &rcar_gen3_tz_of_ops, &rcar_gen3_tz_of_params);
                if (IS_ERR(zone)) {
                        dev_err(dev, "Can't register thermal zone\n");
                        ret = PTR_ERR(zone);
-- 
2.18.0

Reply via email to