* [PATCH 1/2] net: fec_imx: mask mii register reads correctly
@ 2014-05-21 12:19 Sascha Hauer
2014-05-21 12:19 ` [PATCH 2/2] net: fec_imx: check return value of registration functions Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2014-05-21 12:19 UTC (permalink / raw)
To: barebox
mii registers are 16bit wide, so mask out the higher bits.
The higher bits confuse mii-tool.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/fec_imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 72e689d..714f8f2 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -89,7 +89,7 @@ static int fec_miibus_read(struct mii_bus *bus, int phyAddr, int regAddr)
/*
* it's now safe to read the PHY's register
*/
- return readl(fec->regs + FEC_MII_DATA);
+ return readl(fec->regs + FEC_MII_DATA) & 0xffff;
}
static int fec_miibus_write(struct mii_bus *bus, int phyAddr,
--
2.0.0.rc0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 2/2] net: fec_imx: check return value of registration functions
2014-05-21 12:19 [PATCH 1/2] net: fec_imx: mask mii register reads correctly Sascha Hauer
@ 2014-05-21 12:19 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2014-05-21 12:19 UTC (permalink / raw)
To: barebox
We do not care about releasing the resources in the error
path, but at least check the return value of eth_register
and mdiobus_register.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
drivers/net/fec_imx.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c
index 714f8f2..808bf8f 100644
--- a/drivers/net/fec_imx.c
+++ b/drivers/net/fec_imx.c
@@ -732,9 +732,14 @@ static int fec_probe(struct device_d *dev)
fec->miibus.priv = fec;
fec->miibus.parent = dev;
- mdiobus_register(&fec->miibus);
+ ret = mdiobus_register(&fec->miibus);
+ if (ret)
+ return ret;
+
+ ret = eth_register(edev);
+ if (ret)
+ return ret;
- eth_register(edev);
return 0;
err_free:
--
2.0.0.rc0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-05-21 12:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-21 12:19 [PATCH 1/2] net: fec_imx: mask mii register reads correctly Sascha Hauer
2014-05-21 12:19 ` [PATCH 2/2] net: fec_imx: check return value of registration functions Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox