1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-12-18 11:16:16 +02:00

[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
This commit is contained in:
florian 2012-08-09 09:06:35 +00:00
parent aa4d6d46de
commit 0301cbafe2

View 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, priv->tx_addr = dma_map_single(&priv->pdev->dev, skb->data,
skb->len, DMA_TO_DEVICE); skb->len, DMA_TO_DEVICE);
if (!priv->tx_addr) if (dma_mapping_error(&priv->pdev->dev, priv->tx_addr))
return -ENOMEM; return -ENOMEM;
/* enable enhanced mode */ /* 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, priv->rx_addr = dma_map_single(&priv->pdev->dev, skb->data,
RX_ALLOC_SIZE, DMA_FROM_DEVICE); RX_ALLOC_SIZE, DMA_FROM_DEVICE);
if (!priv->rx_addr) if (dma_mapping_error(&priv->pdev->dev, priv->rx_addr))
return -ENOMEM; return -ENOMEM;
nuport_mac_writel(priv->rx_addr, RX_BUFFER_ADDR); nuport_mac_writel(priv->rx_addr, RX_BUFFER_ADDR);