mirror of
https://xff.cz/git/u-boot/
synced 2025-11-01 19:05:51 +01:00
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>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user