linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: leo.yan@linaro.org (Leo Yan)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 1/5] clk: hisi: refine parameter checking for init
Date: Mon,  3 Aug 2015 09:13:34 +0800	[thread overview]
Message-ID: <1438564418-15948-2-git-send-email-leo.yan@linaro.org> (raw)
In-Reply-To: <1438564418-15948-1-git-send-email-leo.yan@linaro.org>

*of_iomap()* will check the device node pointer, and if the pointer is
NULL it will return error code. So refine clock's init flow by checking
the device node with this simple way; and polish a little for the print
out message.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
---
 drivers/clk/hisilicon/clk.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/clk/hisilicon/clk.c b/drivers/clk/hisilicon/clk.c
index c90a897..156435d 100644
--- a/drivers/clk/hisilicon/clk.c
+++ b/drivers/clk/hisilicon/clk.c
@@ -45,14 +45,9 @@ struct hisi_clock_data __init *hisi_clk_init(struct device_node *np,
 	struct clk **clk_table;
 	void __iomem *base;
 
-	if (np) {
-		base = of_iomap(np, 0);
-		if (!base) {
-			pr_err("failed to map Hisilicon clock registers\n");
-			goto err;
-		}
-	} else {
-		pr_err("failed to find Hisilicon clock node in DTS\n");
+	base = of_iomap(np, 0);
+	if (!base) {
+		pr_err("%s: failed to map clock registers\n", __func__);
 		goto err;
 	}
 
-- 
1.9.1

  reply	other threads:[~2015-08-03  1:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-03  1:13 [PATCH v3 0/5] clk: hisilicon: support stub clock Leo Yan
2015-08-03  1:13 ` Leo Yan [this message]
2015-08-03 21:46   ` [PATCH v3 1/5] clk: hisi: refine parameter checking for init Stephen Boyd
2015-08-03  1:13 ` [PATCH v3 2/5] dt-bindings: arm: Hi6220: add doc for SRAM controller Leo Yan
2015-08-03  1:13 ` [PATCH v3 3/5] dt-bindings: clk: Hi6220: Document stub clock driver Leo Yan
2015-08-03  1:13 ` [PATCH v3 4/5] clk: Hi6220: add " Leo Yan
2015-08-03 21:37   ` Stephen Boyd
2015-08-04  6:27     ` Leo Yan
2015-09-02  0:28   ` Kevin Hilman
2015-09-02  1:52     ` Leo Yan
2015-08-03  1:13 ` [PATCH v3 5/5] arm64: dts: add Hi6220's stub clock node Leo Yan

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=1438564418-15948-2-git-send-email-leo.yan@linaro.org \
    --to=leo.yan@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).