All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH 4/6] clk: Return -ENOSYS when system call is not available
Date: Sun, 21 Mar 2021 16:18:22 +1300	[thread overview]
Message-ID: <20210321031824.2170848-5-sjg@chromium.org> (raw)
In-Reply-To: <20210321031824.2170848-1-sjg@chromium.org>

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>
---

 drivers/clk/clk-composite.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 7e99c5b910d..bb5351ebc0b 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)
-- 
2.31.0.rc2.261.g7f71774620-goog

  parent reply	other threads:[~2021-03-21  3:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-21  3:18 [PATCH 0/6] Use -ENOSYS consistently Simon Glass
2021-03-21  3:18 ` [PATCH 1/6] usb: Return -ENOSYS when system call is not available Simon Glass
2021-03-21  4:09   ` Marek Vasut
2021-03-21  4:12     ` Simon Glass
2021-03-21 18:29       ` Marek Vasut
2021-03-21  3:18 ` [PATCH 2/6] spi: " Simon Glass
2021-03-21  3:18 ` [PATCH 3/6] tlv_eeprom: " Simon Glass
2021-03-21  3:18 ` Simon Glass [this message]
2021-03-21  4:37   ` [PATCH 4/6] clk: " Sean Anderson
2021-03-23  4:08     ` Simon Glass
2021-03-21  3:18 ` [PATCH 5/6] simple-pm-bus: Use -ENOSYS for checking missing system call Simon Glass
2021-03-21  4:39   ` Sean Anderson
2021-03-21  3:18 ` [PATCH 6/6] pinctrl: Return -ENOSYS when system call is not available Simon Glass
2021-03-21 16:38 ` [PATCH 0/6] Use -ENOSYS consistently Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210321031824.2170848-5-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.