summaryrefslogtreecommitdiff
path: root/drivers/timer/andes_plmt_timer.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-22 19:30:28 -0700
committerSimon Glass <sjg@chromium.org>2021-01-05 12:24:40 -0700
commit0fd3d91152df5bb6c5f7b9ee68f01a9a1c9a875d (patch)
tree1dbc5b936b98393e343cc99a40382b2734ac778e /drivers/timer/andes_plmt_timer.c
parent12559f5bab3e43b603dccfa6c354ffd7da03249c (diff)
dm: Use access methods for dev/uclass private data
Most drivers use these access methods but a few do not. Update them. In some cases the access is not permitted, so mark those with a FIXME tag for the maintainer to check. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Pratyush Yadav <p.yadav@ti.com>
Diffstat (limited to 'drivers/timer/andes_plmt_timer.c')
-rw-r--r--drivers/timer/andes_plmt_timer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/timer/andes_plmt_timer.c b/drivers/timer/andes_plmt_timer.c
index cec86718c7..db2cf86f63 100644
--- a/drivers/timer/andes_plmt_timer.c
+++ b/drivers/timer/andes_plmt_timer.c
@@ -12,6 +12,7 @@
#include <dm.h>
#include <timer.h>
#include <asm/io.h>
+#include <dm/device-internal.h>
#include <linux/err.h>
/* mtime register */
@@ -19,7 +20,7 @@
static u64 andes_plmt_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 andes_plmt_ops = {
@@ -28,8 +29,8 @@ static const struct timer_ops andes_plmt_ops = {
static int andes_plmt_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);