File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change 1
1
// SPDX-License-Identifier: GPL-2.0
2
2
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.*/
3
3
4
+ #include <linux/cleanup.h>
4
5
#include <linux/err.h>
5
6
#include <linux/init.h>
6
7
#include <linux/kernel.h>
@@ -775,9 +776,9 @@ static int rpmhpd_set_performance_state(struct generic_pm_domain *domain,
775
776
unsigned int level )
776
777
{
777
778
struct rpmhpd * pd = domain_to_rpmhpd (domain );
778
- int ret = 0 , i ;
779
+ int ret , i ;
779
780
780
- mutex_lock (& rpmhpd_lock );
781
+ guard ( mutex ) (& rpmhpd_lock );
781
782
782
783
for (i = 0 ; i < pd -> level_count ; i ++ )
783
784
if (level <= pd -> level [i ])
@@ -797,14 +798,12 @@ static int rpmhpd_set_performance_state(struct generic_pm_domain *domain,
797
798
798
799
ret = rpmhpd_aggregate_corner (pd , i );
799
800
if (ret )
800
- goto out ;
801
+ return ret ;
801
802
}
802
803
803
804
pd -> corner = i ;
804
- out :
805
- mutex_unlock (& rpmhpd_lock );
806
805
807
- return ret ;
806
+ return 0 ;
808
807
}
809
808
810
809
static int rpmhpd_update_level_mapping (struct rpmhpd * rpmhpd )
You can’t perform that action at this time.
0 commit comments