diff options
author | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2012-11-15 09:55:30 -0500 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2012-11-20 09:59:00 -0500 |
commit | b503fa01990f6875640339d8f4ba98dbc068f821 (patch) | |
tree | 7364cad331b4b2a06622716f28398b8c05b69730 | |
parent | 9aedbdbab39c8aa58c0b2a0791fb10df6eebc123 (diff) |
dma: mv_xor: remove the pool_size from platform_data
The pool_size is always PAGE_SIZE, and since it is a software
configuration paramter (and not a hardware description parameter), we
cannot make it part of the Device Tree binding, so we'd better remove
it from the platform_data as well.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r-- | arch/arm/plat-orion/common.c | 18 | ||||
-rw-r--r-- | drivers/dma/mv_xor.c | 15 | ||||
-rw-r--r-- | drivers/dma/mv_xor.h | 1 | ||||
-rw-r--r-- | include/linux/platform_data/dma-mv_xor.h | 1 |
4 files changed, 9 insertions, 26 deletions
diff --git a/arch/arm/plat-orion/common.c b/arch/arm/plat-orion/common.c index 09d836060bf..2d4b6414609 100644 --- a/arch/arm/plat-orion/common.c +++ b/arch/arm/plat-orion/common.c | |||
@@ -625,14 +625,7 @@ static struct resource orion_xor0_shared_resources[] = { | |||
625 | }, | 625 | }, |
626 | }; | 626 | }; |
627 | 627 | ||
628 | static struct mv_xor_channel_data orion_xor0_channels_data[2] = { | 628 | static struct mv_xor_channel_data orion_xor0_channels_data[2]; |
629 | { | ||
630 | .pool_size = PAGE_SIZE, | ||
631 | }, | ||
632 | { | ||
633 | .pool_size = PAGE_SIZE, | ||
634 | }, | ||
635 | }; | ||
636 | 629 | ||
637 | static struct mv_xor_platform_data orion_xor0_pdata = { | 630 | static struct mv_xor_platform_data orion_xor0_pdata = { |
638 | .channels = orion_xor0_channels_data, | 631 | .channels = orion_xor0_channels_data, |
@@ -698,14 +691,7 @@ static struct resource orion_xor1_shared_resources[] = { | |||
698 | }, | 691 | }, |
699 | }; | 692 | }; |
700 | 693 | ||
701 | static struct mv_xor_channel_data orion_xor1_channels_data[2] = { | 694 | static struct mv_xor_channel_data orion_xor1_channels_data[2]; |
702 | { | ||
703 | .pool_size = PAGE_SIZE, | ||
704 | }, | ||
705 | { | ||
706 | .pool_size = PAGE_SIZE, | ||
707 | }, | ||
708 | }; | ||
709 | 695 | ||
710 | static struct mv_xor_platform_data orion_xor1_pdata = { | 696 | static struct mv_xor_platform_data orion_xor1_pdata = { |
711 | .channels = orion_xor1_channels_data, | 697 | .channels = orion_xor1_channels_data, |
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index fc983bf3843..ec741b4607e 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -603,7 +603,7 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan) | |||
603 | int idx; | 603 | int idx; |
604 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); | 604 | struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan); |
605 | struct mv_xor_desc_slot *slot = NULL; | 605 | struct mv_xor_desc_slot *slot = NULL; |
606 | int num_descs_in_pool = mv_chan->pool_size/MV_XOR_SLOT_SIZE; | 606 | int num_descs_in_pool = MV_XOR_POOL_SIZE/MV_XOR_SLOT_SIZE; |
607 | 607 | ||
608 | /* Allocate descriptor slots */ | 608 | /* Allocate descriptor slots */ |
609 | idx = mv_chan->slots_allocated; | 609 | idx = mv_chan->slots_allocated; |
@@ -1074,7 +1074,7 @@ static int mv_xor_channel_remove(struct mv_xor_chan *mv_chan) | |||
1074 | 1074 | ||
1075 | dma_async_device_unregister(&mv_chan->dmadev); | 1075 | dma_async_device_unregister(&mv_chan->dmadev); |
1076 | 1076 | ||
1077 | dma_free_coherent(dev, mv_chan->pool_size, | 1077 | dma_free_coherent(dev, MV_XOR_POOL_SIZE, |
1078 | mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool); | 1078 | mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool); |
1079 | 1079 | ||
1080 | list_for_each_entry_safe(chan, _chan, &mv_chan->dmadev.channels, | 1080 | list_for_each_entry_safe(chan, _chan, &mv_chan->dmadev.channels, |
@@ -1088,8 +1088,7 @@ static int mv_xor_channel_remove(struct mv_xor_chan *mv_chan) | |||
1088 | static struct mv_xor_chan * | 1088 | static struct mv_xor_chan * |
1089 | mv_xor_channel_add(struct mv_xor_device *xordev, | 1089 | mv_xor_channel_add(struct mv_xor_device *xordev, |
1090 | struct platform_device *pdev, | 1090 | struct platform_device *pdev, |
1091 | int idx, dma_cap_mask_t cap_mask, | 1091 | int idx, dma_cap_mask_t cap_mask, int irq) |
1092 | size_t pool_size, int irq) | ||
1093 | { | 1092 | { |
1094 | int ret = 0; | 1093 | int ret = 0; |
1095 | struct mv_xor_chan *mv_chan; | 1094 | struct mv_xor_chan *mv_chan; |
@@ -1109,9 +1108,8 @@ mv_xor_channel_add(struct mv_xor_device *xordev, | |||
1109 | * note: writecombine gives slightly better performance, but | 1108 | * note: writecombine gives slightly better performance, but |
1110 | * requires that we explicitly flush the writes | 1109 | * requires that we explicitly flush the writes |
1111 | */ | 1110 | */ |
1112 | mv_chan->pool_size = pool_size; | ||
1113 | mv_chan->dma_desc_pool_virt = | 1111 | mv_chan->dma_desc_pool_virt = |
1114 | dma_alloc_writecombine(&pdev->dev, mv_chan->pool_size, | 1112 | dma_alloc_writecombine(&pdev->dev, MV_XOR_POOL_SIZE, |
1115 | &mv_chan->dma_desc_pool, GFP_KERNEL); | 1113 | &mv_chan->dma_desc_pool, GFP_KERNEL); |
1116 | if (!mv_chan->dma_desc_pool_virt) | 1114 | if (!mv_chan->dma_desc_pool_virt) |
1117 | return ERR_PTR(-ENOMEM); | 1115 | return ERR_PTR(-ENOMEM); |
@@ -1193,7 +1191,7 @@ mv_xor_channel_add(struct mv_xor_device *xordev, | |||
1193 | return mv_chan; | 1191 | return mv_chan; |
1194 | 1192 | ||
1195 | err_free_dma: | 1193 | err_free_dma: |
1196 | dma_free_coherent(&pdev->dev, pool_size, | 1194 | dma_free_coherent(&pdev->dev, MV_XOR_POOL_SIZE, |
1197 | mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool); | 1195 | mv_chan->dma_desc_pool_virt, mv_chan->dma_desc_pool); |
1198 | return ERR_PTR(ret); | 1196 | return ERR_PTR(ret); |
1199 | } | 1197 | } |
@@ -1296,8 +1294,7 @@ static int mv_xor_probe(struct platform_device *pdev) | |||
1296 | 1294 | ||
1297 | xordev->channels[i] = | 1295 | xordev->channels[i] = |
1298 | mv_xor_channel_add(xordev, pdev, i, | 1296 | mv_xor_channel_add(xordev, pdev, i, |
1299 | cd->cap_mask, | 1297 | cd->cap_mask, irq); |
1300 | cd->pool_size, irq); | ||
1301 | if (IS_ERR(xordev->channels[i])) { | 1298 | if (IS_ERR(xordev->channels[i])) { |
1302 | ret = PTR_ERR(xordev->channels[i]); | 1299 | ret = PTR_ERR(xordev->channels[i]); |
1303 | goto err_channel_add; | 1300 | goto err_channel_add; |
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h index dab9f30e564..698b4487b34 100644 --- a/drivers/dma/mv_xor.h +++ b/drivers/dma/mv_xor.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/interrupt.h> | 24 | #include <linux/interrupt.h> |
25 | 25 | ||
26 | #define USE_TIMER | 26 | #define USE_TIMER |
27 | #define MV_XOR_POOL_SIZE PAGE_SIZE | ||
27 | #define MV_XOR_SLOT_SIZE 64 | 28 | #define MV_XOR_SLOT_SIZE 64 |
28 | #define MV_XOR_THRESHOLD 1 | 29 | #define MV_XOR_THRESHOLD 1 |
29 | #define MV_XOR_MAX_CHANNELS 2 | 30 | #define MV_XOR_MAX_CHANNELS 2 |
diff --git a/include/linux/platform_data/dma-mv_xor.h b/include/linux/platform_data/dma-mv_xor.h index b18dc249618..8ec18f64e39 100644 --- a/include/linux/platform_data/dma-mv_xor.h +++ b/include/linux/platform_data/dma-mv_xor.h | |||
@@ -14,7 +14,6 @@ | |||
14 | 14 | ||
15 | struct mv_xor_channel_data { | 15 | struct mv_xor_channel_data { |
16 | dma_cap_mask_t cap_mask; | 16 | dma_cap_mask_t cap_mask; |
17 | size_t pool_size; | ||
18 | }; | 17 | }; |
19 | 18 | ||
20 | struct mv_xor_platform_data { | 19 | struct mv_xor_platform_data { |