[U-Boot] [PATCH v2 1/5] net: gem: Setup default phy address to -1

Michal Simek michal.simek at xilinx.com
Thu Dec 17 12:57:05 CET 2015


Undefined phy address is -1 not 0.

Signed-off-by: Michal Simek <michal.simek at xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger at ni.com>
---

Changes in v2: None

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

diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 0a41281e901d..b0755f5e3b48 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -666,11 +666,12 @@ static int zynq_gem_ofdata_to_platdata(struct udevice *dev)
 	priv->iobase = (struct zynq_gem_regs *)pdata->iobase;
 	/* Hardcode for now */
 	priv->emio = 0;
+	priv->phyaddr = -1;
 
 	offset = fdtdec_lookup_phandle(gd->fdt_blob, dev->of_offset,
 				       "phy-handle");
 	if (offset > 0)
-		priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", 0);
+		priv->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, "reg", -1);
 
 	phy_mode = fdt_getprop(gd->fdt_blob, dev->of_offset, "phy-mode", NULL);
 	if (phy_mode)
-- 
1.9.1



More information about the U-Boot mailing list