Skip to contentSkip to conversation

ixp4xx_eth: avoid calling dma_pool_create() with NULL dev

RFC PATCH Applied Xi Wang 2 participants 4 messages Nov 18, 2012 – Nov 20, 2012

Subsystems (3)
lore
Share & tools
lore

Xi Wang

author
#0 lore raw

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

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

Cc Andrew Morton <[email protected]>

---
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(-)
drivers/net/ethernet/xscale/ixp4xx_eth.c +5 -3
index 98934bd..477d672 100644
@@ -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)))
Signature · 1 line
1.7.10.4
author
#1 lore raw

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

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

Cc Andrew Morton <[email protected]>

---
See also
https://lkml.org/lkml/2012/11/14/11

---
 drivers/net/wan/ixp4xx_hss.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wan/ixp4xx_hss.c +5 -3
index 3f575af..e9a3da5 100644
@@ -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)))
Signature · 1 line
1.7.10.4