diff mbox series

[U-Boot,v2] net: macb: fix mapping of registers

Message ID 20181227175842.31216-1-ramon.fried@gmail.com
State Accepted
Commit 9043c4e0fc130aba5a1f4161885c9d97b5d8a73f
Delegated to: Joe Hershberger
Headers show
Series [U-Boot,v2] net: macb: fix mapping of registers | expand

Commit Message

Ramon Fried Dec. 27, 2018, 5:58 p.m. UTC
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>
---
v2: add casting to phys_addr_t to prevent warning from compiler.

 drivers/net/macb.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Joe Hershberger Jan. 22, 2019, 10 p.m. UTC | #1
On Thu, Dec 27, 2018 at 11:59 AM Ramon Fried <ramon.fried@gmail.com> wrote:
>
> 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>
Joe Hershberger Jan. 24, 2019, 5:38 p.m. UTC | #2
Hi Ramon,

https://patchwork.ozlabs.org/patch/1018949/ was applied to http://git.denx.de/?p=u-boot/u-boot-net.git

Thanks!
-Joe
diff mbox series

Patch

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);
 }