diff options
author | Greg Kroah-Hartman <gregkh@google.com> | 2024-05-20 11:29:35 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2024-05-20 11:32:31 +0000 |
commit | a8e7f812fbc15d931311179614ea38730b6bcf09 (patch) | |
tree | 274c9cc05215ffd6e43075c245dd17edcee52ce9 | |
parent | 857c3acf6e12ef37b5144cdaed30be486e2f8325 (diff) | |
download | hikey-linaro-mirror-android13-5.10-lts.tar.gz |
ANDROID: cpufreq: brcmstb-avs-cpufreq: fix build errormirror-android13-5.10-lts
In commit 9127599c075c ("cpufreq: brcmstb-avs-cpufreq: add check for
cpufreq_cpu_get's return value"), a check is made in a way that causes a
build warning, which in Android systems, breaks the build. Fix this up
by moving the definition of the variable above the check to remove the
warning.
Fixes: 9127599c075c ("cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return value")
Change-Id: I8477905e3447eb4eabf3aa0899534c06a0cca125
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-rw-r--r-- | drivers/cpufreq/brcmstb-avs-cpufreq.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c index 38ec0fedb247..c73397ff4098 100644 --- a/drivers/cpufreq/brcmstb-avs-cpufreq.c +++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c @@ -481,9 +481,11 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv) static unsigned int brcm_avs_cpufreq_get(unsigned int cpu) { struct cpufreq_policy *policy = cpufreq_cpu_get(cpu); + struct private_data *priv; + if (!policy) return 0; - struct private_data *priv = policy->driver_data; + priv = policy->driver_data; cpufreq_cpu_put(policy); |