diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2021-03-14 20:14:59 +0800 |
---|---|---|
committer | Priyanka Jain <priyanka.jain@nxp.com> | 2021-04-15 14:22:17 +0530 |
commit | 408f056e0683b3656bce6666859448002185c2d6 (patch) | |
tree | f017b1be784ec8f5f8295bb9e18584dc10223a4a | |
parent | 534c69b09a8907799e0e5f9f85bc2f638f6c99a9 (diff) | |
download | u-boot-408f056e0683b3656bce6666859448002185c2d6.zip u-boot-408f056e0683b3656bce6666859448002185c2d6.tar.gz u-boot-408f056e0683b3656bce6666859448002185c2d6.tar.bz2 |
net: tsec: Use map_physmem() directly instead of dev_remap_addr()
dev_remap_addr() eventually calls dev_read_addr_index(), while
pdata->iobase holds the return value of dev_read_addr() that calls
dev_read_addr_index() too. Such duplication can be avoided by using
map_physmem() directly.
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
-rw-r--r-- | drivers/net/tsec.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/tsec.c b/drivers/net/tsec.c index f801d02..491d2ef 100644 --- a/drivers/net/tsec.c +++ b/drivers/net/tsec.c @@ -833,7 +833,9 @@ int tsec_probe(struct udevice *dev) data = (struct tsec_data *)dev_get_driver_data(dev); pdata->iobase = (phys_addr_t)dev_read_addr(dev); - priv->regs = dev_remap_addr(dev); + if (pdata->iobase == FDT_ADDR_T_NONE) + return -ENOENT; + priv->regs = map_physmem(pdata->iobase, 0, MAP_NOCACHE); ret = dev_read_phandle_with_args(dev, "tbi-handle", NULL, 0, 0, &phandle_args); |