From patchwork Fri Dec 16 09:56:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 88277 Delivered-To: patch@linaro.org Received: by 10.182.112.6 with SMTP id im6csp160813obb; Fri, 16 Dec 2016 01:57:18 -0800 (PST) X-Received: by 10.84.216.20 with SMTP id m20mr5015295pli.126.1481882237926; Fri, 16 Dec 2016 01:57:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p14si7073599pli.109.2016.12.16.01.57.17; Fri, 16 Dec 2016 01:57:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760449AbcLPJ5P (ORCPT + 4 others); Fri, 16 Dec 2016 04:57:15 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:36368 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760295AbcLPJ5N (ORCPT ); Fri, 16 Dec 2016 04:57:13 -0500 Received: from epcpsbgm2new.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OI9010K9VN9GE90@mailout4.samsung.com>; Fri, 16 Dec 2016 18:57:10 +0900 (KST) X-AuditID: cbfee61b-f796f6d000004092-f4-5853ba7682de Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 31.1F.16530.67AB3585; Fri, 16 Dec 2016 18:57:10 +0900 (KST) Received: from AMDC2765.digital.local ([106.116.147.25]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OI9008FDVN3ST50@mmp2.samsung.com>; Fri, 16 Dec 2016 18:57:10 +0900 (KST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-serial@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Greg Kroah-Hartman Subject: [PATCH] serial: samsung: Simplify DMA engine initialization code Date: Fri, 16 Dec 2016 10:56:53 +0100 Message-id: <1481882213-10856-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t9jQd2yXcERBsuOG1psnLGe1aJ58Xo2 i/PnN7BbzDi/j8nizOJedou1R+6yWxx+087qwO6xaVUnm8f+uWvYPfq2rGL0+LxJLoAlys0m IzUxJbVIITUvOT8lMy/dVik0xE3XQkkhLzE31VYpQtc3JEhJoSwxpxTIMzJAAw7OAe7BSvp2 CW4ZR69dZSw4IlTR8vsNawPjOf4uRk4OCQETiamrJ7JA2GISF+6tZ+ti5OIQEpjFKPHo9y5G COcXo8SV+a/BqtgEDCW63naxgdgiAs4Ss88uZAIpYhb4xCjRsugaI0hCWMBT4ujBrWBFLAKq EofuTmUCsXkFPCQ2rZwCtU5O4uSxyawTGLkXMDKsYpRILUguKE5KzzXKSy3XK07MLS7NS9dL zs/dxAgOzmfSOxgP73I/xCjAwajEw/tjW1CEEGtiWXFl7iFGCQ5mJRHewm3BEUK8KYmVValF +fFFpTmpxYcYTYEOmMgsJZqcD4ycvJJ4QxNzE3NjAwtzS0sTIyVx3sbZz8KFBNITS1KzU1ML Uotg+pg4OKUaGMUur4i6HblBJS7c47KPwtT08vp5H6qKxAQ17AU2+E48qmBi4rFG5frPPc7n dVUC/ATcfuWbVnhzyNyPlzs0M6xx7oKIlZH3JD03Lu1s+CNu1Ka2xbSlYL5itrL5XEeBjZo8 t34XSyx7vz1+o71WPc/nKPM78y4lNqius7sQzxvgs+b4njcaSizFGYmGWsxFxYkAI1lb52QC AAA= X-MTR: 20000000000000000@CPGS Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org dma_request_slave_channel_compat() requires filter function and mask, which are not needed on device tree based platforms, so simplify the code by calling the more appropriate dma_request_chan() function. This additionally gives us proper error handling, because the new function returns error codes instead of NULL on failure. Signed-off-by: Marek Szyprowski --- drivers/tty/serial/samsung.c | 17 ++++++----------- drivers/tty/serial/samsung.h | 4 ---- 2 files changed, 6 insertions(+), 15 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index f44615fa474d..a9b309ba24a4 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -859,7 +859,6 @@ static void s3c24xx_serial_break_ctl(struct uart_port *port, int break_state) static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) { struct s3c24xx_uart_dma *dma = p->dma; - dma_cap_mask_t mask; unsigned long flags; /* Default slave configuration parameters */ @@ -876,21 +875,17 @@ static int s3c24xx_serial_request_dma(struct s3c24xx_uart_port *p) else dma->tx_conf.dst_maxburst = 1; - dma_cap_zero(mask); - dma_cap_set(DMA_SLAVE, mask); + dma->rx_chan = dma_request_chan(p->port.dev, "rx"); - dma->rx_chan = dma_request_slave_channel_compat(mask, dma->fn, - dma->rx_param, p->port.dev, "rx"); - if (!dma->rx_chan) - return -ENODEV; + if (IS_ERR(dma->rx_chan)) + return PTR_ERR(dma->rx_chan); dmaengine_slave_config(dma->rx_chan, &dma->rx_conf); - dma->tx_chan = dma_request_slave_channel_compat(mask, dma->fn, - dma->tx_param, p->port.dev, "tx"); - if (!dma->tx_chan) { + dma->tx_chan = dma_request_chan(p->port.dev, "tx"); + if (IS_ERR(dma->tx_chan)) { dma_release_channel(dma->rx_chan); - return -ENODEV; + return PTR_ERR(dma->tx_chan); } dmaengine_slave_config(dma->tx_chan, &dma->tx_conf); diff --git a/drivers/tty/serial/samsung.h b/drivers/tty/serial/samsung.h index a04acef1cb20..965199b6c16f 100644 --- a/drivers/tty/serial/samsung.h +++ b/drivers/tty/serial/samsung.h @@ -44,10 +44,6 @@ struct s3c24xx_serial_drv_data { }; struct s3c24xx_uart_dma { - dma_filter_fn fn; - void *rx_param; - void *tx_param; - unsigned int rx_chan_id; unsigned int tx_chan_id;