[PATCH RFC 1/2] ixp4xx_eth: avoid calling dma_pool_create() with NULL dev

Subsystems: arm/intel ixp4xx arm architecture, networking drivers, the rest

STALE5019d

4 messages, 2 authors, 2012-11-20 · open the first message on its own page

[PATCH RFC 1/2] ixp4xx_eth: avoid calling dma_pool_create() with NULL dev

From: Xi Wang <xi.wang@gmail.com>
Date: 2012-11-18 06:25:22

Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
See also
https://lkml.org/lkml/2012/11/14/11
---
 drivers/net/ethernet/xscale/ixp4xx_eth.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 98934bd..477d672 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1102,10 +1102,12 @@ static int init_queues(struct port *port)
 {
 	int i;
 
-	if (!ports_open)
-		if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
-						 POOL_ALLOC_SIZE, 32, 0)))
+	if (!ports_open) {
+		dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
+					   POOL_ALLOC_SIZE, 32, 0);
+		if (!dma_pool)
 			return -ENOMEM;
+	}
 
 	if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
 					      &port->desc_tab_phys)))
-- 
1.7.10.4

[PATCH RFC 2/2] ixp4xx_hss: avoid calling dma_pool_create() with NULL dev

From: Xi Wang <xi.wang@gmail.com>
Date: 2012-11-18 06:25:23

Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
See also
https://lkml.org/lkml/2012/11/14/11
---
 drivers/net/wan/ixp4xx_hss.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wan/ixp4xx_hss.c b/drivers/net/wan/ixp4xx_hss.c
index 3f575af..e9a3da5 100644
--- a/drivers/net/wan/ixp4xx_hss.c
+++ b/drivers/net/wan/ixp4xx_hss.c
@@ -969,10 +969,12 @@ static int init_hdlc_queues(struct port *port)
 {
 	int i;
 
-	if (!ports_open)
-		if (!(dma_pool = dma_pool_create(DRV_NAME, NULL,
-						 POOL_ALLOC_SIZE, 32, 0)))
+	if (!ports_open) {
+		dma_pool = dma_pool_create(DRV_NAME, &port->netdev->dev,
+					   POOL_ALLOC_SIZE, 32, 0);
+		if (!dma_pool)
 			return -ENOMEM;
+	}
 
 	if (!(port->desc_tab = dma_pool_alloc(dma_pool, GFP_KERNEL,
 					      &port->desc_tab_phys)))
-- 
1.7.10.4

Re: [PATCH RFC 1/2] ixp4xx_eth: avoid calling dma_pool_create() with NULL dev

From: David Miller <davem@davemloft.net>
Date: 2012-11-20 20:13:26

From: Xi Wang <xi.wang@gmail.com>
Date: Sun, 18 Nov 2012 01:25:09 -0500
Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Applied.

Re: [PATCH RFC 2/2] ixp4xx_hss: avoid calling dma_pool_create() with NULL dev

From: David Miller <davem@davemloft.net>
Date: 2012-11-20 20:13:31

From: Xi Wang <xi.wang@gmail.com>
Date: Sun, 18 Nov 2012 01:25:10 -0500
Use &port->netdev->dev instead of NULL since dma_pool_create() doesn't
allow NULL dev.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help