Skip to content

Commit 83c2d44

Browse files
committed
thermal: of: Set THERMAL_TRIP_FLAG_RW_TEMP directly
It is now possible to flag trip points with THERMAL_TRIP_FLAG_RW_TEMP to allow their temperature to be set from user space via sysfs instead of using a nonzero writable trips mask during thermal zone registration, so make the OF thermal code do that. No intentional functional impact. Note that this change is requisite for dropping the mask argument from thermal_zone_device_register_with_trips() going forward. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Daniel Lezcano <daniel.lezcano@linaro.org>
1 parent 68e9c60 commit 83c2d44

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/thermal/thermal_of.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ static int thermal_of_populate_trip(struct device_node *np,
117117
return ret;
118118
}
119119

120+
trip->flags = THERMAL_TRIP_FLAG_RW_TEMP;
121+
120122
return 0;
121123
}
122124

@@ -472,7 +474,7 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
472474
struct device_node *np;
473475
const char *action;
474476
int delay, pdelay;
475-
int ntrips, mask;
477+
int ntrips;
476478
int ret;
477479

478480
np = of_thermal_zone_find(sensor, id);
@@ -499,15 +501,13 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
499501
of_ops.bind = thermal_of_bind;
500502
of_ops.unbind = thermal_of_unbind;
501503

502-
mask = GENMASK_ULL((ntrips) - 1, 0);
503-
504504
ret = of_property_read_string(np, "critical-action", &action);
505505
if (!ret)
506506
if (!of_ops.critical && !strcasecmp(action, "reboot"))
507507
of_ops.critical = thermal_zone_device_critical_reboot;
508508

509509
tz = thermal_zone_device_register_with_trips(np->name, trips, ntrips,
510-
mask, data, &of_ops, &tzp,
510+
0, data, &of_ops, &tzp,
511511
pdelay, delay);
512512
if (IS_ERR(tz)) {
513513
ret = PTR_ERR(tz);

0 commit comments

Comments
 (0)