]> git.karo-electronics.de Git - linux-beck.git/commitdiff
clocksource/drivers/moxart: Replace panic by pr_err
authorDaniel Lezcano <daniel.lezcano@linaro.org>
Thu, 8 Sep 2016 12:25:40 +0000 (14:25 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 12 Sep 2016 05:28:38 +0000 (07:28 +0200)
The clksrc-of code is supposed to catch the return code and fail gracefully.

Don't panic on error, but print the error and exit with a relevant error
code.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Joel Stanley <joel@jms.id.au>
drivers/clocksource/moxart_timer.c

index cba25b75c29b6ca2112e63325e03eff1fc2612bd..2a8f4705c734df7c2cc99f8a532a55cc0cbbe231 100644 (file)
@@ -184,8 +184,10 @@ static int __init moxart_timer_init(struct device_node *node)
        } else if (of_device_is_compatible(node, "aspeed,ast2400-timer")) {
                timer->t1_enable_val = ASPEED_TIMER1_ENABLE;
                timer->t1_disable_val = ASPEED_TIMER1_DISABLE;
-       } else
-               panic("%s: unknown platform\n", node->full_name);
+       } else {
+               pr_err("%s: unknown platform\n", node->full_name);
+               return -EINVAL;
+       }
 
        timer->count_per_tick = DIV_ROUND_CLOSEST(pclk, HZ);