diff options
-rw-r--r-- | drivers/dma/mv_xor.c | 10 | ||||
-rw-r--r-- | drivers/dma/mv_xor.h | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index 610d0b886cd6..704277259a5b 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -604,9 +604,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan) | |||
604 | int idx; | 604 | int idx; |
605 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); | 605 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); |
606 | struct mv_xor_desc_slot *slot = NULL; | 606 | struct mv_xor_desc_slot *slot = NULL; |
607 | struct mv_xor_platform_data *plat_data = | 607 | int num_descs_in_pool = mv_chan->device->pool_size/MV_XOR_SLOT_SIZE; |
608 | mv_chan->device->pdev->dev.platform_data; | ||
609 | int num_descs_in_pool = plat_data->pool_size/MV_XOR_SLOT_SIZE; | ||
610 | 608 | ||
611 | /* Allocate descriptor slots */ | 609 | /* Allocate descriptor slots */ |
612 | idx = mv_chan->slots_allocated; | 610 | idx = mv_chan->slots_allocated; |
@@ -1084,11 +1082,10 @@ static int __devexit mv_xor_remove(struct platform_device *dev) | |||
1084 | struct mv_xor_device *device = platform_get_drvdata(dev); | 1082 | struct mv_xor_device *device = platform_get_drvdata(dev); |
1085 | struct dma_chan *chan, *_chan; | 1083 | struct dma_chan *chan, *_chan; |
1086 | struct mv_xor_chan *mv_chan; | 1084 | struct mv_xor_chan *mv_chan; |
1087 | struct mv_xor_platform_data *plat_data = dev->dev.platform_data; | ||
1088 | 1085 | ||
1089 | dma_async_device_unregister(&device->common); | 1086 | dma_async_device_unregister(&device->common); |
1090 | 1087 | ||
1091 | dma_free_coherent(&dev->dev, plat_data->pool_size, | 1088 | dma_free_coherent(&dev->dev, device->pool_size, |
1092 | device->dma_desc_pool_virt, device->dma_desc_pool); | 1089 | device->dma_desc_pool_virt, device->dma_desc_pool); |
1093 | 1090 | ||
1094 | list_for_each_entry_safe(chan, _chan, &device->common.channels, | 1091 | list_for_each_entry_safe(chan, _chan, &device->common.channels, |
@@ -1120,8 +1117,9 @@ static int __devinit mv_xor_probe(struct platform_device *pdev) | |||
1120 | * note: writecombine gives slightly better performance, but | 1117 | * note: writecombine gives slightly better performance, but |
1121 | * requires that we explicitly flush the writes | 1118 | * requires that we explicitly flush the writes |
1122 | */ | 1119 | */ |
1120 | adev->pool_size = plat_data->pool_size; | ||
1123 | adev->dma_desc_pool_virt = dma_alloc_writecombine(&pdev->dev, | 1121 | adev->dma_desc_pool_virt = dma_alloc_writecombine(&pdev->dev, |
1124 | plat_data->pool_size, | 1122 | adev->pool_size, |
1125 | &adev->dma_desc_pool, | 1123 | &adev->dma_desc_pool, |
1126 | GFP_KERNEL); | 1124 | GFP_KERNEL); |
1127 | if (!adev->dma_desc_pool_virt) | 1125 | if (!adev->dma_desc_pool_virt) |
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h index a5b422f5a8ab..a0641aebbdef 100644 --- a/drivers/dma/mv_xor.h +++ b/drivers/dma/mv_xor.h | |||
@@ -72,6 +72,7 @@ struct mv_xor_device { | |||
72 | int id; | 72 | int id; |
73 | dma_addr_t dma_desc_pool; | 73 | dma_addr_t dma_desc_pool; |
74 | void *dma_desc_pool_virt; | 74 | void *dma_desc_pool_virt; |
75 | size_t pool_size; | ||
75 | struct dma_device common; | 76 | struct dma_device common; |
76 | struct mv_xor_shared_private *shared; | 77 | struct mv_xor_shared_private *shared; |
77 | }; | 78 | }; |