diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-10-14 16:59:46 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2024-10-24 14:48:23 +0200 |
commit | a5a98a786e5e31e85a69d30935254e8730734706 (patch) | |
tree | 6654682d011b2466324507b7b3fa1ae824ab44d2 /include | |
parent | c597b4e74b124aebf7e3d3f7907e2d4779d870e3 (diff) | |
download | linux-stable-a5a98a786e5e31e85a69d30935254e8730734706.tar.gz linux-stable-a5a98a786e5e31e85a69d30935254e8730734706.tar.bz2 linux-stable-a5a98a786e5e31e85a69d30935254e8730734706.zip |
thermal: core: Add and use cooling device guard
Add and use a special guard for cooling devices.
This allows quite a few error code paths to be simplified among
other things and brings in code size reduction for a good measure.
No intentional functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://patch.msgid.link/5837621.DvuYhMxLoT@rjwysocki.net
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/thermal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index bcaa92732e14..754802478b96 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h @@ -140,6 +140,9 @@ struct thermal_cooling_device { #endif }; +DEFINE_GUARD(cooling_dev, struct thermal_cooling_device *, mutex_lock(&_T->lock), + mutex_unlock(&_T->lock)) + /* Structure to define Thermal Zone parameters */ struct thermal_zone_params { const char *governor_name; |