Skip to content

Commit f6bd2f6

Browse files
alexis-belmonteij-intel
authored andcommitted
platform/x86: hp-wmi: Fix implementation of the platform_profile_omen_get function
Fix ill-formed implementation of the platform_profile_omen_get function introduced by the commit d234302 ("platform/x86: hp-wmi: Fix platform profile option switch bug on Omen and Victus laptops"). platform_profile_omen_get() is .profile_get function that should set *profile and return 0 on success. Reported-by: Dan Carpenter <[email protected]> Fixes: d234302 ("platform/x86: hp-wmi: Fix platform profile option switch bug on Omen and Victus laptops") Signed-off-by: Alexis Belmonte <[email protected]> Reviewed-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/ZpFnV8w1558BW7iZ@alexis-pc Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 1e02e31 commit f6bd2f6

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

drivers/platform/x86/hp/hp-wmi.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1238,8 +1238,6 @@ static int platform_profile_omen_get_ec(enum platform_profile_option *profile)
12381238
static int platform_profile_omen_get(struct platform_profile_handler *pprof,
12391239
enum platform_profile_option *profile)
12401240
{
1241-
enum platform_profile_option selected_platform_profile;
1242-
12431241
/*
12441242
* We directly return the stored platform profile, as the embedded
12451243
* controller will not accept switching to the performance option when
@@ -1253,9 +1251,9 @@ static int platform_profile_omen_get(struct platform_profile_handler *pprof,
12531251
* See also omen_powersource_event.
12541252
*/
12551253
guard(mutex)(&active_platform_profile_lock);
1256-
selected_platform_profile = active_platform_profile;
1254+
*profile = active_platform_profile;
12571255

1258-
return selected_platform_profile;
1256+
return 0;
12591257
}
12601258

12611259
static bool has_omen_thermal_profile_ec_timer(void)

0 commit comments

Comments
 (0)