diff options
author | Stephan Gerhold <stephan@gerhold.net> | 2021-07-02 18:00:13 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-07-14 16:47:57 -0400 |
commit | 0e6956cc7d5c3f050544a268746d79e342d8a40d (patch) | |
tree | 5d7d2e1b3b270dfc71cc857d75a3b198be6d7dad /drivers | |
parent | 1e0b4c07bf3b437471563f9921812bc38f2563d5 (diff) | |
download | u-boot-0e6956cc7d5c3f050544a268746d79e342d8a40d.tar.gz u-boot-0e6956cc7d5c3f050544a268746d79e342d8a40d.tar.bz2 u-boot-0e6956cc7d5c3f050544a268746d79e342d8a40d.zip |
timer: nomadik-mtu: Use dev_read_addr_ptr()
Simplify the code a bit by using dev_read_addr_ptr() instead of
dev_read_addr(). This avoids having to cast explicitly to the
struct nomadik_mtu_regs.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/timer/nomadik-mtu-timer.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/timer/nomadik-mtu-timer.c b/drivers/timer/nomadik-mtu-timer.c index 417b419d46..4d24de14ae 100644 --- a/drivers/timer/nomadik-mtu-timer.c +++ b/drivers/timer/nomadik-mtu-timer.c @@ -67,14 +67,11 @@ static int nomadik_mtu_probe(struct udevice *dev) struct timer_dev_priv *uc_priv = dev_get_uclass_priv(dev); struct nomadik_mtu_priv *priv = dev_get_priv(dev); struct nomadik_mtu_regs *mtu; - fdt_addr_t addr; u32 prescale; - addr = dev_read_addr(dev); - if (addr == FDT_ADDR_T_NONE) + mtu = dev_read_addr_ptr(dev); + if (!mtu) return -EINVAL; - - mtu = (struct nomadik_mtu_regs *)addr; priv->timer = mtu->timers; /* Use first timer */ if (!uc_priv->clock_rate) |