net: gem: Setup default phy address to -1
authorMichal Simek <michal.simek@xilinx.com>
Wed, 9 Dec 2015 08:29:12 +0000 (09:29 +0100)
committerMichal Simek <michal.simek@xilinx.com>
Fri, 18 Dec 2015 12:15:58 +0000 (13:15 +0100)
Undefined phy address is -1 not 0.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
drivers/net/zynq_gem.c

index 0a41281e901d303b552ee5a20a453fd5578d9cca..b0755f5e3b482f4a36733702004d2c91f085b8c7 100644 (file)
@@ -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)