]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
cpufreq: brcmstb-avs-cpufreq: Fix initial command check
authorFlorian Fainelli <f.fainelli@gmail.com>
Wed, 22 May 2019 18:45:46 +0000 (11:45 -0700)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 4 Jun 2019 04:01:33 +0000 (09:31 +0530)
There is a logical error in brcm_avs_is_firmware_loaded() whereby if the
firmware returns -EINVAL, we will be reporting this as an error. The
comment is correct, the code was not.

Fixes: de322e085995 ("cpufreq: brcmstb-avs-cpufreq: AVS CPUfreq driver for Broadcom STB SoCs")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Acked-by: Markus Mayer <mmayer@broadcom.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/cpufreq/brcmstb-avs-cpufreq.c

index e6f9cbe5835f96883599d86006c54fd805f4e7e7..6ed53ca8aa9803e856dce7fdff4599dbd72ca4b6 100644 (file)
@@ -446,8 +446,8 @@ static bool brcm_avs_is_firmware_loaded(struct private_data *priv)
        rc = brcm_avs_get_pmap(priv, NULL);
        magic = readl(priv->base + AVS_MBOX_MAGIC);
 
-       return (magic == AVS_FIRMWARE_MAGIC) && (rc != -ENOTSUPP) &&
-               (rc != -EINVAL);
+       return (magic == AVS_FIRMWARE_MAGIC) && ((rc != -ENOTSUPP) ||
+               (rc != -EINVAL));
 }
 
 static unsigned int brcm_avs_cpufreq_get(unsigned int cpu)