aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSean Anderson <seanga2@gmail.com>2022-01-15 17:25:04 -0500
committerSean Anderson <seanga2@gmail.com>2022-03-30 13:02:55 -0400
commitac15e789caecec19d29ee9c5869305d3c3ddfb42 (patch)
tree1f6eb51df9cbb9da87a208b5f1c46a1d2d4797af /drivers
parent3cbdd4cab951b8bd3f2e76066e6911f9780c4eb1 (diff)
downloadu-boot-ac15e789caecec19d29ee9c5869305d3c3ddfb42.zip
u-boot-ac15e789caecec19d29ee9c5869305d3c3ddfb42.tar.gz
u-boot-ac15e789caecec19d29ee9c5869305d3c3ddfb42.tar.bz2
clk: Make clk_free return void
Most callers of this function do not check the return value, and it is unclear what action they should take if it fails. If a function is freeing multiple clocks, it should not stop just because the first one failed. Since the callbacks can no longer fail, just convert the return type to void. Signed-off-by: Sean Anderson <seanga2@gmail.com> Link: https://lore.kernel.org/r/20220115222504.617013-8-seanga2@gmail.com
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk-uclass.c10
-rw-r--r--drivers/clk/clk_sandbox_test.c9
2 files changed, 7 insertions, 12 deletions
diff --git a/drivers/clk/clk-uclass.c b/drivers/clk/clk-uclass.c
index 2cc798e..d003bdd 100644
--- a/drivers/clk/clk-uclass.c
+++ b/drivers/clk/clk-uclass.c
@@ -447,9 +447,7 @@ int clk_release_all(struct clk *clk, int count)
if (ret && ret != -ENOSYS)
return ret;
- ret = clk_free(&clk[i]);
- if (ret && ret != -ENOSYS)
- return ret;
+ clk_free(&clk[i]);
}
return 0;
@@ -472,18 +470,18 @@ int clk_request(struct udevice *dev, struct clk *clk)
return ops->request(clk);
}
-int clk_free(struct clk *clk)
+void clk_free(struct clk *clk)
{
const struct clk_ops *ops;
debug("%s(clk=%p)\n", __func__, clk);
if (!clk_valid(clk))
- return 0;
+ return;
ops = clk_dev_ops(clk->dev);
if (ops->rfree)
ops->rfree(clk);
- return 0;
+ return;
}
ulong clk_get_rate(struct clk *clk)
diff --git a/drivers/clk/clk_sandbox_test.c b/drivers/clk/clk_sandbox_test.c
index f665fd3..5807a45 100644
--- a/drivers/clk/clk_sandbox_test.c
+++ b/drivers/clk/clk_sandbox_test.c
@@ -137,14 +137,11 @@ int sandbox_clk_test_disable_bulk(struct udevice *dev)
int sandbox_clk_test_free(struct udevice *dev)
{
struct sandbox_clk_test *sbct = dev_get_priv(dev);
- int i, ret;
+ int i;
devm_clk_put(dev, sbct->clkps[SANDBOX_CLK_TEST_ID_DEVM1]);
- for (i = 0; i < SANDBOX_CLK_TEST_NON_DEVM_COUNT; i++) {
- ret = clk_free(&sbct->clks[i]);
- if (ret)
- return ret;
- }
+ for (i = 0; i < SANDBOX_CLK_TEST_NON_DEVM_COUNT; i++)
+ clk_free(&sbct->clks[i]);
return 0;
}