From: Simon Glass Date: Wed, 23 Dec 2020 15:11:16 +0000 (-0700) Subject: timer: Use a shorter error in TPL X-Git-Url: http://git.dujemihanovic.xyz/img/sics.gif?a=commitdiff_plain;h=6d1a8ebefb8461f93e12b6e62efe36ca0a69e6d4;p=u-boot.git timer: Use a shorter error in TPL This error should not happen in normal use. Reduce the length of it to save space in the image. Add an empty spl.h file to sh since it appears to lack this. Signed-off-by: Simon Glass --- diff --git a/lib/time.c b/lib/time.c index 88bc50405f..cc6944ec34 100644 --- a/lib/time.c +++ b/lib/time.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -96,8 +97,13 @@ uint64_t notrace get_ticks(void) } ret = timer_get_count(gd->timer, &count); - if (ret) - panic("Could not read count from timer (err %d)\n", ret); + if (ret) { + if (spl_phase() > PHASE_TPL) + panic("Could not read count from timer (err %d)\n", + ret); + else + panic("no timer (err %d)\n", ret); + } return count; }