From: Simon Glass Date: Wed, 23 Dec 2020 08:11:16 -0700 Subject: [PATCH v2 04/21] timer: Use a shorter error in TPL In-Reply-To: <20201223151133.2205985-1-sjg@chromium.org> References: <20201223151133.2205985-1-sjg@chromium.org> Message-ID: <20201223151133.2205985-4-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 --- (no changes since v1) lib/time.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/time.c b/lib/time.c index 88bc50405ff..cc6944ec345 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; } -- 2.29.2.729.g45daf8777d-goog