aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Six <mario.six@gdsys.cc>2016-03-18 09:57:21 -0400
committerVinod Koul <vinod.koul@intel.com>2016-04-04 12:50:10 -0400
commit77fc397661e714c2bc4f96ae38f6776c15cc85ab (patch)
treeb686c94b3bd67c365b3f7178f2b9f429b33d43e8
parent899ed9dd4f2d007dfad66cd074b8ff26a0894ae8 (diff)
dmaengine: mpc512x: Fix code style
Signed-off-by: Mario Six <mario.six@gdsys.cc> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/mpc512x_dma.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/dma/mpc512x_dma.c b/drivers/dma/mpc512x_dma.c
index 1a161a8d68f3..ccadafa51d5e 100644
--- a/drivers/dma/mpc512x_dma.c
+++ b/drivers/dma/mpc512x_dma.c
@@ -251,6 +251,7 @@ static inline struct mpc_dma_chan *dma_chan_to_mpc_dma_chan(struct dma_chan *c)
251static inline struct mpc_dma *dma_chan_to_mpc_dma(struct dma_chan *c) 251static inline struct mpc_dma *dma_chan_to_mpc_dma(struct dma_chan *c)
252{ 252{
253 struct mpc_dma_chan *mchan = dma_chan_to_mpc_dma_chan(c); 253 struct mpc_dma_chan *mchan = dma_chan_to_mpc_dma_chan(c);
254
254 return container_of(mchan, struct mpc_dma, channels[c->chan_id]); 255 return container_of(mchan, struct mpc_dma, channels[c->chan_id]);
255} 256}
256 257
@@ -258,9 +259,9 @@ static inline struct mpc_dma *dma_chan_to_mpc_dma(struct dma_chan *c)
258 * Execute all queued DMA descriptors. 259 * Execute all queued DMA descriptors.
259 * 260 *
260 * Following requirements must be met while calling mpc_dma_execute(): 261 * Following requirements must be met while calling mpc_dma_execute():
261 * a) mchan->lock is acquired, 262 * a) mchan->lock is acquired,
262 * b) mchan->active list is empty, 263 * b) mchan->active list is empty,
263 * c) mchan->queued list contains at least one entry. 264 * c) mchan->queued list contains at least one entry.
264 */ 265 */
265static void mpc_dma_execute(struct mpc_dma_chan *mchan) 266static void mpc_dma_execute(struct mpc_dma_chan *mchan)
266{ 267{
@@ -450,20 +451,15 @@ static void mpc_dma_tasklet(unsigned long data)
450 if (es & MPC_DMA_DMAES_SAE) 451 if (es & MPC_DMA_DMAES_SAE)
451 dev_err(mdma->dma.dev, "- Source Address Error\n"); 452 dev_err(mdma->dma.dev, "- Source Address Error\n");
452 if (es & MPC_DMA_DMAES_SOE) 453 if (es & MPC_DMA_DMAES_SOE)
453 dev_err(mdma->dma.dev, "- Source Offset" 454 dev_err(mdma->dma.dev, "- Source Offset Configuration Error\n");
454 " Configuration Error\n");
455 if (es & MPC_DMA_DMAES_DAE) 455 if (es & MPC_DMA_DMAES_DAE)
456 dev_err(mdma->dma.dev, "- Destination Address" 456 dev_err(mdma->dma.dev, "- Destination Address Error\n");
457 " Error\n");
458 if (es & MPC_DMA_DMAES_DOE) 457 if (es & MPC_DMA_DMAES_DOE)
459 dev_err(mdma->dma.dev, "- Destination Offset" 458 dev_err(mdma->dma.dev, "- Destination Offset Configuration Error\n");
460 " Configuration Error\n");
461 if (es & MPC_DMA_DMAES_NCE) 459 if (es & MPC_DMA_DMAES_NCE)
462 dev_err(mdma->dma.dev, "- NBytes/Citter" 460 dev_err(mdma->dma.dev, "- NBytes/Citter Configuration Error\n");
463 " Configuration Error\n");
464 if (es & MPC_DMA_DMAES_SGE) 461 if (es & MPC_DMA_DMAES_SGE)
465 dev_err(mdma->dma.dev, "- Scatter/Gather" 462 dev_err(mdma->dma.dev, "- Scatter/Gather Configuration Error\n");
466 " Configuration Error\n");
467 if (es & MPC_DMA_DMAES_SBE) 463 if (es & MPC_DMA_DMAES_SBE)
468 dev_err(mdma->dma.dev, "- Source Bus Error\n"); 464 dev_err(mdma->dma.dev, "- Source Bus Error\n");
469 if (es & MPC_DMA_DMAES_DBE) 465 if (es & MPC_DMA_DMAES_DBE)
@@ -522,8 +518,8 @@ static int mpc_dma_alloc_chan_resources(struct dma_chan *chan)
522 for (i = 0; i < MPC_DMA_DESCRIPTORS; i++) { 518 for (i = 0; i < MPC_DMA_DESCRIPTORS; i++) {
523 mdesc = kzalloc(sizeof(struct mpc_dma_desc), GFP_KERNEL); 519 mdesc = kzalloc(sizeof(struct mpc_dma_desc), GFP_KERNEL);
524 if (!mdesc) { 520 if (!mdesc) {
525 dev_notice(mdma->dma.dev, "Memory allocation error. " 521 dev_notice(mdma->dma.dev,
526 "Allocated only %u descriptors\n", i); 522 "Memory allocation error. Allocated only %u descriptors\n", i);
527 break; 523 break;
528 } 524 }
529 525
@@ -925,7 +921,6 @@ static int mpc_dma_probe(struct platform_device *op)
925 921
926 mdma = devm_kzalloc(dev, sizeof(struct mpc_dma), GFP_KERNEL); 922 mdma = devm_kzalloc(dev, sizeof(struct mpc_dma), GFP_KERNEL);
927 if (!mdma) { 923 if (!mdma) {
928 dev_err(dev, "Memory exhausted!\n");
929 retval = -ENOMEM; 924 retval = -ENOMEM;
930 goto err; 925 goto err;
931 } 926 }
@@ -1049,7 +1044,8 @@ static int mpc_dma_probe(struct platform_device *op)
1049 out_be32(&mdma->regs->dmaerrl, 0xFFFF); 1044 out_be32(&mdma->regs->dmaerrl, 0xFFFF);
1050 } else { 1045 } else {
1051 out_be32(&mdma->regs->dmacr, MPC_DMA_DMACR_EDCG | 1046 out_be32(&mdma->regs->dmacr, MPC_DMA_DMACR_EDCG |
1052 MPC_DMA_DMACR_ERGA | MPC_DMA_DMACR_ERCA); 1047 MPC_DMA_DMACR_ERGA |
1048 MPC_DMA_DMACR_ERCA);
1053 1049
1054 /* Disable hardware DMA requests */ 1050 /* Disable hardware DMA requests */
1055 out_be32(&mdma->regs->dmaerqh, 0); 1051 out_be32(&mdma->regs->dmaerqh, 0);