File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -184,32 +184,26 @@ int platform_profile_register(struct platform_profile_handler *pprof)
184
184
return - EINVAL ;
185
185
}
186
186
187
- mutex_lock (& profile_lock );
187
+ guard ( mutex ) (& profile_lock );
188
188
/* We can only have one active profile */
189
- if (cur_profile ) {
190
- mutex_unlock (& profile_lock );
189
+ if (cur_profile )
191
190
return - EEXIST ;
192
- }
193
191
194
192
err = sysfs_create_group (acpi_kobj , & platform_profile_group );
195
- if (err ) {
196
- mutex_unlock (& profile_lock );
193
+ if (err )
197
194
return err ;
198
- }
199
195
200
196
cur_profile = pprof ;
201
- mutex_unlock (& profile_lock );
202
197
return 0 ;
203
198
}
204
199
EXPORT_SYMBOL_GPL (platform_profile_register );
205
200
206
201
int platform_profile_remove (struct platform_profile_handler * pprof )
207
202
{
208
- sysfs_remove_group ( acpi_kobj , & platform_profile_group );
203
+ guard ( mutex )( & profile_lock );
209
204
210
- mutex_lock ( & profile_lock );
205
+ sysfs_remove_group ( acpi_kobj , & platform_profile_group );
211
206
cur_profile = NULL ;
212
- mutex_unlock (& profile_lock );
213
207
return 0 ;
214
208
}
215
209
EXPORT_SYMBOL_GPL (platform_profile_remove );
You can’t perform that action at this time.
0 commit comments