diff options
author | Alexis Belmonte <alexbelm48@gmail.com> | 2024-07-12 19:26:47 +0200 |
---|---|---|
committer | Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> | 2024-07-15 12:38:42 +0300 |
commit | f6bd2f633b686cdd6a466a4d8484fb74492b1125 (patch) | |
tree | 925e43a2b7d86b704a30ca022e189fb11a66c21c /drivers/platform | |
parent | 1e02e317470b1c68d5971e51e8c62967ec1bc828 (diff) | |
download | lwn-f6bd2f633b686cdd6a466a4d8484fb74492b1125.tar.gz lwn-f6bd2f633b686cdd6a466a4d8484fb74492b1125.zip |
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 d23430233494 ("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 <dan.carpenter@linaro.org>
Fixes: d23430233494 ("platform/x86: hp-wmi: Fix platform profile option switch bug on Omen and Victus laptops")
Signed-off-by: Alexis Belmonte <alexbelm48@gmail.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/ZpFnV8w1558BW7iZ@alexis-pc
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/hp/hp-wmi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c index c8bcb3e2b344..876e0a97cee1 100644 --- a/drivers/platform/x86/hp/hp-wmi.c +++ b/drivers/platform/x86/hp/hp-wmi.c @@ -1238,8 +1238,6 @@ static int platform_profile_omen_get_ec(enum platform_profile_option *profile) static int platform_profile_omen_get(struct platform_profile_handler *pprof, enum platform_profile_option *profile) { - enum platform_profile_option selected_platform_profile; - /* * We directly return the stored platform profile, as the embedded * 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, * See also omen_powersource_event. */ guard(mutex)(&active_platform_profile_lock); - selected_platform_profile = active_platform_profile; + *profile = active_platform_profile; - return selected_platform_profile; + return 0; } static bool has_omen_thermal_profile_ec_timer(void) |