[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1465850493-3533419-1-git-send-email-arnd@arndb.de>
Date: Mon, 13 Jun 2016 22:41:19 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>
Cc: Arnd Bergmann <arnd@...db.de>, Vineet Gupta <vgupta@...opsys.com>,
Noam Camus <noamc@...hip.com>, linux-kernel@...r.kernel.org
Subject: [PATCH] clocksource: nps: fix nps_timer_init return value
The CLOCKSOURCE_OF_DECLARE macro ensures that the type of the init
function matches the caller. In case of the new timer-nps driver,
it doesn't match, so we get a warning:
../drivers/clocksource/timer-nps.c:97:208: error: comparison of distinct pointer types lacks a cast [-Werror]
CLOCKSOURCE_OF_DECLARE(ezchip_nps400_clksrc, ezchip,nps400-timer,
This changes the return type to match what the caller expects.
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
drivers/clocksource/timer-nps.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clocksource/timer-nps.c b/drivers/clocksource/timer-nps.c
index d46108920b2c..ae34718f5ab2 100644
--- a/drivers/clocksource/timer-nps.c
+++ b/drivers/clocksource/timer-nps.c
@@ -81,17 +81,19 @@ static void __init nps_setup_clocksource(struct device_node *node,
}
}
-static void __init nps_timer_init(struct device_node *node)
+static int __init nps_timer_init(struct device_node *node)
{
struct clk *clk;
clk = of_clk_get(node, 0);
if (IS_ERR(clk)) {
pr_err("Can't get timer clock.\n");
- return;
+ return PTR_ERR(clk);
}
nps_setup_clocksource(node, clk);
+
+ return 0;
}
CLOCKSOURCE_OF_DECLARE(ezchip_nps400_clksrc, "ezchip,nps400-timer",
--
2.7.0
Powered by blists - more mailing lists