linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource: nps: fix nps_timer_init return value
@ 2016-06-13 20:41 Arnd Bergmann
  2016-06-15 13:14 ` Daniel Lezcano
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2016-06-13 20:41 UTC (permalink / raw)
  To: Daniel Lezcano, Thomas Gleixner
  Cc: Arnd Bergmann, Vineet Gupta, Noam Camus, linux-kernel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clocksource: nps: fix nps_timer_init return value
  2016-06-13 20:41 [PATCH] clocksource: nps: fix nps_timer_init return value Arnd Bergmann
@ 2016-06-15 13:14 ` Daniel Lezcano
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Lezcano @ 2016-06-15 13:14 UTC (permalink / raw)
  To: Arnd Bergmann, Thomas Gleixner; +Cc: Vineet Gupta, Noam Camus, linux-kernel

On 06/13/2016 10:41 PM, Arnd Bergmann wrote:
> 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>
> ---

Thanks, I integrated this change with the series.

   -- Daniel


-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-06-15 13:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 20:41 [PATCH] clocksource: nps: fix nps_timer_init return value Arnd Bergmann
2016-06-15 13:14 ` Daniel Lezcano

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).