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
if (ret && ret != -ENOSYS)
return ret;
- ret = clk_free(&clk[i]);
- if (ret && ret != -ENOSYS)
- return ret;
+ clk_free(&clk[i]);
}
return 0;
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)
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;
}
* @clk: A clock struct that was previously successfully requested by
* clk_request/get_by_*().
*
- * Return: 0 if OK, or a negative error code.
+ * Free resources allocated by clk_request() (or any clk_get_* function).
*/
-int clk_free(struct clk *clk);
+void clk_free(struct clk *clk);
/**
* clk_get_rate() - Get current clock rate.
return -ENOSYS;
}
-static inline int clk_free(struct clk *clk)
+static inline void clk_free(struct clk *clk)
{
- return 0;
+ return;
}
static inline ulong clk_get_rate(struct clk *clk)