aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2012-08-09 09:06:35 +0000
committerFlorian Fainelli <florian@openwrt.org>2012-08-09 09:06:35 +0000
commit8e1f8a2085954b602a17f4b1221c4e509fb9dfba (patch)
treee470cd89dd85d0dc7ada1a57ba22d41fe5312794
parent9ded359521b7b8de47cb01c2ed6c53f6922b504c (diff)
downloadmaster-187ad058-8e1f8a2085954b602a17f4b1221c4e509fb9dfba.tar.gz
master-187ad058-8e1f8a2085954b602a17f4b1221c4e509fb9dfba.tar.bz2
master-187ad058-8e1f8a2085954b602a17f4b1221c4e509fb9dfba.zip
[mcs814x] nuport-mac: use dma_mapping_error() instead of checking pointers
Thanks Gabor for spotting this git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33071 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
index 833e6fa018..a2f7ee2cd5 100644
--- a/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
+++ b/target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c
@@ -256,7 +256,7 @@ static int nuport_mac_start_tx_dma(struct nuport_mac_priv *priv,
priv->tx_addr = dma_map_single(&priv->pdev->dev, skb->data,
skb->len, DMA_TO_DEVICE);
- if (!priv->tx_addr)
+ if (dma_mapping_error(&priv->pdev->dev, priv->tx_addr))
return -ENOMEM;
/* enable enhanced mode */
@@ -299,7 +299,7 @@ static int nuport_mac_start_rx_dma(struct nuport_mac_priv *priv,
priv->rx_addr = dma_map_single(&priv->pdev->dev, skb->data,
RX_ALLOC_SIZE, DMA_FROM_DEVICE);
- if (!priv->rx_addr)
+ if (dma_mapping_error(&priv->pdev->dev, priv->rx_addr))
return -ENOMEM;
nuport_mac_writel(priv->rx_addr, RX_BUFFER_ADDR);