From patchwork Tue Jan 21 09:33:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11343253 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4A2C26C1 for ; Tue, 21 Jan 2020 09:34:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 32BE824656 for ; Tue, 21 Jan 2020 09:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728741AbgAUJeS (ORCPT ); Tue, 21 Jan 2020 04:34:18 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:46846 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729122AbgAUJeQ (ORCPT ); Tue, 21 Jan 2020 04:34:16 -0500 Received: from ramsan ([84.195.182.253]) by albert.telenet-ops.be with bizsmtp id sxaD2100M5USYZQ06xaDCK; Tue, 21 Jan 2020 10:34:14 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1itpvI-0008IS-KR; Tue, 21 Jan 2020 10:34:12 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1itpuM-0007Ss-21; Tue, 21 Jan 2020 10:33:14 +0100 From: Geert Uytterhoeven To: Vinod Koul Cc: Dan Williams , Lars-Peter Clausen , Matt Porter , Arnd Bergmann , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 1/3] dmaengine: Remove dma_device_satisfies_mask() wrapper Date: Tue, 21 Jan 2020 10:33:09 +0100 Message-Id: <20200121093311.28639-2-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200121093311.28639-1-geert+renesas@glider.be> References: <20200121093311.28639-1-geert+renesas@glider.be> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org Commit aa1e6f1a385eb2b0 ("dmaengine: kill struct dma_client and supporting infrastructure") removed the last user of the dma_device_satisfies_mask() wrapper. Remove the wrapper, and rename __dma_device_satisfies_mask() to dma_device_satisfies_mask(), to get rid of one more function starting with a double underscore. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- v2: - Add Acked-by, - Rebase on top of today's slave-dma/next. --- drivers/dma/dmaengine.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 158aeb1b6a8abd7f..7550dbdf548833ed 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c @@ -308,11 +308,8 @@ static void dma_channel_rebalance(void) } } -#define dma_device_satisfies_mask(device, mask) \ - __dma_device_satisfies_mask((device), &(mask)) -static int -__dma_device_satisfies_mask(struct dma_device *device, - const dma_cap_mask_t *want) +static int dma_device_satisfies_mask(struct dma_device *device, + const dma_cap_mask_t *want) { dma_cap_mask_t has; @@ -531,7 +528,7 @@ static struct dma_chan *private_candidate(const dma_cap_mask_t *mask, { struct dma_chan *chan; - if (mask && !__dma_device_satisfies_mask(dev, mask)) { + if (mask && !dma_device_satisfies_mask(dev, mask)) { dev_dbg(dev->dev, "%s: wrong capabilities\n", __func__); return NULL; } From patchwork Tue Jan 21 09:33:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11343251 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A3808159A for ; Tue, 21 Jan 2020 09:34:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8330224656 for ; Tue, 21 Jan 2020 09:34:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729195AbgAUJeQ (ORCPT ); Tue, 21 Jan 2020 04:34:16 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:60596 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728689AbgAUJeP (ORCPT ); Tue, 21 Jan 2020 04:34:15 -0500 Received: from ramsan ([84.195.182.253]) by michel.telenet-ops.be with bizsmtp id sxaD2100K5USYZQ06xaD88; Tue, 21 Jan 2020 10:34:14 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1itpvI-0008IS-9Y; Tue, 21 Jan 2020 10:34:12 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1itpuM-0007Su-2f; Tue, 21 Jan 2020 10:33:14 +0100 From: Geert Uytterhoeven To: Vinod Koul Cc: Dan Williams , Lars-Peter Clausen , Matt Porter , Arnd Bergmann , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 2/3] dmaengine: Remove dma_request_slave_channel_compat() wrapper Date: Tue, 21 Jan 2020 10:33:10 +0100 Message-Id: <20200121093311.28639-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200121093311.28639-1-geert+renesas@glider.be> References: <20200121093311.28639-1-geert+renesas@glider.be> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org At its original introduction, dma_request_slave_channel_compat() used a wrapper, to accommodate filter functions that modify the mask passed. Filter functions can no longer modify masks, and the mask parameter was made const in commit a53e28da574a40bc ("dma: Make the 'mask' parameter of __dma_request_channel const") consecutively. Hence remove the wrapper, and rename __dma_request_slave_channel_compat() to dma_request_slave_channel_compat(), to get rid of one more function name starting with a double underscore. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- v2: - Add Acked-by, - Rebase on top of today's slave-dma/next. --- include/linux/dmaengine.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 62225d46908bdb23..230d50ef7360ecee 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1526,11 +1526,9 @@ struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); struct dma_chan *dma_get_any_slave_channel(struct dma_device *device); #define dma_request_channel(mask, x, y) \ __dma_request_channel(&(mask), x, y, NULL) -#define dma_request_slave_channel_compat(mask, x, y, dev, name) \ - __dma_request_slave_channel_compat(&(mask), x, y, dev, name) static inline struct dma_chan -*__dma_request_slave_channel_compat(const dma_cap_mask_t *mask, +*dma_request_slave_channel_compat(const dma_cap_mask_t mask, dma_filter_fn fn, void *fn_param, struct device *dev, const char *name) { @@ -1543,7 +1541,7 @@ static inline struct dma_chan if (!fn || !fn_param) return NULL; - return __dma_request_channel(mask, fn, fn_param, NULL); + return __dma_request_channel(&mask, fn, fn_param, NULL); } static inline char * From patchwork Tue Jan 21 09:33:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11343255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B9BE1398 for ; Tue, 21 Jan 2020 09:34:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 244932465A for ; Tue, 21 Jan 2020 09:34:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729117AbgAUJe2 (ORCPT ); Tue, 21 Jan 2020 04:34:28 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:37226 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729107AbgAUJeQ (ORCPT ); Tue, 21 Jan 2020 04:34:16 -0500 Received: from ramsan ([84.195.182.253]) by xavier.telenet-ops.be with bizsmtp id sxaD2100H5USYZQ01xaDZk; Tue, 21 Jan 2020 10:34:14 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1itpvI-0008IS-FH; Tue, 21 Jan 2020 10:34:12 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1itpuM-0007Sy-3L; Tue, 21 Jan 2020 10:33:14 +0100 From: Geert Uytterhoeven To: Vinod Koul Cc: Dan Williams , Lars-Peter Clausen , Matt Porter , Arnd Bergmann , dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v2 3/3] dmaengine: Move dma_get_{,any_}slave_channel() to private dmaengine.h Date: Tue, 21 Jan 2020 10:33:11 +0100 Message-Id: <20200121093311.28639-4-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200121093311.28639-1-geert+renesas@glider.be> References: <20200121093311.28639-1-geert+renesas@glider.be> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org The functions dma_get_slave_channel() and dma_get_any_slave_channel() are called from DMA engine drivers only. Hence move their declarations from the public header file to the private header file drivers/dma/dmaengine.h. Signed-off-by: Geert Uytterhoeven Acked-by: Arnd Bergmann --- v2: - Add Acked-by, - Rebase on top of today's slave-dma/next. --- drivers/dma/dmaengine.h | 3 +++ drivers/dma/of-dma.c | 2 ++ include/linux/dmaengine.h | 2 -- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/dma/dmaengine.h b/drivers/dma/dmaengine.h index b0b97475707a789f..e8a320c9e57c2d74 100644 --- a/drivers/dma/dmaengine.h +++ b/drivers/dma/dmaengine.h @@ -179,4 +179,7 @@ dmaengine_desc_callback_valid(struct dmaengine_desc_callback *cb) return (cb->callback) ? true : false; } +struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); +struct dma_chan *dma_get_any_slave_channel(struct dma_device *device); + #endif diff --git a/drivers/dma/of-dma.c b/drivers/dma/of-dma.c index c2d779daa4b51ac8..b2c2b5e8093cf0d7 100644 --- a/drivers/dma/of-dma.c +++ b/drivers/dma/of-dma.c @@ -15,6 +15,8 @@ #include #include +#include "dmaengine.h" + static LIST_HEAD(of_dma_list); static DEFINE_MUTEX(of_dma_lock); diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 230d50ef7360ecee..9cc0e70e7c3543a9 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -1522,8 +1522,6 @@ int dma_async_device_register(struct dma_device *device); int dmaenginem_async_device_register(struct dma_device *device); void dma_async_device_unregister(struct dma_device *device); void dma_run_dependencies(struct dma_async_tx_descriptor *tx); -struct dma_chan *dma_get_slave_channel(struct dma_chan *chan); -struct dma_chan *dma_get_any_slave_channel(struct dma_device *device); #define dma_request_channel(mask, x, y) \ __dma_request_channel(&(mask), x, y, NULL)