Commit d4b0a4c1 authored by Olof Johansson's avatar Olof Johansson Committed by Jeff Garzik

[PATCH] spidernet: Use pci_dma_mapping_error()

A driver shouldn't compare to DMA_ERROR_CODE directly, use
pci_dma_mapping_error() instead.
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent c73a29da
...@@ -317,7 +317,7 @@ spider_net_init_chain(struct spider_net_card *card, ...@@ -317,7 +317,7 @@ spider_net_init_chain(struct spider_net_card *card,
SPIDER_NET_DESCR_SIZE, SPIDER_NET_DESCR_SIZE,
direction); direction);
if (buf == DMA_ERROR_CODE) if (pci_dma_mapping_error(buf))
goto iommu_error; goto iommu_error;
descr->bus_addr = buf; descr->bus_addr = buf;
...@@ -420,7 +420,7 @@ spider_net_prepare_rx_descr(struct spider_net_card *card, ...@@ -420,7 +420,7 @@ spider_net_prepare_rx_descr(struct spider_net_card *card,
buf = pci_map_single(card->pdev, descr->skb->data, buf = pci_map_single(card->pdev, descr->skb->data,
SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE); SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
descr->buf_addr = buf; descr->buf_addr = buf;
if (buf == DMA_ERROR_CODE) { if (pci_dma_mapping_error(buf)) {
dev_kfree_skb_any(descr->skb); dev_kfree_skb_any(descr->skb);
if (netif_msg_rx_err(card) && net_ratelimit()) if (netif_msg_rx_err(card) && net_ratelimit())
pr_err("Could not iommu-map rx buffer\n"); pr_err("Could not iommu-map rx buffer\n");
...@@ -649,7 +649,7 @@ spider_net_prepare_tx_descr(struct spider_net_card *card, ...@@ -649,7 +649,7 @@ spider_net_prepare_tx_descr(struct spider_net_card *card,
dma_addr_t buf; dma_addr_t buf;
buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE); buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
if (buf == DMA_ERROR_CODE) { if (pci_dma_mapping_error(buf)) {
if (netif_msg_tx_err(card) && net_ratelimit()) if (netif_msg_tx_err(card) && net_ratelimit())
pr_err("could not iommu-map packet (%p, %i). " pr_err("could not iommu-map packet (%p, %i). "
"Dropping packet\n", skb->data, skb->len); "Dropping packet\n", skb->data, skb->len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment