mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Daniel Lezcano <daniel.lezcano@linaro.org>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: Arnd Bergmann <arnd@arndb.de>, Vineet Gupta <vgupta@synopsys.com>,
	Noam Camus <noamc@ezchip.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] clocksource: nps: fix nps_timer_init return value
Date: Mon, 13 Jun 2016 22:41:19 +0200	[thread overview]
Message-ID: <1465850493-3533419-1-git-send-email-arnd@arndb.de> (raw)

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@arndb.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

             reply	other threads:[~2016-06-13 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 20:41 Arnd Bergmann [this message]
2016-06-15 13:14 ` Daniel Lezcano

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=1465850493-3533419-1-git-send-email-arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=daniel.lezcano@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noamc@ezchip.com \
    --cc=tglx@linutronix.de \
    --cc=vgupta@synopsys.com \
    /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

all inboxes | Powered by JetHome®