Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1684009 > unrolled thread

[PATCH] clocksource/timer-of: checking for NULL instead of IS_ERR()

Started byDan Carpenter <dan.carpenter@oracle.com>
First post2017-07-10 09:30 +0200
Last post2017-07-10 09:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] clocksource/timer-of: checking for NULL instead of IS_ERR() Dan Carpenter <dan.carpenter@oracle.com> - 2017-07-10 09:30 +0200

#1684009 — [PATCH] clocksource/timer-of: checking for NULL instead of IS_ERR()

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-07-10 09:30 +0200
Subject[PATCH] clocksource/timer-of: checking for NULL instead of IS_ERR()
Message-ID<u1BiQ-1ZK-79@gated-at.bofh.it>
of_io_request_and_map() doesn't return NULL, it returns error pointers.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/clocksource/timer-of.c b/drivers/clocksource/timer-of.c
index f6e7491c873c..f83d52e313d2 100644
--- a/drivers/clocksource/timer-of.c
+++ b/drivers/clocksource/timer-of.c
@@ -120,9 +120,9 @@ static __init int timer_base_init(struct device_node *np,
 	const char *name = of_base->name ? of_base->name : np->full_name;
 
 	of_base->base = of_io_request_and_map(np, of_base->index, name);
-	if (!of_base->base) {
+	if (IS_ERR(of_base->base)) {
 		pr_err("Failed to iomap (%s)\n", name);
-		return -ENXIO;
+		return PTR_ERR(of_base->base);
 	}
 
 	return 0;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web