]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
xilinx_phy: Pass correct pointer to fdtdec_get_int()
authorKamensky Ivan <kamensky.ivan@mail.ru>
Tue, 27 Dec 2016 16:12:23 +0000 (19:12 +0300)
committerMichal Simek <michal.simek@xilinx.com>
Wed, 11 Jan 2017 13:11:20 +0000 (14:11 +0100)
This patch fixes incorrect pointer on offset device in device tree blob.
When using with the component "Ethernet 1G/2.5G BASE-X PCS/PMA or SGMII"
it does not understand what type is XAE_PHY_TYPE_1000BASE_X and trying
to change frequency.

Signed-off-by: Kamensky Ivan <kamensky.ivan@mail.ru>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/net/phy/xilinx_phy.c

index f3eaf2e97ced67787b9eba32cf1049086281fea8..b1946f023ab0757950e89241ec43082b3c915112 100644 (file)
@@ -101,11 +101,10 @@ static int xilinxphy_startup(struct phy_device *phydev)
 
 static int xilinxphy_of_init(struct phy_device *phydev)
 {
-       struct udevice *dev = (struct udevice *)&phydev->dev;
        u32 phytype;
 
        debug("%s\n", __func__);
-       phytype = fdtdec_get_int(gd->fdt_blob, dev->of_offset, "phy-type", -1);
+       phytype = fdtdec_get_int(gd->fdt_blob, phydev->dev->of_offset, "phy-type", -1);
        if (phytype == XAE_PHY_TYPE_1000BASE_X)
                phydev->flags |= XAE_PHY_TYPE_1000BASE_X;