diff options
author | Michal Simek <michal.simek@xilinx.com> | 2018-06-13 10:00:30 +0200 |
---|---|---|
committer | Joe Hershberger <joe.hershberger@ni.com> | 2018-06-13 13:54:17 -0500 |
commit | b33d4a5fc7d2c67d11d936351c05856f0696d306 (patch) | |
tree | f8f8871ec0e36fb4fc7deb2ecfca9b5a5a03e5f5 /drivers/net | |
parent | 5194ed7edca2ca4eaa2a48a6ef248432e3a4421e (diff) | |
download | u-boot-b33d4a5fc7d2c67d11d936351c05856f0696d306.tar.gz |
net: zynq_gem: Fix return type for phy...()
wait_for_bit_le32 returns negative value on failure. Fix phy...() to
handle these failures properly.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Joe Hershberger <joe.hershberger@ni.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/zynq_gem.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c index a218c92314..d1436807ff 100644 --- a/drivers/net/zynq_gem.c +++ b/drivers/net/zynq_gem.c @@ -185,7 +185,7 @@ struct zynq_gem_priv { bool int_pcs; }; -static u32 phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum, +static int phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum, u32 op, u16 *data) { u32 mgtcr; @@ -216,10 +216,10 @@ static u32 phy_setup_op(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum, return 0; } -static u32 phyread(struct zynq_gem_priv *priv, u32 phy_addr, +static int phyread(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum, u16 *val) { - u32 ret; + int ret; ret = phy_setup_op(priv, phy_addr, regnum, ZYNQ_GEM_PHYMNTNC_OP_R_MASK, val); @@ -231,7 +231,7 @@ static u32 phyread(struct zynq_gem_priv *priv, u32 phy_addr, return ret; } -static u32 phywrite(struct zynq_gem_priv *priv, u32 phy_addr, +static int phywrite(struct zynq_gem_priv *priv, u32 phy_addr, u32 regnum, u16 data) { debug("%s: phy_addr %d, regnum 0x%x, data 0x%x\n", __func__, phy_addr, |