[PATCH] clk: sophgo: Fix a warning about void returns value

Tom Rini trini at konsulko.com
Wed Oct 1 22:30:57 CEST 2025


The cv1800b_clk_setfield function returns void, but was doing "return
writel(...);" and while seemingly having a void function return a void
function is not a warning, when readl is a macro this problem is shown.
Correct the code to instead simply call writel.

Signed-off-by: Tom Rini <trini at konsulko.com>
---
Cc: Lukasz Majewski <lukma at denx.de> (maintainer:CLOCK)
Cc: Sean Anderson <seanga2 at gmail.com> (maintainer:CLOCK)
Cc: Yao Zi <ziyao at disroot.org>
Cc: Kongyang Liu <seashell11234455 at gmail.com>
---
 drivers/clk/sophgo/clk-common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sophgo/clk-common.h b/drivers/clk/sophgo/clk-common.h
index a9e83d0d6899..a18673f397c3 100644
--- a/drivers/clk/sophgo/clk-common.h
+++ b/drivers/clk/sophgo/clk-common.h
@@ -70,7 +70,7 @@ cv1800b_clk_setfield(void *base, struct cv1800b_clk_regfield *field, u32 val)
 	u32 new_val = (readl(base + field->offset) & ~mask) |
 		      ((val << field->shift) & mask);
 
-	return writel(new_val, base + field->offset);
+	writel(new_val, base + field->offset);
 }
 
 #endif /* __CLK_SOPHGO_COMMON_H__ */
-- 
2.43.0



More information about the U-Boot mailing list