[tip:timers/core] clocksource/drivers/moxart: Replace panic by pr_err

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  e2a2d38501cb759333342d97442b3742830752ca
Gitweb:     http://git.kernel.org/tip/e2a2d38501cb759333342d97442b3742830752ca
Author:     Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
AuthorDate: Thu, 8 Sep 2016 14:25:40 +0200
Committer:  Daniel Lezcano <daniel.lezcano@xxxxxxxxxx>
CommitDate: Mon, 12 Sep 2016 07:28:38 +0200

clocksource/drivers/moxart: Replace panic by pr_err

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@xxxxxxxxxx>
Acked-by: Joel Stanley <joel@xxxxxxxxx>
---
 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);
 
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux