diff options
author | Sean Anderson | 2020-10-07 14:37:44 -0400 |
---|---|---|
committer | Tom Rini | 2020-10-22 09:54:53 -0400 |
commit | 8af7bb914f8b2238ea37faa8e59277ba4cb26d37 (patch) | |
tree | 8bb80517f8d547e0b845354e99375938f0f3fcbc /arch/riscv/lib | |
parent | aff60aba6c44770fab8f2694ae81bafde6d22998 (diff) |
timer: Return count from timer_ops.get_count
No timer drivers return an error from get_count. Instead of possibly
returning an error, just return the count directly.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/riscv/lib')
-rw-r--r-- | arch/riscv/lib/andes_plmt.c | 6 | ||||
-rw-r--r-- | arch/riscv/lib/sifive_clint.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/arch/riscv/lib/andes_plmt.c b/arch/riscv/lib/andes_plmt.c index a28c14c1ebf..cec86718c7f 100644 --- a/arch/riscv/lib/andes_plmt.c +++ b/arch/riscv/lib/andes_plmt.c @@ -17,11 +17,9 @@ /* mtime register */ #define MTIME_REG(base) ((ulong)(base)) -static int andes_plmt_get_count(struct udevice *dev, u64 *count) +static u64 andes_plmt_get_count(struct udevice *dev) { - *count = readq((void __iomem *)MTIME_REG(dev->priv)); - - return 0; + return readq((void __iomem *)MTIME_REG(dev->priv)); } static const struct timer_ops andes_plmt_ops = { diff --git a/arch/riscv/lib/sifive_clint.c b/arch/riscv/lib/sifive_clint.c index c9704c596fa..a5572cb8255 100644 --- a/arch/riscv/lib/sifive_clint.c +++ b/arch/riscv/lib/sifive_clint.c @@ -62,11 +62,9 @@ int riscv_get_ipi(int hart, int *pending) return 0; } -static int sifive_clint_get_count(struct udevice *dev, u64 *count) +static u64 sifive_clint_get_count(struct udevice *dev) { - *count = readq((void __iomem *)MTIME_REG(dev->priv)); - - return 0; + return readq((void __iomem *)MTIME_REG(dev->priv)); } static const struct timer_ops sifive_clint_ops = { |