diff options
author | Lendacky, Thomas <Thomas.Lendacky@amd.com> | 2017-01-20 19:14:13 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-22 22:57:14 +0100 |
commit | 738f7f647371ff4cfc9646c99dba5b58ad142db3 (patch) | |
tree | 1ae1371dc4273cb2ae058ee6eb6122fc05bd13e2 /drivers | |
parent | amd-xgbe: Add a hardware quirk for register definitions (diff) | |
download | linux-738f7f647371ff4cfc9646c99dba5b58ad142db3.tar.xz linux-738f7f647371ff4cfc9646c99dba5b58ad142db3.zip |
amd-xgbe: Check xgbe_init() return code
The xgbe_init() routine returns a return code indicating success or
failure, but the return code is not checked. Add code to xgbe_init()
to issue a message when failures are seen and add code to check the
xgbe_init() return code.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-dev.c | 4 | ||||
-rw-r--r-- | drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c index c8e8a4a271ec..a7d16db5c4b2 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-dev.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-dev.c @@ -3407,8 +3407,10 @@ static int xgbe_init(struct xgbe_prv_data *pdata) /* Flush Tx queues */ ret = xgbe_flush_tx_queues(pdata); - if (ret) + if (ret) { + netdev_err(pdata->netdev, "error flushing TX queues\n"); return ret; + } /* * Initialize DMA related features diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 9943629fcbf9..1c87cc204075 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -1070,7 +1070,9 @@ static int xgbe_start(struct xgbe_prv_data *pdata) DBGPR("-->xgbe_start\n"); - hw_if->init(pdata); + ret = hw_if->init(pdata); + if (ret) + return ret; xgbe_napi_enable(pdata, 1); |