Commit d4b938ab authored by Mark Pearson's avatar Mark Pearson Committed by Hans de Goede

platform/x86: thinkpad_acpi: clean up dytc profile convert

Minor update cleaning up the code around convert_profile_to_dytc as
identified in the previous commit.
Signed-off-by: default avatarMark Pearson <markpearson@lenovo.com>
Link: https://lore.kernel.org/r/20220307183041.4467-1-markpearson@lenovo.comReviewed-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 1e8aa2aa
...@@ -10298,6 +10298,7 @@ static int dytc_cql_command(int command, int *output) ...@@ -10298,6 +10298,7 @@ static int dytc_cql_command(int command, int *output)
static int dytc_profile_set(struct platform_profile_handler *pprof, static int dytc_profile_set(struct platform_profile_handler *pprof,
enum platform_profile_option profile) enum platform_profile_option profile)
{ {
int perfmode;
int output; int output;
int err; int err;
...@@ -10305,6 +10306,10 @@ static int dytc_profile_set(struct platform_profile_handler *pprof, ...@@ -10305,6 +10306,10 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
if (err) if (err)
return err; return err;
err = convert_profile_to_dytc(profile, &perfmode);
if (err)
goto unlock;
if (dytc_profile_available == DYTC_FUNCMODE_MMC) { if (dytc_profile_available == DYTC_FUNCMODE_MMC) {
if (profile == PLATFORM_PROFILE_BALANCED) { if (profile == PLATFORM_PROFILE_BALANCED) {
/* /*
...@@ -10317,12 +10322,6 @@ static int dytc_profile_set(struct platform_profile_handler *pprof, ...@@ -10317,12 +10322,6 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
if (err) if (err)
goto unlock; goto unlock;
} else { } else {
int perfmode;
err = convert_profile_to_dytc(profile, &perfmode);
if (err)
goto unlock;
/* Determine if we are in CQL mode. This alters the commands we do */ /* Determine if we are in CQL mode. This alters the commands we do */
err = dytc_cql_command(DYTC_SET_COMMAND(DYTC_FUNCTION_MMC, perfmode, 1), err = dytc_cql_command(DYTC_SET_COMMAND(DYTC_FUNCTION_MMC, perfmode, 1),
&output); &output);
...@@ -10331,12 +10330,6 @@ static int dytc_profile_set(struct platform_profile_handler *pprof, ...@@ -10331,12 +10330,6 @@ static int dytc_profile_set(struct platform_profile_handler *pprof,
} }
} }
if (dytc_profile_available == DYTC_FUNCMODE_PSC) { if (dytc_profile_available == DYTC_FUNCMODE_PSC) {
int perfmode;
err = convert_profile_to_dytc(profile, &perfmode);
if (err)
goto unlock;
err = dytc_command(DYTC_SET_COMMAND(DYTC_FUNCTION_PSC, perfmode, 1), &output); err = dytc_command(DYTC_SET_COMMAND(DYTC_FUNCTION_PSC, perfmode, 1), &output);
if (err) if (err)
goto unlock; goto unlock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment