[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1432646768-12532-3-git-send-email-peter.ujfalusi@ti.com>
Date: Tue, 26 May 2015 16:25:57 +0300
From: Peter Ujfalusi <peter.ujfalusi@...com>
To: <vinod.koul@...el.com>, <tony@...mide.com>
CC: <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<dan.j.williams@...el.com>, <dmaengine@...r.kernel.org>,
<linux-serial@...r.kernel.org>, <linux-omap@...r.kernel.org>,
<linux-mmc@...r.kernel.org>, <linux-crypto@...r.kernel.org>,
<linux-spi@...r.kernel.org>, <linux-media@...r.kernel.org>,
<alsa-devel@...a-project.org>
Subject: [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason()
dma_request_slave_channel_compat() 'eats' up the returned error codes which
prevents drivers using the compat call to be able to do deferred probing.
The new wrapper is identical in functionality but it will return with error
code in case of failure and will pass the -EPROBE_DEFER to the caller in
case dma_request_slave_channel_reason() returned with it.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@...com>
---
include/linux/dmaengine.h | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index abf63ceabef9..6c777394835c 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -1120,4 +1120,26 @@ static inline struct dma_chan
return __dma_request_channel(mask, fn, fn_param);
}
+
+#define dma_request_slave_channel_compat_reason(mask, x, y, dev, name) \
+ __dma_request_slave_channel_compat_reason(&(mask), x, y, dev, name)
+
+static inline struct dma_chan
+*__dma_request_slave_channel_compat_reason(const dma_cap_mask_t *mask,
+ dma_filter_fn fn, void *fn_param,
+ struct device *dev, char *name)
+{
+ struct dma_chan *chan;
+
+ chan = dma_request_slave_channel_reason(dev, name);
+ /* Try via legacy API if not requesting for deferred probing */
+ if (IS_ERR(chan) && PTR_ERR(chan) != -EPROBE_DEFER)
+ chan = __dma_request_channel(mask, fn, fn_param);
+
+ if (!chan)
+ chan = ERR_PTR(-ENODEV);
+
+ return chan;
+}
+
#endif /* DMAENGINE_H */
--
2.3.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists