summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorOlliver Schinagl <oliver@schinagl.nl>2017-04-03 16:18:53 +0200
committerJoe Hershberger <joe.hershberger@ni.com>2017-06-02 14:44:18 -0500
commitb233089787601d63e44d8d3ddb7d2731ef53cf4e (patch)
tree1d1baa812dca3940a19fc0aafed38bd6bd9e4d3c /drivers/net
parent6ec922fae20f791882ee455286b1fefd5372a79a (diff)
net: zynq_gem: Do not return -ENOSYS on success
The .read_rom_hwaddr net_ops hook does not check the return value, which is why it was never caught that we are currently returning 0 if the read_rom_hwaddr function return -ENOSYS and -ENOSYS otherwise. In this case we can simplify this by just returning the result of the function. Signed-off-by: Olliver Schinagl <oliver@schinagl.nl> Acked-by: Joe Hershberger <joe.hershberger@ni.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/zynq_gem.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/zynq_gem.c b/drivers/net/zynq_gem.c
index 1bb7fa576f..f3d6727a9d 100644
--- a/drivers/net/zynq_gem.c
+++ b/drivers/net/zynq_gem.c
@@ -587,14 +587,12 @@ __weak int zynq_board_read_rom_ethaddr(unsigned char *ethaddr)
static int zynq_gem_read_rom_mac(struct udevice *dev)
{
- int retval;
struct eth_pdata *pdata = dev_get_platdata(dev);
- retval = zynq_board_read_rom_ethaddr(pdata->enetaddr);
- if (retval == -ENOSYS)
- retval = 0;
+ if (!pdata)
+ return -ENOSYS;
- return retval;
+ return zynq_board_read_rom_ethaddr(pdata->enetaddr);
}
static int zynq_gem_miiphy_read(struct mii_dev *bus, int addr,