diff mbox

[11/15] dmaengine: pl330: Simplify is_manager()

Message ID 1404671552-502-12-git-send-email-lars@metafoo.de (mailing list archive)
State Accepted
Commit fbbcd9be96a0
Delegated to: Vinod Koul
Headers show

Commit Message

Lars-Peter Clausen July 6, 2014, 6:32 p.m. UTC
Since we keep a pointer to the manager thread it is fairly easy to check if a
thread is the manager thread.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/dma/pl330.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox

Patch

diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c
index 0209823..c5eeb64 100644
--- a/drivers/dma/pl330.c
+++ b/drivers/dma/pl330.c
@@ -562,13 +562,7 @@  static inline bool _queue_full(struct pl330_thread *thrd)
 
 static inline bool is_manager(struct pl330_thread *thrd)
 {
-	struct pl330_dmac *pl330 = thrd->dmac;
-
-	/* MANAGER is indexed at the end */
-	if (thrd->id == pl330->pinfo->pcfg.num_chan)
-		return true;
-	else
-		return false;
+	return thrd->dmac->manager == thrd;
 }
 
 /* If manager of the thread is in Non-Secure mode */