Commit cdbbe3d1 authored by Michael Buesch's avatar Michael Buesch Committed by John W. Linville

b43legacy: Fix usage of struct device used for DMAing

This fixes b43legacy for the SSB DMA API change.
Signed-off-by: default avatarMichael Buesch <mb@bu3sch.de>
Cc: Stefano Brivio <stefano.brivio@polimi.it>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 4ac58469
...@@ -393,11 +393,11 @@ dma_addr_t map_descbuffer(struct b43legacy_dmaring *ring, ...@@ -393,11 +393,11 @@ dma_addr_t map_descbuffer(struct b43legacy_dmaring *ring,
dma_addr_t dmaaddr; dma_addr_t dmaaddr;
if (tx) if (tx)
dmaaddr = dma_map_single(ring->dev->dev->dev, dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
buf, len, buf, len,
DMA_TO_DEVICE); DMA_TO_DEVICE);
else else
dmaaddr = dma_map_single(ring->dev->dev->dev, dmaaddr = dma_map_single(ring->dev->dev->dma_dev,
buf, len, buf, len,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
...@@ -411,11 +411,11 @@ void unmap_descbuffer(struct b43legacy_dmaring *ring, ...@@ -411,11 +411,11 @@ void unmap_descbuffer(struct b43legacy_dmaring *ring,
int tx) int tx)
{ {
if (tx) if (tx)
dma_unmap_single(ring->dev->dev->dev, dma_unmap_single(ring->dev->dev->dma_dev,
addr, len, addr, len,
DMA_TO_DEVICE); DMA_TO_DEVICE);
else else
dma_unmap_single(ring->dev->dev->dev, dma_unmap_single(ring->dev->dev->dma_dev,
addr, len, addr, len,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
} }
...@@ -427,7 +427,7 @@ void sync_descbuffer_for_cpu(struct b43legacy_dmaring *ring, ...@@ -427,7 +427,7 @@ void sync_descbuffer_for_cpu(struct b43legacy_dmaring *ring,
{ {
B43legacy_WARN_ON(ring->tx); B43legacy_WARN_ON(ring->tx);
dma_sync_single_for_cpu(ring->dev->dev->dev, dma_sync_single_for_cpu(ring->dev->dev->dma_dev,
addr, len, DMA_FROM_DEVICE); addr, len, DMA_FROM_DEVICE);
} }
...@@ -438,7 +438,7 @@ void sync_descbuffer_for_device(struct b43legacy_dmaring *ring, ...@@ -438,7 +438,7 @@ void sync_descbuffer_for_device(struct b43legacy_dmaring *ring,
{ {
B43legacy_WARN_ON(ring->tx); B43legacy_WARN_ON(ring->tx);
dma_sync_single_for_device(ring->dev->dev->dev, dma_sync_single_for_device(ring->dev->dev->dma_dev,
addr, len, DMA_FROM_DEVICE); addr, len, DMA_FROM_DEVICE);
} }
...@@ -458,9 +458,9 @@ void free_descriptor_buffer(struct b43legacy_dmaring *ring, ...@@ -458,9 +458,9 @@ void free_descriptor_buffer(struct b43legacy_dmaring *ring,
static int alloc_ringmemory(struct b43legacy_dmaring *ring) static int alloc_ringmemory(struct b43legacy_dmaring *ring)
{ {
struct device *dev = ring->dev->dev->dev; struct device *dma_dev = ring->dev->dev->dma_dev;
ring->descbase = dma_alloc_coherent(dev, B43legacy_DMA_RINGMEMSIZE, ring->descbase = dma_alloc_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE,
&(ring->dmabase), GFP_KERNEL); &(ring->dmabase), GFP_KERNEL);
if (!ring->descbase) { if (!ring->descbase) {
b43legacyerr(ring->dev->wl, "DMA ringmemory allocation" b43legacyerr(ring->dev->wl, "DMA ringmemory allocation"
...@@ -474,9 +474,9 @@ static int alloc_ringmemory(struct b43legacy_dmaring *ring) ...@@ -474,9 +474,9 @@ static int alloc_ringmemory(struct b43legacy_dmaring *ring)
static void free_ringmemory(struct b43legacy_dmaring *ring) static void free_ringmemory(struct b43legacy_dmaring *ring)
{ {
struct device *dev = ring->dev->dev->dev; struct device *dma_dev = ring->dev->dev->dma_dev;
dma_free_coherent(dev, B43legacy_DMA_RINGMEMSIZE, dma_free_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE,
ring->descbase, ring->dmabase); ring->descbase, ring->dmabase);
} }
...@@ -886,7 +886,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, ...@@ -886,7 +886,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
goto err_kfree_meta; goto err_kfree_meta;
/* test for ability to dma to txhdr_cache */ /* test for ability to dma to txhdr_cache */
dma_test = dma_map_single(dev->dev->dev, ring->txhdr_cache, dma_test = dma_map_single(dev->dev->dma_dev, ring->txhdr_cache,
sizeof(struct b43legacy_txhdr_fw3), sizeof(struct b43legacy_txhdr_fw3),
DMA_TO_DEVICE); DMA_TO_DEVICE);
...@@ -900,7 +900,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, ...@@ -900,7 +900,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
if (!ring->txhdr_cache) if (!ring->txhdr_cache)
goto err_kfree_meta; goto err_kfree_meta;
dma_test = dma_map_single(dev->dev->dev, dma_test = dma_map_single(dev->dev->dma_dev,
ring->txhdr_cache, ring->txhdr_cache,
sizeof(struct b43legacy_txhdr_fw3), sizeof(struct b43legacy_txhdr_fw3),
DMA_TO_DEVICE); DMA_TO_DEVICE);
...@@ -910,7 +910,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev, ...@@ -910,7 +910,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
goto err_kfree_txhdr_cache; goto err_kfree_txhdr_cache;
} }
dma_unmap_single(dev->dev->dev, dma_unmap_single(dev->dev->dma_dev,
dma_test, sizeof(struct b43legacy_txhdr_fw3), dma_test, sizeof(struct b43legacy_txhdr_fw3),
DMA_TO_DEVICE); DMA_TO_DEVICE);
} }
......
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