Skip to contentSkip to conversation

net: macb: fix mapping of registers

PATCH In review Ramon Fried 2 participants 3 messages Dec 27, 2018 – Jan 24, 2019 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: macb: fix mapping of registers

Some architectures (MIPS) needs mapping to access IOMEM. Fix that.

Fixes f1dcc19b213d ("net: macb: Convert to driver model")

---
v2: add casting to phys_addr_t to prevent warning from compiler.

 drivers/net/macb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/macb.c +3 -1
index 94c89c762b..c9ee22279a 100644
@@ -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);
 }
Signature · 1 line
2.19.2