thermal: core: Add Kconfig option to enable writable trips
[deliverable/linux.git] / drivers / thermal / thermal_core.c
index b389bc2ec0fa652b78f3d5e2361b22d7027c0054..78bb9aa9d4e402bd221b34797c84f172533bf879 100644 (file)
@@ -1539,7 +1539,8 @@ static int create_trip_attrs(struct thermal_zone_device *tz, int mask)
                                                tz->trip_temp_attrs[indx].name;
                tz->trip_temp_attrs[indx].attr.attr.mode = S_IRUGO;
                tz->trip_temp_attrs[indx].attr.show = trip_point_temp_show;
-               if (mask & (1 << indx)) {
+               if (IS_ENABLED(CONFIG_THERMAL_WRITABLE_TRIPS) &&
+                   mask & (1 << indx)) {
                        tz->trip_temp_attrs[indx].attr.attr.mode |= S_IWUSR;
                        tz->trip_temp_attrs[indx].attr.store =
                                                        trip_point_temp_store;
This page took 0.033993 seconds and 5 git commands to generate.