From patchwork Wed Oct 10 09:00:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Renner Berthing X-Patchwork-Id: 10634245 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46CA216B1 for ; Wed, 10 Oct 2018 09:07:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3C64829365 for ; Wed, 10 Oct 2018 09:07:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2F5EB29693; Wed, 10 Oct 2018 09:07:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ADDF329365 for ; Wed, 10 Oct 2018 09:07:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=akXZBS/EOJHQSfrEPYtO5MXfog1pkoSh5H0j2rxalHE=; b=My59wJfov8yalQ uoYHRzfu8agTQqOZ1rFIkEkdGB+H9z1xOYFPeMmZVZm3rBv/gbkPfoLbiv6G6cweHwl17nrNTWIZZ 3LypaFpOhJlXVt9u87OnhKVOP7V8DgY0ow7D2CRWQ5hRhy2U5VMI/CXElzQnVCj5HFWh1EXe8P2m1 0qNthCWfKzO6FfO+I8kcfuv2OyFnBaeWYLLILoz9Q9gQJB1sUgY3V4EzIqiRRwLgcZa4JsDUvZYTy VJzvLQbpIh9bs8S5yJByO4wDQZ7oumBzUuHuzwL3QiukOaL48P4DdIRWGBgams3cjsUFlSttarrm0 X+PkCNwZWu5BBxy8/EYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAASP-0000Bd-4L; Wed, 10 Oct 2018 09:07:05 +0000 Received: from mail-lf1-x144.google.com ([2a00:1450:4864:20::144]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gAANa-00054I-S6; Wed, 10 Oct 2018 09:02:26 +0000 Received: by mail-lf1-x144.google.com with SMTP id a82-v6so3382267lfa.4; Wed, 10 Oct 2018 02:01:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=H1wYnlUgcfpcHgJvA96w+RLcQIxhKmNVE/gaATftEyo=; b=YX8ftzhcGVUtGMcOs/GPlyGJsTa82qCFw1D3W72YFq761h+2Hsr0RJjEH4sTqiK1l5 v66ua5nUCMbl9V65AVPwJnGWwNaMzV55W52ry4HBkPOTOmx/OFwfC2ZPDPifnmhLtNbK +ix1bDrDrt6hqrrXKV/KXjNrKDfZl/dYalW01ivXIjxvGfVSEm5QXWjv14Qe2zvZDb+W xBy260e4sAtaXzV+WZB9lH0llVpqM7uKHQXaSRSwCLNZbZ6tbQXrBwLY+09RWml29U9s wSak9hExeKWvRovax5RBq/C7PiEbI+dAltZFngsZER4OlJ0rcIa8+Hd410GO6zICp1z8 GnSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=H1wYnlUgcfpcHgJvA96w+RLcQIxhKmNVE/gaATftEyo=; b=Edl/igulj3L1rD0tfb+dxnXezcQUFru2LCAp4TzmfKBaLLFA/yPZ4iyIlhL0FGnqyz y1FG6PCv4Fj31yKvTu8lP+anTYjkrakir7KHfpe6DDy8OS2mRx/9FncMsyz7aFrCq7n/ IXF6nXRdOPowggccbVrNiLzHnBzMxYNfzCW3/wdgBdWiX/t6NHiP/tHMcQB5Zr22QukH 2CUAbsVl4dzDC369cMN9KsGDl4Rhwz+r8PPnT3ofQg2fYCs0ekqIhnN5UX+6Vpm7AKFw kq8A2lV4GlH0xFmBSmMnCgavMU8zRfZdtL6hUol1jB0myG962kFHfI6ldkiwM6G5ic8h YgEg== X-Gm-Message-State: ABuFfojxM8kOuvh0pXBPr5rHlc2kscs3zcEWgmcrvYXqlEnReDm8pcnG Mjresf0d3Uwm9R2tEsLP2ni245m/I5Y= X-Google-Smtp-Source: ACcGV61n5/KgpPFjcr0D0nPzvbXlF4T9M+zjt0qq3dmcy0RcqcjAxHXWT86QY0K2fc8AGUc8OYuTqw== X-Received: by 2002:a19:5e5d:: with SMTP id z29-v6mr17336105lfi.110.1539162116518; Wed, 10 Oct 2018 02:01:56 -0700 (PDT) Received: from localhost.localdomain ([5.57.50.195]) by smtp.gmail.com with ESMTPSA id q2-v6sm2150078lfc.67.2018.10.10.02.01.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 02:01:55 -0700 (PDT) From: Emil Renner Berthing To: linux-rockchip@lists.infradead.org Subject: [PATCH 6/7] spi: rockchip: directly use direction constants Date: Wed, 10 Oct 2018 11:00:37 +0200 Message-Id: <20181010090038.20834-7-kernel@esmil.dk> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181010090038.20834-1-kernel@esmil.dk> References: <20181010090038.20834-1-kernel@esmil.dk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181010_020206_947020_CA378E84 X-CRM114-Status: GOOD ( 12.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Randy Li , Emil Renner Berthing , Brian Norris , Douglas Anderson , Rob Herring , linux-kernel@vger.kernel.org, Chris Zhong , Nickey Yang , Mark Brown , Klaus Goger , Enric Balletbo i Serra , linux-spi@vger.kernel.org, Shunqian Zheng , linux-arm-kernel@lists.infradead.org, Heiko Stuebner Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The dma direction for the tx and rx dma channels never change, so just use the constants directly rather than storing them in device data. Signed-off-by: Emil Renner Berthing --- drivers/spi/spi-rockchip.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 1d8bf45304a5..1044849a352d 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -164,7 +164,6 @@ enum rockchip_ssi_type { struct rockchip_spi_dma_data { struct dma_chan *ch; - enum dma_transfer_direction direction; dma_addr_t addr; }; @@ -454,7 +453,7 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) rxdesc = NULL; if (rs->rx) { - rxconf.direction = rs->dma_rx.direction; + rxconf.direction = DMA_DEV_TO_MEM; rxconf.src_addr = rs->dma_rx.addr; rxconf.src_addr_width = rs->n_bytes; rxconf.src_maxburst = 1; @@ -463,7 +462,7 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) rxdesc = dmaengine_prep_slave_sg( rs->dma_rx.ch, rs->rx_sg.sgl, rs->rx_sg.nents, - rs->dma_rx.direction, DMA_PREP_INTERRUPT); + DMA_DEV_TO_MEM, DMA_PREP_INTERRUPT); if (!rxdesc) return -EINVAL; @@ -473,7 +472,7 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) txdesc = NULL; if (rs->tx) { - txconf.direction = rs->dma_tx.direction; + txconf.direction = DMA_MEM_TO_DEV; txconf.dst_addr = rs->dma_tx.addr; txconf.dst_addr_width = rs->n_bytes; txconf.dst_maxburst = rs->fifo_len / 2; @@ -482,7 +481,7 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs) txdesc = dmaengine_prep_slave_sg( rs->dma_tx.ch, rs->tx_sg.sgl, rs->tx_sg.nents, - rs->dma_tx.direction, DMA_PREP_INTERRUPT); + DMA_MEM_TO_DEV, DMA_PREP_INTERRUPT); if (!txdesc) { if (rxdesc) dmaengine_terminate_sync(rs->dma_rx.ch); @@ -778,8 +777,6 @@ static int rockchip_spi_probe(struct platform_device *pdev) if (rs->dma_tx.ch && rs->dma_rx.ch) { rs->dma_tx.addr = (dma_addr_t)(mem->start + ROCKCHIP_SPI_TXDR); rs->dma_rx.addr = (dma_addr_t)(mem->start + ROCKCHIP_SPI_RXDR); - rs->dma_tx.direction = DMA_MEM_TO_DEV; - rs->dma_rx.direction = DMA_DEV_TO_MEM; master->can_dma = rockchip_spi_can_dma; master->dma_tx = rs->dma_tx.ch;