Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 296315
b: refs/heads/master
c: 22f0bf9
h: refs/heads/master
i:
  296313: e0c7452
  296311: 10e0992
v: v3
  • Loading branch information
Russell King committed Feb 9, 2012
1 parent 0e39864 commit dfa8b52
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15877e9c8a12ced38ac31d8bf4f93f3634fbea3f
refs/heads/master: 22f0bf96de1506081a8b18ad3e0d04d5add70a4a
16 changes: 14 additions & 2 deletions trunk/drivers/net/irda/sa1100_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
return 0;

si->rxskb = alloc_skb(HPSIR_MAX_RXLEN + 1, GFP_ATOMIC);

if (!si->rxskb) {
printk(KERN_ERR "sa1100_ir: out of memory for RX SKB\n");
return -ENOMEM;
Expand All @@ -97,6 +96,11 @@ static int sa1100_irda_rx_alloc(struct sa1100_irda *si)
si->rxbuf_dma = dma_map_single(si->dev, si->rxskb->data,
HPSIR_MAX_RXLEN,
DMA_FROM_DEVICE);
if (dma_mapping_error(si->dev, si->rxbuf_dma)) {
dev_kfree_skb_any(si->rxskb);
return -ENOMEM;
}

return 0;
}

Expand Down Expand Up @@ -518,7 +522,8 @@ static void sa1100_irda_fir_error(struct sa1100_irda *si, struct net_device *dev
netif_rx(skb);
} else {
/*
* Remap the buffer.
* Remap the buffer - it was previously mapped, and we
* hope that this succeeds.
*/
si->rxbuf_dma = dma_map_single(si->dev, si->rxskb->data,
HPSIR_MAX_RXLEN,
Expand Down Expand Up @@ -701,6 +706,13 @@ static int sa1100_irda_hard_xmit(struct sk_buff *skb, struct net_device *dev)
si->txskb = skb;
si->txbuf_dma = dma_map_single(si->dev, skb->data,
skb->len, DMA_TO_DEVICE);
if (dma_mapping_error(si->dev, si->txbuf_dma)) {
si->txskb = NULL;
netif_wake_queue(dev);
dev->stats.tx_dropped++;
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}

sa1100_start_dma(si->txdma, si->txbuf_dma, skb->len);

Expand Down

0 comments on commit dfa8b52

Please sign in to comment.