[PATCH RFC 20/40] clk: make clk_get_parent_rate return signed long
Casey Connolly
casey.connolly at linaro.org
Thu Mar 19 21:56:42 CET 2026
This function can return negative values, update its prototype to
reflect this and avoid potential underflow issues with error conditions.
Signed-off-by: Casey Connolly <casey.connolly at linaro.org>
---
drivers/clk/clk-uclass.c | 2 +-
include/clk.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index db4f056e4816..095329e25f15 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -514,9 +514,9 @@ struct clk *clk_get_parent(struct clk *clk)
return pclk;
}
-ulong clk_get_parent_rate(struct clk *clk)
+long clk_get_parent_rate(struct clk *clk)
{
const struct clk_ops_uboot *ops;
struct clk *pclk;
diff --git a/include/clk.h b/include/clk.h
index 3cd080b43264..0520032f692c 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -468,9 +468,9 @@ struct clk *clk_get_parent(struct clk *clk);
* clk_request/get_by_*().
*
* Return: clock rate in Hz, or -ve error code.
*/
-ulong clk_get_parent_rate(struct clk *clk);
+long clk_get_parent_rate(struct clk *clk);
/**
* clk_round_rate() - Adjust a rate to the exact rate a clock can provide
* @clk: A clock struct that was previously successfully requested by
--
2.51.0
More information about the U-Boot
mailing list