From patchwork Wed Oct 19 14:02:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Milo Kim X-Patchwork-Id: 9384757 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E785760487 for ; Wed, 19 Oct 2016 16:15:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D9E6B298F7 for ; Wed, 19 Oct 2016 16:15:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE7D72990C; Wed, 19 Oct 2016 16:15:36 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBF3A298F7 for ; Wed, 19 Oct 2016 16:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938720AbcJSQPU (ORCPT ); Wed, 19 Oct 2016 12:15:20 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35106 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935178AbcJSOTs (ORCPT ); Wed, 19 Oct 2016 10:19:48 -0400 Received: by mail-pf0-f193.google.com with SMTP id s8so2621042pfj.2; Wed, 19 Oct 2016 07:19:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HAq52vfySFAZrb0ciK5RD6NZdhGNJ4ZO3071toIlnCg=; b=oOgBWk4htaWf8nZ3Y+V9Tgd+iqGNjq1vc/ZcvYBq6gKK8i8T1Yt2u3b9WW1rDFXCIY 79qb8HJvsN6urBIRV1xg6/y+0KsxYPjiY34tS+mPv7LICljg1MlruA5rVzMcizt+1D40 4pQEF1qa3jRuylkLEtLXk7+TI3S+nlXrBwA8jrqBBx8jcXYnqZkvicdhBalb6zrq2GRY VrwVmCjpfktircx03ebIxgw/6HKp83Mi+b79AkR/mH+GoHgX1iHWQVbhZgt5y0WFTb7B 3bNea0iu5RSCnGdDNSPVFt90Um7zcdNIQz8v3kdUFa6gvoZtdhWENSYr6uJU783Stpzo VeSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HAq52vfySFAZrb0ciK5RD6NZdhGNJ4ZO3071toIlnCg=; b=VOTAJUzTN3D+ANlqnRwOuh5h5Vjy4Q9jw3xgDxmyuBGJ0U0FpXF55zT+4EMshCs2a5 uDNvTzT4yMotwsHjRmFoTx7YoHyF8PMhDBdeGOn0J7vORcSk7yb3o84y6abtA1lVRdVN byEbC0r+0lAeL8EyGIo8FGlfr8s2vT9de4NlvVeaNN96FA51jI7Q6c5Vj4UQ8ySGkvFq euaHmK+tC6GPDVfYbHAgrI4sQTVfPjQPFckreM1bRESVU9fepmOOyhtBlai+FV8+D886 kv5lB4sNrg51z3NedSrBF/5kEoyZB6yj/MVdkj+TRcQ+Yk0+J4Ban+5k6gTuKH1W1TgK rGMQ== X-Gm-Message-State: AA6/9RkcFzNTiJNioTiqu14FWMAgHx4KDmE1cFsGYXOmFEaejPICwWE0DhF8ddL653U9Hw== X-Received: by 10.98.36.91 with SMTP id r88mr11732690pfj.10.1476885825465; Wed, 19 Oct 2016 07:03:45 -0700 (PDT) Received: from milo-dev.kornet ([121.136.232.72]) by smtp.gmail.com with ESMTPSA id e74sm63462700pfk.13.2016.10.19.07.03.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Oct 2016 07:03:45 -0700 (PDT) From: Milo Kim To: Mark Brown , Maxime Ripard , Chen-Yu Tsai Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, Milo Kim Subject: [PATCH 3/3] spi: sun6i: Use the driver data to get the buffer size Date: Wed, 19 Oct 2016 23:02:34 +0900 Message-Id: <20161019140234.13518-4-woogyom.kim@gmail.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20161019140234.13518-1-woogyom.kim@gmail.com> References: <20161019140234.13518-1-woogyom.kim@gmail.com> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The argument can be removed because the driver private data has it. Cc: Mark Brown Cc: Maxime Ripard Cc: Chen-Yu Tsai Signed-off-by: Milo Kim --- drivers/spi/spi-sun6i.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c index 91235b2..c638f5d 100644 --- a/drivers/spi/spi-sun6i.c +++ b/drivers/spi/spi-sun6i.c @@ -105,8 +105,9 @@ static inline void sun6i_spi_write(struct sun6i_spi *sspi, u32 reg, u32 value) writel(value, sspi->base_addr + reg); } -static inline void sun6i_spi_drain_fifo(struct sun6i_spi *sspi, int len) +static inline void sun6i_spi_drain_fifo(struct sun6i_spi *sspi) { + int len = sspi->fifo_depth; u32 reg, cnt; u8 byte; @@ -125,8 +126,9 @@ static inline void sun6i_spi_drain_fifo(struct sun6i_spi *sspi, int len) } } -static inline void sun6i_spi_fill_fifo(struct sun6i_spi *sspi, int len) +static inline void sun6i_spi_fill_fifo(struct sun6i_spi *sspi) { + int len = sspi->fifo_depth; u8 byte; if (len > sspi->len) @@ -270,7 +272,7 @@ static int sun6i_spi_transfer_one(struct spi_master *master, SUN6I_BURST_CTL_CNT_STC(tx_len)); /* Fill the TX FIFO */ - sun6i_spi_fill_fifo(sspi, sspi->fifo_depth); + sun6i_spi_fill_fifo(sspi); /* Enable the interrupts */ sun6i_spi_write(sspi, SUN6I_INT_CTL_REG, SUN6I_INT_CTL_TC); @@ -293,7 +295,7 @@ static int sun6i_spi_transfer_one(struct spi_master *master, goto out; } - sun6i_spi_drain_fifo(sspi, sspi->fifo_depth); + sun6i_spi_drain_fifo(sspi); out: sun6i_spi_write(sspi, SUN6I_INT_CTL_REG, 0);