Thread (15 messages) 15 messages, 3 authors, 2012-03-06

RE: [PATCH 6/9] dmaengine: consolidate tx_status functions

flat view
STALE5332d SUPERSEDED

From: H Hartley Sweeten <hidden>
Date: 2012-03-05 23:35:53
Also in: linux-arm-kernel

Revision v1 of 6 in this series.

Revisions (6)
  1. v1
  2. v1 current
  3. v1
  4. v1
  5. v2 [diff vs current]
  6. v2 [diff vs current]
On Monday, March 05, 2012 1:17 PM, Russell King wrote:
Now that we have the completed cookie in the dma_chan structure, we
can consolidate the tx_status functions by providing a function to set
the txstate structure and returning the DMA status.  We also provide
a separate helper to set the residue for cookies which are still in
progress.

Signed-off-by: Russell King <redacted>
<snip>
quoted hunk ↗ jump to hunk
diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h
index 47e0997..244a2c5 100644
--- a/drivers/dma/dmaengine.h
+++ b/drivers/dma/dmaengine.h
@@ -45,4 +45,35 @@ static inline void dma_cookie_complete(struct dma_asyn=
c_tx_descriptor *tx)
 	tx->cookie =3D 0;
 }
=20
+/**
+ * dma_cookie_status - report cookie status
+ * @chan: dma channel
+ * @cookie: cookie we are interested in
+ * @state: dma_tx_state structure to return last/used cookies
+ *
+ * Report the status of the cookie, filling in the state structure if
+ * non-NULL.  No locking is required.
+ */
+static inline enum dma_status dma_cookie_status(struct dma_chan *chan,
+	dma_cookie_t cookie, struct dma_tx_state *state)
+{
+	dma_cookie_t used, complete;
+
+	used =3D chan->cookie;
+	complete =3D chan->complete;
Is this supposed to be:

	complete =3D chan->completed_cookie;

Regards,
Hartley
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help