[PATCH] arm: mach-bcm283x: Fix binary logic
Andrew Goodbody
andrew.goodbody at linaro.org
Thu Jul 24 16:23:10 CEST 2025
In bcm_cpu_probe the test on the return value from clk_enable is
incorrect and will not work as intended. Change the || to && in order to
achieve the desired effect.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody at linaro.org>
---
drivers/cpu/bcm283x_cpu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpu/bcm283x_cpu.c b/drivers/cpu/bcm283x_cpu.c
index 59a7b142c95..7db00dadd90 100644
--- a/drivers/cpu/bcm283x_cpu.c
+++ b/drivers/cpu/bcm283x_cpu.c
@@ -174,7 +174,7 @@ static int bcm_cpu_probe(struct udevice *dev)
ret = clk_get_by_index(dev, 0, &clk);
if (!ret) {
ret = clk_enable(&clk);
- if (ret && (ret != -ENOSYS || ret != -EOPNOTSUPP))
+ if (ret && (ret != -ENOSYS && ret != -EOPNOTSUPP))
return ret;
ret = clk_get_rate(&clk);
if (IS_ERR_VALUE(ret))
---
base-commit: 3532f1f5edfc97c9dcea723cdeb732eda44bc669
change-id: 20250724-bcm283x-24aa0074df01
Best regards,
--
Andrew Goodbody <andrew.goodbody at linaro.org>
More information about the U-Boot
mailing list