aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/mv_xor.c
diff options
context:
space:
mode:
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-15 09:09:42 -0500
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-20 09:58:59 -0500
commit275cc0c8bd3c0a6b826d46a4d1a8135897387ca9 (patch)
tree63633dacc680e4927de6f394beb3b1b5d7694cb8 /drivers/dma/mv_xor.c
parent8c75979d7ac8cdec927605336aeebea0c7f88f74 (diff)
dma: mv_xor: use mv_xor_chan pointers as arguments to self-test functions
In preparation for the removal of the mv_xor_device structure, we directly pass mv_xor_chan pointers to the self-test functions included in the driver. These functions were anyway selecting the first (and only channel) available in each DMA device, so the behaviour is unchanged. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'drivers/dma/mv_xor.c')
-rw-r--r--drivers/dma/mv_xor.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index a64e30e27a19..75a80510dba9 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -898,7 +898,7 @@ static void mv_xor_issue_pending(struct dma_chan *chan)
898 */ 898 */
899#define MV_XOR_TEST_SIZE 2000 899#define MV_XOR_TEST_SIZE 2000
900 900
901static int __devinit mv_xor_memcpy_self_test(struct mv_xor_device *device) 901static int __devinit mv_xor_memcpy_self_test(struct mv_xor_chan *mv_chan)
902{ 902{
903 int i; 903 int i;
904 void *src, *dest; 904 void *src, *dest;
@@ -922,10 +922,7 @@ static int __devinit mv_xor_memcpy_self_test(struct mv_xor_device *device)
922 for (i = 0; i < MV_XOR_TEST_SIZE; i++) 922 for (i = 0; i < MV_XOR_TEST_SIZE; i++)
923 ((u8 *) src)[i] = (u8)i; 923 ((u8 *) src)[i] = (u8)i;
924 924
925 /* Start copy, using first DMA channel */ 925 dma_chan = &mv_chan->dmachan;
926 dma_chan = container_of(device->dmadev.channels.next,
927 struct dma_chan,
928 device_node);
929 if (mv_xor_alloc_chan_resources(dma_chan) < 1) { 926 if (mv_xor_alloc_chan_resources(dma_chan) < 1) {
930 err = -ENODEV; 927 err = -ENODEV;
931 goto out; 928 goto out;
@@ -971,7 +968,7 @@ out:
971 968
972#define MV_XOR_NUM_SRC_TEST 4 /* must be <= 15 */ 969#define MV_XOR_NUM_SRC_TEST 4 /* must be <= 15 */
973static int __devinit 970static int __devinit
974mv_xor_xor_self_test(struct mv_xor_device *device) 971mv_xor_xor_self_test(struct mv_xor_chan *mv_chan)
975{ 972{
976 int i, src_idx; 973 int i, src_idx;
977 struct page *dest; 974 struct page *dest;
@@ -1016,9 +1013,7 @@ mv_xor_xor_self_test(struct mv_xor_device *device)
1016 1013
1017 memset(page_address(dest), 0, PAGE_SIZE); 1014 memset(page_address(dest), 0, PAGE_SIZE);
1018 1015
1019 dma_chan = container_of(device->dmadev.channels.next, 1016 dma_chan = &mv_chan->dmachan;
1020 struct dma_chan,
1021 device_node);
1022 if (mv_xor_alloc_chan_resources(dma_chan) < 1) { 1017 if (mv_xor_alloc_chan_resources(dma_chan) < 1) {
1023 err = -ENODEV; 1018 err = -ENODEV;
1024 goto out; 1019 goto out;
@@ -1183,14 +1178,14 @@ mv_xor_channel_add(struct mv_xor_private *msp,
1183 list_add_tail(&mv_chan->dmachan.device_node, &dma_dev->channels); 1178 list_add_tail(&mv_chan->dmachan.device_node, &dma_dev->channels);
1184 1179
1185 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) { 1180 if (dma_has_cap(DMA_MEMCPY, dma_dev->cap_mask)) {
1186 ret = mv_xor_memcpy_self_test(adev); 1181 ret = mv_xor_memcpy_self_test(mv_chan);
1187 dev_dbg(&pdev->dev, "memcpy self test returned %d\n", ret); 1182 dev_dbg(&pdev->dev, "memcpy self test returned %d\n", ret);
1188 if (ret) 1183 if (ret)
1189 goto err_free_dma; 1184 goto err_free_dma;
1190 } 1185 }
1191 1186
1192 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) { 1187 if (dma_has_cap(DMA_XOR, dma_dev->cap_mask)) {
1193 ret = mv_xor_xor_self_test(adev); 1188 ret = mv_xor_xor_self_test(mv_chan);
1194 dev_dbg(&pdev->dev, "xor self test returned %d\n", ret); 1189 dev_dbg(&pdev->dev, "xor self test returned %d\n", ret);
1195 if (ret) 1190 if (ret)
1196 goto err_free_dma; 1191 goto err_free_dma;