nuport-mac: use dma_mapping_error() instead of checking pointers
authorFlorian Fainelli <florian@openwrt.org>
Thu, 9 Aug 2012 09:06:35 +0000 (09:06 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 9 Aug 2012 09:06:35 +0000 (09:06 +0000)
Thanks Gabor for spotting this

SVN-Revision: 33071

target/linux/mcs814x/files-3.3/drivers/net/ethernet/mcs8140/nuport_mac.c

index 833e6fa018186bd38d21f891e6130bf3202f8154..a2f7ee2cd548c4adfcbec53ea49040069abf454f 100644 (file)
@@ -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);