[PATCH v2 6/7] clk: make clk_get_parent_rate return signed long
Casey Connolly <[email protected]> Wed, 01 Apr 2026 16:34:07 +0200
| Newsgroups | io.groups.u-boot-amlogic,org.u-boot-project.lists.u-boot |
|---|---|
| Message-ID | <[email protected]> |
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 <[email protected]> --- 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