devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Iyappan Subramanian <isubramanian@apm.com>
To: davem@davemloft.net, netdev@vger.kernel.org, devicetree@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org, patches@apm.com,
	linux@armlinux.org.uk, Iyappan Subramanian <isubramanian@apm.com>
Subject: [PATCH net-next v2 03/12] drivers: net: xgene: fix: Delete descriptor rings and buffer pools
Date: Fri, 12 Aug 2016 22:05:39 -0700	[thread overview]
Message-ID: <1471064748-28033-4-git-send-email-isubramanian@apm.com> (raw)
In-Reply-To: <1471064748-28033-1-git-send-email-isubramanian@apm.com>

xgene_enet_init_hw() should delete any descriptor rings and
buffer pools setup should le_ops->cle_init() return an error.

Signed-off-by: Iyappan Subramanian <isubramanian@apm.com>
---
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index c1fd33d..6b36e0f 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -1462,10 +1462,8 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata)
 		buf_pool = pdata->rx_ring[i]->buf_pool;
 		xgene_enet_init_bufpool(buf_pool);
 		ret = xgene_enet_refill_bufpool(buf_pool, pdata->rx_buff_cnt);
-		if (ret) {
-			xgene_enet_delete_desc_rings(pdata);
-			return ret;
-		}
+		if (ret)
+			goto err;
 	}
 
 	dst_ring_num = xgene_enet_dst_ring_num(pdata->rx_ring[0]);
@@ -1482,7 +1480,7 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata)
 		ret = pdata->cle_ops->cle_init(pdata);
 		if (ret) {
 			netdev_err(ndev, "Preclass Tree init error\n");
-			return ret;
+			goto err;
 		}
 	} else {
 		pdata->port_ops->cle_bypass(pdata, dst_ring_num, buf_pool->id);
@@ -1492,6 +1490,10 @@ static int xgene_enet_init_hw(struct xgene_enet_pdata *pdata)
 	pdata->mac_ops->init(pdata);
 
 	return ret;
+
+err:
+	xgene_enet_delete_desc_rings(pdata);
+	return ret;
 }
 
 static void xgene_enet_setup_ops(struct xgene_enet_pdata *pdata)
-- 
1.9.1

  parent reply	other threads:[~2016-08-13  5:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-13  5:05 [PATCH net-next v2 00/12] Fix warning and issues Iyappan Subramanian
2016-08-13  5:05 ` [PATCH net-next v2 02/12] drivers: net: xgene: fix: Add dma_unmap_single Iyappan Subramanian
2016-08-13  5:05 ` Iyappan Subramanian [this message]
2016-08-13  5:05 ` [PATCH net-next v2 04/12] drivers: net: xgene: Fix error deconstruction path Iyappan Subramanian
2016-08-13  5:05 ` [PATCH net-next v2 05/12] drivers: net: xgene: Fix RSS indirection table fields Iyappan Subramanian
2016-08-13  5:05 ` [PATCH net-next v2 06/12] drivers: net: xgene: Change port init sequence Iyappan Subramanian
2016-08-13  5:05 ` [PATCH net-next v2 07/12] drivers: net: xgene: XFI PCS reset when link is down Iyappan Subramanian
2016-08-13  5:05 ` [PATCH net-next v2 08/12] drivers: net: xgene: Poll link status via GPIO Iyappan Subramanian
2016-08-13  5:05 ` [PATCH net-next v2 10/12] Documentation: dtb: xgene: Add rxlos GPIO mapping Iyappan Subramanian
     [not found] ` <1471064748-28033-1-git-send-email-isubramanian-qTEPVZfXA3Y@public.gmane.org>
2016-08-13  5:05   ` [PATCH net-next v2 01/12] drivers: net: xgene: Fix compiler warnings Iyappan Subramanian
2016-08-13  5:05   ` [PATCH net-next v2 09/12] dtb: xgene: Add rxlos-gpios property Iyappan Subramanian
2016-08-13  5:05   ` [PATCH net-next v2 11/12] drivers: net: xgene: Fix backward compatibility Iyappan Subramanian
2016-08-13  5:05 ` [PATCH net-next v2 12/12] dtb: " Iyappan Subramanian
2016-08-13 18:51 ` [PATCH net-next v2 00/12] Fix warning and issues David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1471064748-28033-4-git-send-email-isubramanian@apm.com \
    --to=isubramanian@apm.com \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=patches@apm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).