mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00: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:
parent
12559f5bab
commit
0fd3d91152
113 changed files with 372 additions and 278 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue