aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/mpc512x_dma.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2014-10-16 05:00:58 -0400
committerVinod Koul <vinod.koul@intel.com>2014-11-06 01:02:45 -0500
commit9d82faeb72007dc5bfbfa1d53dd08d5078dbb31b (patch)
treeec66906e5541d705a6dac55557d88028ca2e369c /drivers/dma/mpc512x_dma.c
parent25741ff296f0a1d1fdd3e6f0923e5b4e79627037 (diff)
dmaengine: mpc512x: Remove chancnt affectations
chanctnt is already filled by dma_async_device_register, which uses the channel list to know how much channels there is. Since it's already filled, we can safely remove it from the drivers' probe function. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/mpc512x_dma.c')
-rw-r--r--drivers/dma/mpc512x_dma.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c
index 881db2bcb48b..fc08bb3af440 100644
--- a/drivers/dma/mpc512x_dma.c
+++ b/drivers/dma/mpc512x_dma.c
@@ -885,6 +885,7 @@ static int mpc_dma_probe(struct platform_device *op)
885 struct resource res; 885 struct resource res;
886 ulong regs_start, regs_size; 886 ulong regs_start, regs_size;
887 int retval, i; 887 int retval, i;
888 u8 chancnt;
888 889
889 mdma = devm_kzalloc(dev, sizeof(struct mpc_dma), GFP_KERNEL); 890 mdma = devm_kzalloc(dev, sizeof(struct mpc_dma), GFP_KERNEL);
890 if (!mdma) { 891 if (!mdma) {
@@ -956,10 +957,6 @@ static int mpc_dma_probe(struct platform_device *op)
956 957
957 dma = &mdma->dma; 958 dma = &mdma->dma;
958 dma->dev = dev; 959 dma->dev = dev;
959 if (mdma->is_mpc8308)
960 dma->chancnt = MPC8308_DMACHAN_MAX;
961 else
962 dma->chancnt = MPC512x_DMACHAN_MAX;
963 dma->device_alloc_chan_resources = mpc_dma_alloc_chan_resources; 960 dma->device_alloc_chan_resources = mpc_dma_alloc_chan_resources;
964 dma->device_free_chan_resources = mpc_dma_free_chan_resources; 961 dma->device_free_chan_resources = mpc_dma_free_chan_resources;
965 dma->device_issue_pending = mpc_dma_issue_pending; 962 dma->device_issue_pending = mpc_dma_issue_pending;
@@ -972,7 +969,12 @@ static int mpc_dma_probe(struct platform_device *op)
972 dma_cap_set(DMA_MEMCPY, dma->cap_mask); 969 dma_cap_set(DMA_MEMCPY, dma->cap_mask);
973 dma_cap_set(DMA_SLAVE, dma->cap_mask); 970 dma_cap_set(DMA_SLAVE, dma->cap_mask);
974 971
975 for (i = 0; i < dma->chancnt; i++) { 972 if (mdma->is_mpc8308)
973 chancnt = MPC8308_DMACHAN_MAX;
974 else
975 chancnt = MPC512x_DMACHAN_MAX;
976
977 for (i = 0; i < chancnt; i++) {
976 mchan = &mdma->channels[i]; 978 mchan = &mdma->channels[i];
977 979
978 mchan->chan.device = dma; 980 mchan->chan.device = dma;