Commit 74e0deb8 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David S. Miller

lantiq_etop: pass struct device to DMA API functions

The DMA API generally relies on a struct device to work properly, and
only barely works without one for legacy reasons.  Pass the easily
available struct device from the platform_device to remedy this.

Note this driver seems to lack dma_unmap_* calls entirely, but fixing
that is left for another time.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 564923e4
...@@ -112,10 +112,12 @@ struct ltq_etop_priv { ...@@ -112,10 +112,12 @@ struct ltq_etop_priv {
static int static int
ltq_etop_alloc_skb(struct ltq_etop_chan *ch) ltq_etop_alloc_skb(struct ltq_etop_chan *ch)
{ {
struct ltq_etop_priv *priv = netdev_priv(ch->netdev);
ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN); ch->skb[ch->dma.desc] = netdev_alloc_skb(ch->netdev, MAX_DMA_DATA_LEN);
if (!ch->skb[ch->dma.desc]) if (!ch->skb[ch->dma.desc])
return -ENOMEM; return -ENOMEM;
ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(NULL, ch->dma.desc_base[ch->dma.desc].addr = dma_map_single(&priv->pdev->dev,
ch->skb[ch->dma.desc]->data, MAX_DMA_DATA_LEN, ch->skb[ch->dma.desc]->data, MAX_DMA_DATA_LEN,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
ch->dma.desc_base[ch->dma.desc].addr = ch->dma.desc_base[ch->dma.desc].addr =
...@@ -487,7 +489,7 @@ ltq_etop_tx(struct sk_buff *skb, struct net_device *dev) ...@@ -487,7 +489,7 @@ ltq_etop_tx(struct sk_buff *skb, struct net_device *dev)
netif_trans_update(dev); netif_trans_update(dev);
spin_lock_irqsave(&priv->lock, flags); spin_lock_irqsave(&priv->lock, flags);
desc->addr = ((unsigned int) dma_map_single(NULL, skb->data, len, desc->addr = ((unsigned int) dma_map_single(&priv->pdev->dev, skb->data, len,
DMA_TO_DEVICE)) - byte_offset; DMA_TO_DEVICE)) - byte_offset;
wmb(); wmb();
desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP | desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP |
......
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