From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758294AbcIHN6g (ORCPT ); Thu, 8 Sep 2016 09:58:36 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36263 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758141AbcIHN6e (ORCPT ); Thu, 8 Sep 2016 09:58:34 -0400 From: Daniel Lezcano To: joel@jms.id.au Cc: tglx@linutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] clocksource/drivers/moxart: Replace panic by pr_err Date: Thu, 8 Sep 2016 15:58:10 +0200 Message-Id: <1473343090-29208-2-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1473343090-29208-1-git-send-email-daniel.lezcano@linaro.org> References: <1473343090-29208-1-git-send-email-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/clocksource/moxart_timer.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/moxart_timer.c b/drivers/clocksource/moxart_timer.c index cba25b7..2a8f470 100644 --- a/drivers/clocksource/moxart_timer.c +++ b/drivers/clocksource/moxart_timer.c @@ -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); -- 1.9.1