Skip to content

Commit bb16050

Browse files
nxpfranklivinodkoul
authored andcommitted
dmaengine: fsl-edma: remove redundant "idle" field from fsl_chan
The 'idle' in fsl_chan is redundant as it's equivalent to 'status != DMA_IN_PROGRESS'. So remote it to simple code logic. Signed-off-by: Frank Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 44eb827 commit bb16050

File tree

4 files changed

+2
-11
lines changed

4 files changed

+2
-11
lines changed

drivers/dma/fsl-edma-common.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan)
5959
vchan_cookie_complete(&fsl_chan->edesc->vdesc);
6060
fsl_chan->edesc = NULL;
6161
fsl_chan->status = DMA_COMPLETE;
62-
fsl_chan->idle = true;
6362
} else {
6463
vchan_cyclic_callback(&fsl_chan->edesc->vdesc);
6564
}
@@ -239,7 +238,7 @@ int fsl_edma_terminate_all(struct dma_chan *chan)
239238
spin_lock_irqsave(&fsl_chan->vchan.lock, flags);
240239
fsl_edma_disable_request(fsl_chan);
241240
fsl_chan->edesc = NULL;
242-
fsl_chan->idle = true;
241+
fsl_chan->status = DMA_COMPLETE;
243242
vchan_get_all_descriptors(&fsl_chan->vchan, &head);
244243
spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags);
245244
vchan_dma_desc_free_list(&fsl_chan->vchan, &head);
@@ -259,7 +258,6 @@ int fsl_edma_pause(struct dma_chan *chan)
259258
if (fsl_chan->edesc) {
260259
fsl_edma_disable_request(fsl_chan);
261260
fsl_chan->status = DMA_PAUSED;
262-
fsl_chan->idle = true;
263261
}
264262
spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags);
265263
return 0;
@@ -274,7 +272,6 @@ int fsl_edma_resume(struct dma_chan *chan)
274272
if (fsl_chan->edesc) {
275273
fsl_edma_enable_request(fsl_chan);
276274
fsl_chan->status = DMA_IN_PROGRESS;
277-
fsl_chan->idle = false;
278275
}
279276
spin_unlock_irqrestore(&fsl_chan->vchan.lock, flags);
280277
return 0;
@@ -780,7 +777,6 @@ void fsl_edma_xfer_desc(struct fsl_edma_chan *fsl_chan)
780777
fsl_edma_set_tcd_regs(fsl_chan, fsl_chan->edesc->tcd[0].vtcd);
781778
fsl_edma_enable_request(fsl_chan);
782779
fsl_chan->status = DMA_IN_PROGRESS;
783-
fsl_chan->idle = false;
784780
}
785781

786782
void fsl_edma_issue_pending(struct dma_chan *chan)

drivers/dma/fsl-edma-common.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ struct fsl_edma_chan {
150150
struct virt_dma_chan vchan;
151151
enum dma_status status;
152152
enum fsl_edma_pm_state pm_state;
153-
bool idle;
154153
struct fsl_edma_engine *edma;
155154
struct fsl_edma_desc *edesc;
156155
struct dma_slave_config cfg;
@@ -456,7 +455,6 @@ static inline struct fsl_edma_desc *to_fsl_edma_desc(struct virt_dma_desc *vd)
456455
static inline void fsl_edma_err_chan_handler(struct fsl_edma_chan *fsl_chan)
457456
{
458457
fsl_chan->status = DMA_ERROR;
459-
fsl_chan->idle = true;
460458
}
461459

462460
void fsl_edma_tx_chan_handler(struct fsl_edma_chan *fsl_chan);

drivers/dma/fsl-edma-main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,6 @@ static int fsl_edma_probe(struct platform_device *pdev)
544544
fsl_chan->edma = fsl_edma;
545545
fsl_chan->pm_state = RUNNING;
546546
fsl_chan->srcid = 0;
547-
fsl_chan->idle = true;
548547
fsl_chan->dma_dir = DMA_NONE;
549548
fsl_chan->vchan.desc_free = fsl_edma_free_desc;
550549

@@ -669,7 +668,7 @@ static int fsl_edma_suspend_late(struct device *dev)
669668
continue;
670669
spin_lock_irqsave(&fsl_chan->vchan.lock, flags);
671670
/* Make sure chan is idle or will force disable. */
672-
if (unlikely(!fsl_chan->idle)) {
671+
if (unlikely(fsl_chan->status == DMA_IN_PROGRESS)) {
673672
dev_warn(dev, "WARN: There is non-idle channel.");
674673
fsl_edma_disable_request(fsl_chan);
675674
fsl_edma_chan_mux(fsl_chan, 0, false);

drivers/dma/mcf-edma-main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ static irqreturn_t mcf_edma_err_handler(int irq, void *dev_id)
6464
fsl_edma_disable_request(&mcf_edma->chans[ch]);
6565
iowrite8(EDMA_CERR_CERR(ch), regs->cerr);
6666
mcf_edma->chans[ch].status = DMA_ERROR;
67-
mcf_edma->chans[ch].idle = true;
6867
}
6968
}
7069

@@ -196,7 +195,6 @@ static int mcf_edma_probe(struct platform_device *pdev)
196195

197196
mcf_chan->edma = mcf_edma;
198197
mcf_chan->srcid = i;
199-
mcf_chan->idle = true;
200198
mcf_chan->dma_dir = DMA_NONE;
201199
mcf_chan->vchan.desc_free = fsl_edma_free_desc;
202200
vchan_init(&mcf_chan->vchan, &mcf_edma->dma_dev);

0 commit comments

Comments
 (0)