linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, Chuhong Yuan <hslester96@gmail.com>
Subject: [PATCH 5/5] clocksource/drivers/asm9260: Add a check for of_clk_get
Date: Mon,  4 Nov 2019 15:22:57 +0100	[thread overview]
Message-ID: <20191104142257.30029-5-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <20191104142257.30029-1-daniel.lezcano@linaro.org>

From: Chuhong Yuan <hslester96@gmail.com>

asm9260_timer_init misses a check for of_clk_get.
Add a check for it and print errors like other clocksource drivers.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20191016124330.22211-1-hslester96@gmail.com
---
 drivers/clocksource/asm9260_timer.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clocksource/asm9260_timer.c b/drivers/clocksource/asm9260_timer.c
index 9f09a59161e7..5b39d3701fa3 100644
--- a/drivers/clocksource/asm9260_timer.c
+++ b/drivers/clocksource/asm9260_timer.c
@@ -194,6 +194,10 @@ static int __init asm9260_timer_init(struct device_node *np)
 	}
 
 	clk = of_clk_get(np, 0);
+	if (IS_ERR(clk)) {
+		pr_err("Failed to get clk!\n");
+		return PTR_ERR(clk);
+	}
 
 	ret = clk_prepare_enable(clk);
 	if (ret) {
-- 
2.17.1


  parent reply	other threads:[~2019-11-04 14:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-04 14:21 [GIT PULL] clockevents for 5.6 Daniel Lezcano
2019-11-04 14:22 ` [PATCH 1/5] clocksource/drivers/timer-of: Convert last full_name to %pOF Daniel Lezcano
2019-11-04 14:22   ` [PATCH 2/5] clocksource/drivers/timer-of: Use unique device name instead of timer Daniel Lezcano
2019-11-04 14:22   ` [PATCH 3/5] clocksource/drivers/renesas-ostm: Convert to timer_of Daniel Lezcano
2019-11-04 14:22   ` [PATCH 4/5] clocksource/drivers/renesas-ostm: Use unique device name instead of ostm Daniel Lezcano
2019-11-04 14:22   ` Daniel Lezcano [this message]
2019-11-04 17:48 ` [GIT PULL] clockevents for 5.6 Thomas Gleixner

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=20191104142257.30029-5-daniel.lezcano@linaro.org \
    --to=daniel.lezcano@linaro.org \
    --cc=hslester96@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.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 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).