Skip to contentSkip to conversation

bcmsysport:Fix error handling in the function bcm_sysport_init_rx_ring

PATCH Florian Fainelli 1 participant 1 message Jul 17, 2015 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Florian Fainelli

author Reviewed-by Tested-by
#1 lore raw
Quoted 5 lines · Nicholas Krause

This fixes the error handling in the function bcm_sysport_init_rx_ringi after calling the function rdma_enable_set to make sure the return value is equal to zero and if not print on the console failed to enable RDMA for the device and return the failed error code returned by rdma_enable_set.

Subject should be starting with "net: systemport: ", otherwise, this looks good to me:

Quoted 25 lines
---
 drivers/net/ethernet/broadcom/bcmsysport.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bcmsysport.c +6 -1
index 4566cdf..27a7b36 100644
@@ -1365,7 +1365,12 @@ static int bcm_sysport_init_rx_ring(struct bcm_sysport_priv *priv)
 	/* Initialize HW, ensure RDMA is disabled */
 	reg = rdma_readl(priv, RDMA_STATUS);
 	if (!(reg & RDMA_DISABLED))
-		rdma_enable_set(priv, 0);
+		ret = rdma_enable_set(priv, 0);
+
+	if (ret) {
+		netif_err(priv, hw, priv->netdev, "failed to enable RDMA\n");
+		return ret;
+	}
 
 	rdma_writel(priv, 0, RDMA_WRITE_PTR_LO);
 	rdma_writel(priv, 0, RDMA_WRITE_PTR_HI);
Signature · 1 line
Florian