diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-15 12:47:21 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-15 12:47:21 -0700 |
commit | 866a30efdcb63a330b480600d0b501547f9a5a58 (patch) | |
tree | d6036c3c852eaf8febcdefc6a25068c768514f4a /arch/nios2/kernel/time.c | |
parent | 418702b91073ed0dae774189f69b335cbc92f84d (diff) | |
parent | 65d1e3ddeae117f6a224535e10a09145f0f96508 (diff) | |
download | linux-next-866a30efdcb63a330b480600d0b501547f9a5a58.tar.gz |
Merge tag 'nios2-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2
Pull arch/nios2 update from Ley Foon Tan.
* tag 'nios2-v4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/lftan/nios2:
nios2: time: Read timer in get_cycles only if initialized
nios2: add earlycon support to 3c120 devboard DTS
Diffstat (limited to 'arch/nios2/kernel/time.c')
-rw-r--r-- | arch/nios2/kernel/time.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/nios2/kernel/time.c b/arch/nios2/kernel/time.c index 645129aaa9a0..20e86209ef2e 100644 --- a/arch/nios2/kernel/time.c +++ b/arch/nios2/kernel/time.c @@ -107,7 +107,10 @@ static struct nios2_clocksource nios2_cs = { cycles_t get_cycles(void) { - return nios2_timer_read(&nios2_cs.cs); + /* Only read timer if it has been initialized */ + if (nios2_cs.timer.base) + return nios2_timer_read(&nios2_cs.cs); + return 0; } EXPORT_SYMBOL(get_cycles); |