summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPortia Stephens <portia.stephens@canonical.com>2024-04-24 08:02:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-05-30 10:49:15 +0300
commit3cb0f1660f5ba8512a074197d6f14a81f2aad185 (patch)
tree084771fd5ca4522462892fba4955d8499f9c91b2 /drivers
parent6b9569a7a7c451fa8f229e261c8e15e4fefbc34e (diff)
downloadlinux-3cb0f1660f5ba8512a074197d6f14a81f2aad185.tar.xz
cpufreq: brcmstb-avs-cpufreq: ISO C90 forbids mixed declarations
[ Upstream commit fa7bd98f3c8b33fb68c6b2bc69cff32b63db69f8 ] There is a compile warning because a NULL pointer check was added before a struct was declared. This moves the NULL pointer check to after the struct is declared and moves the struct assignment to after the NULL pointer check. Fixes: f661017e6d32 ("cpufreq: brcmstb-avs-cpufreq: add check for cpufreq_cpu_get's return value") Signed-off-by: Portia Stephens <portia.stephens@canonical.com> Acked-by: Florian Fainelli <florian.fainelli@broadcom.com> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpufreq/brcmstb-avs-cpufreq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpufreq/brcmstb-avs-cpufreq.c b/drivers/cpufreq/brcmstb-avs-cpufreq.c
index 1a1857b0a6f4..ea8438550b49 100644
--- a/drivers/cpufreq/brcmstb-avs-cpufreq.c
+++ b/drivers/cpufreq/brcmstb-avs-cpufreq.c
@@ -481,9 +481,12 @@ 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);