aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2021-03-25 10:26:09 +1300
committerSimon Glass <sjg@chromium.org>2021-04-06 16:33:19 +1200
commit3bc11b983d01e8b761cfeafa60d520b5702f7d10 (patch)
tree5902b71e9074faf4f746bc487efe38c97537e4c1 /drivers
parent9042bf6fe415c319958637b5e8b44ea4cf6f3a76 (diff)
downloadu-boot-3bc11b983d01e8b761cfeafa60d520b5702f7d10.zip
u-boot-3bc11b983d01e8b761cfeafa60d520b5702f7d10.tar.gz
u-boot-3bc11b983d01e8b761cfeafa60d520b5702f7d10.tar.bz2
clk: Return -ENOSYS when system call is not available
Update clk_composite_set_parent() to use -ENOSYS, which is the correct error code for U-Boot. Also rearrange the code so that the error condition is clearly indicated and the function runs to the end in the normal case, since this is the common style in U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Sean Anderson <seanga2@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/clk/clk-composite.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 7e99c5b..bb5351e 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -37,10 +37,10 @@ static int clk_composite_set_parent(struct clk *clk, struct clk *parent)
const struct clk_ops *mux_ops = composite->mux_ops;
struct clk *mux = composite->mux;
- if (mux && mux_ops)
- return mux_ops->set_parent(mux, parent);
- else
- return -ENOTSUPP;
+ if (!mux || !mux_ops)
+ return -ENOSYS;
+
+ return mux_ops->set_parent(mux, parent);
}
static unsigned long clk_composite_recalc_rate(struct clk *clk)