From patchwork Tue May 26 13:25:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 6480561 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2E9709F1C1 for ; Tue, 26 May 2015 13:28:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57767204AE for ; Tue, 26 May 2015 13:28:06 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id DE7282038E for ; Tue, 26 May 2015 13:28:03 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C210F265546; Tue, 26 May 2015 15:28:02 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 1FD76265388; Tue, 26 May 2015 15:26:58 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 95C50265452; Tue, 26 May 2015 15:26:57 +0200 (CEST) Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by alsa0.perex.cz (Postfix) with ESMTP id 4224926155A for ; Tue, 26 May 2015 15:26:23 +0200 (CEST) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id t4QDQLai001347; Tue, 26 May 2015 08:26:21 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id t4QDQLcS022619; Tue, 26 May 2015 08:26:21 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Tue, 26 May 2015 08:26:21 -0500 Received: from dflp33.itg.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id t4QDQ9bM027427; Tue, 26 May 2015 08:26:18 -0500 From: Peter Ujfalusi To: , Date: Tue, 26 May 2015 16:25:57 +0300 Message-ID: <1432646768-12532-3-git-send-email-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.3.5 In-Reply-To: <1432646768-12532-1-git-send-email-peter.ujfalusi@ti.com> References: <1432646768-12532-1-git-send-email-peter.ujfalusi@ti.com> MIME-Version: 1.0 Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-crypto@vger.kernel.org, linux-serial@vger.kernel.org, dmaengine@vger.kernel.org, dan.j.williams@intel.com, linux-omap@vger.kernel.org, linux-media@vger.kernel.org Subject: [alsa-devel] [PATCH 02/13] dmaengine: Introduce dma_request_slave_channel_compat_reason() X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 */