aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-15 08:37:36 -0500
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-20 09:58:58 -0500
commitecde6cd4924205e815adf8f1b0df98965e804e7f (patch)
tree57736461cd4a21b238ac902cafaa196a16b75ea9 /drivers/dma
parentc98c17813e3985ebfd657496bfb49d7174d1fad1 (diff)
dma: mv_xor: get rid of the pdev pointer in mv_xor_device
It was only used in places where we could get the 'struct device *' pointer through a different way. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/mv_xor.c9
-rw-r--r--drivers/dma/mv_xor.h1
2 files changed, 4 insertions, 6 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 38dac0d9265c..6e705ea001da 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -308,8 +308,7 @@ mv_xor_run_tx_complete_actions(struct mv_xor_desc_slot *desc,
308 */ 308 */
309 if (desc->group_head && desc->unmap_len) { 309 if (desc->group_head && desc->unmap_len) {
310 struct mv_xor_desc_slot *unmap = desc->group_head; 310 struct mv_xor_desc_slot *unmap = desc->group_head;
311 struct device *dev = 311 struct device *dev = mv_chan_to_devp(mv_chan);
312 &mv_chan->device->pdev->dev;
313 u32 len = unmap->unmap_len; 312 u32 len = unmap->unmap_len;
314 enum dma_ctrl_flags flags = desc->async_tx.flags; 313 enum dma_ctrl_flags flags = desc->async_tx.flags;
315 u32 src_cnt; 314 u32 src_cnt;
@@ -1077,10 +1076,11 @@ static int mv_xor_channel_remove(struct mv_xor_device *device)
1077{ 1076{
1078 struct dma_chan *chan, *_chan; 1077 struct dma_chan *chan, *_chan;
1079 struct mv_xor_chan *mv_chan; 1078 struct mv_xor_chan *mv_chan;
1079 struct device *dev = device->common.dev;
1080 1080
1081 dma_async_device_unregister(&device->common); 1081 dma_async_device_unregister(&device->common);
1082 1082
1083 dma_free_coherent(&device->pdev->dev, device->pool_size, 1083 dma_free_coherent(dev, device->pool_size,
1084 device->dma_desc_pool_virt, device->dma_desc_pool); 1084 device->dma_desc_pool_virt, device->dma_desc_pool);
1085 1085
1086 list_for_each_entry_safe(chan, _chan, &device->common.channels, 1086 list_for_each_entry_safe(chan, _chan, &device->common.channels,
@@ -1123,7 +1123,6 @@ mv_xor_channel_add(struct mv_xor_private *msp,
1123 1123
1124 /* discover transaction capabilites from the platform data */ 1124 /* discover transaction capabilites from the platform data */
1125 dma_dev->cap_mask = cap_mask; 1125 dma_dev->cap_mask = cap_mask;
1126 adev->pdev = pdev;
1127 adev->shared = msp; 1126 adev->shared = msp;
1128 1127
1129 INIT_LIST_HEAD(&dma_dev->channels); 1128 INIT_LIST_HEAD(&dma_dev->channels);
@@ -1208,7 +1207,7 @@ mv_xor_channel_add(struct mv_xor_private *msp,
1208 return adev; 1207 return adev;
1209 1208
1210 err_free_dma: 1209 err_free_dma:
1211 dma_free_coherent(&adev->pdev->dev, pool_size, 1210 dma_free_coherent(&pdev->dev, pool_size,
1212 adev->dma_desc_pool_virt, adev->dma_desc_pool); 1211 adev->dma_desc_pool_virt, adev->dma_desc_pool);
1213 return ERR_PTR(ret); 1212 return ERR_PTR(ret);
1214} 1213}
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h
index 52ca6172bc6b..05add24ad772 100644
--- a/drivers/dma/mv_xor.h
+++ b/drivers/dma/mv_xor.h
@@ -70,7 +70,6 @@ struct mv_xor_private {
70 * @common: embedded struct dma_device 70 * @common: embedded struct dma_device
71 */ 71 */
72struct mv_xor_device { 72struct mv_xor_device {
73 struct platform_device *pdev;
74 dma_addr_t dma_desc_pool; 73 dma_addr_t dma_desc_pool;
75 void *dma_desc_pool_virt; 74 void *dma_desc_pool_virt;
76 size_t pool_size; 75 size_t pool_size;