[PATCH 11/31] dma: add channel request API that supports deferred probe

From
Stephen Warren <hidden>
Date
2013-11-15 23:08:03
Also in
linux-tegra
Reply to
Stephen Warren, 2013-11-15
On 11/15/2013 01:54 PM, Stephen Warren wrote:
From: Stephen Warren <redacted>

dma_request_slave_channel() simply returns NULL whenever DMA channel
lookup fails. Lookup could fail for two distinct reasons:

a) No DMA specification exists for the channel name.
   This includes situations where no DMA specifications exist at all, or
   other general lookup problems.

b) A DMA specification does exist, yet the driver for that channel is not
   yet registered.

Case (b) should trigger deferred probe in client drivers. However, since
they have no way to differentiate the two situations, it cannot.

Implement new function dma_request_slave_channel_or_err(), which performs
identically to dma_request_slave_channel(), except that it returns an
error-pointer rather than NULL, which allows callers to detect when
deferred probe should occur.
...

...
quoted hunk ↗ jump to hunk
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
quoted hunk ↗ jump to hunk
+static inline struct dma_chan *dma_request_slave_channel_or_err(
+					struct device *dev, const char *name)
+{
+	return ERR_PTR(-ENODEV);
+}
That requires the following to be squashed into it, which I'll apply
locally:
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index b908b0fda72b..f156c145fad2 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -22,6 +22,7 @@
 #define LINUX_DMAENGINE_H

 #include <linux/device.h>
+#include <linux/err.h>
 #include <linux/uio.h>
 #include <linux/bug.h>
 #include <linux/scatterlist.h>
Thread (141 messages) 141 messages, 17 authors, last reply 2013-12-12
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help