summaryrefslogtreecommitdiff
path: root/drivers/net/macb.c
diff options
context:
space:
mode:
authorRamon Fried <ramon.fried@gmail.com>2018-12-27 19:58:42 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2019-01-24 11:35:29 -0600
commit9043c4e0fc130aba5a1f4161885c9d97b5d8a73f (patch)
treea4913f64b4a171dc48c9ef2b85ad2f046a0863af /drivers/net/macb.c
parent18bfc8fa84cd6d748c134b6265786f7d8226f86c (diff)
net: macb: fix mapping of registers
Some architectures (MIPS) needs mapping to access IOMEM. Fix that. Fixes: f1dcc19b213d ("net: macb: Convert to driver model") Signed-off-by: Ramon Fried <ramon.fried@gmail.com> Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net/macb.c')
-rw-r--r--drivers/net/macb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 94c89c762b..c9ee22279a 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -1151,7 +1151,9 @@ static int macb_eth_ofdata_to_platdata(struct udevice *dev)
{
struct eth_pdata *pdata = dev_get_platdata(dev);
- pdata->iobase = devfdt_get_addr(dev);
+ pdata->iobase = (phys_addr_t)dev_remap_addr(dev);
+ if (!pdata->iobase)
+ return -EINVAL;
return macb_late_eth_ofdata_to_platdata(dev);
}