diff options
Diffstat (limited to 'drivers/timer/sifive_clint_timer.c')
-rw-r--r-- | drivers/timer/sifive_clint_timer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/timer/sifive_clint_timer.c b/drivers/timer/sifive_clint_timer.c index 00ce0f08d6..de23b85404 100644 --- a/drivers/timer/sifive_clint_timer.c +++ b/drivers/timer/sifive_clint_timer.c @@ -9,6 +9,7 @@ #include <dm.h> #include <timer.h> #include <asm/io.h> +#include <dm/device-internal.h> #include <linux/err.h> /* mtime register */ @@ -16,7 +17,7 @@ static u64 sifive_clint_get_count(struct udevice *dev) { - return readq((void __iomem *)MTIME_REG(dev->priv)); + return readq((void __iomem *)MTIME_REG(dev_get_priv(dev))); } static const struct timer_ops sifive_clint_ops = { @@ -25,8 +26,8 @@ static const struct timer_ops sifive_clint_ops = { static int sifive_clint_probe(struct udevice *dev) { - dev->priv = dev_read_addr_ptr(dev); - if (!dev->priv) + dev_set_priv(dev, dev_read_addr_ptr(dev)); + if (!dev_get_priv(dev)) return -EINVAL; return timer_timebase_fallback(dev); |