Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp4925594rwe; Mon, 17 Apr 2023 22:30:53 -0700 (PDT) X-Google-Smtp-Source: AKy350Zg8vzIbxe+N379eeB/FUIBUVeVAOElBGheSggW8q8ijKP4X1lw57nQY7RCVhJGBQCYUu5x X-Received: by 2002:a05:6a20:6a0d:b0:ec:628d:582 with SMTP id p13-20020a056a206a0d00b000ec628d0582mr22906637pzk.21.1681795852850; Mon, 17 Apr 2023 22:30:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681795852; cv=none; d=google.com; s=arc-20160816; b=nlfqPwzu6Z8HFSM6+9XWzCdtxZ8niYbyg8VfTj01d4NguRSZQGhYRrKFdT8sZ927wT pbreDtaaBoNqels9iODlrrk8p2pJVVtwMdyfW0TsbY/3O0cwiBV92RTknq9DpCZduX5i DXSN8SarHZ35DnYJZf/jLlMHFLPAc79Ea5PrCpZKTS11fFuRKzEdz3k/SAQdils9d7zZ ysZS0n41ePY3fwCJ7LWqLIIHisHPi/xnUt7nVot7Ao4DVTnDiF08VYNvSVT3q+9PZHFo YAsuqfp6n/H/9RqjDYmP3IENLjmjIvl4WcyN3mLHD3AN28+MkLJj6OOACwmGtPiovVxk za2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=8xCBVt+yTzL9gm6ligFFQCFbRni90/tGiHt7eRsjBtY=; b=SqB8sZC5StSDSgLp0SL0LoYJknUL3Ih+6KZ3y27oICfOsAc2vauSGQKj8Tkw9mOXZL vzcXRBMxFG/p9pXCbhg/O12ClYZaHHt4NyBEieewoZ1j8dB4uQagYBqQgt+EwkRE1vU/ +LGdTTIir0sWQtBQskHgl2pgDcbs25BUTMwukZMVMOt6CH3OXyBYP3ZwXV0L8DhdMHFh hRyEMS4dxMdNxlOT0ONmUNkSiONYpFNSpXDpEakXwcdZ419YLRGYB/fBQUF0MM8BL3qB 8INHc4ao8mKL9WjZ18CXNDWW+8nBxuMzWN4H/VKn9G7kp/6CAESbBk9cY36FTjQDoRXM j/BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6XqlMtOx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x18-20020a63db52000000b0050726756ee9si13539782pgi.92.2023.04.17.22.30.38; Mon, 17 Apr 2023 22:30:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6XqlMtOx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230332AbjDRF3X (ORCPT + 99 others); Tue, 18 Apr 2023 01:29:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbjDRF3U (ORCPT ); Tue, 18 Apr 2023 01:29:20 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C353159FE for ; Mon, 17 Apr 2023 22:29:17 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-54f8d4f1ca1so159228537b3.20 for ; Mon, 17 Apr 2023 22:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681795757; x=1684387757; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=8xCBVt+yTzL9gm6ligFFQCFbRni90/tGiHt7eRsjBtY=; b=6XqlMtOxsqrT/1r2wZChHQ9ZpRkAmrUq+OgSX89spFBhvd/cSZJLUdWgaOp8WIePRa PSSby6xBdcgXm6GSBJtUxdkkVhgbn76OAIzMm/qb3Jd3d3cOI/DxQZSDVfK1Gyavudy/ gqGBDA5QaQlZ1Vag2qsySvdPZlBZncqqptuZ3ZzRaiuuiXqI4vaA20IgbcB3lKGE8YfK IWIj5XP+2e2gi0GQshi/crBqMcV5H1AueWiSPrem+/BxIPu7Wrn2sn6kXDbbyHttpmfW 1NpPO6KsFIIaezfKaU82RfGgYofxQzOg3y5qII5BkT2eSoKsN3e77Y/Fesk/40vFvwX4 PwhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681795757; x=1684387757; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8xCBVt+yTzL9gm6ligFFQCFbRni90/tGiHt7eRsjBtY=; b=MUXVda2Ep5z9XG95kMb793gu3aKQLKe3hy4qoZgtdINXsiBcAQa9ZhsChF7waDwVud 8yt7pKg33tc6KHr0y1Jf3yBiztne4nBj7kq5XbYnh8D2GpBMBdgvNeEmp0KTAfhEiMNX cryTXGUhVFT+rVhmLYlr7HFnq6WcTcUJejKoeLPXTatLIvi3NRFATo7M1bycRXIiXgvO 94HALt8Tbfx0pvb1bYG9+tC1Cs8MsTrDrIejoAOgTjUc1ujVj8Zgs+hQqTU7Jk9ynpKu exlK/0IB+zbkPY3oeZGWyGsfNTds9v6y8SSrPX6aZv6DFXnT1l6ILJc/JJIx2lVkmjk9 I9LQ== X-Gm-Message-State: AAQBX9eghqB05ZziVMVm38YcDKrGkSURUnnm6zzed+Hvzg6E2UEXChAk sBrtRTCcPS+7PCoime7wHS35Bm58xqbxDg== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a05:690c:706:b0:545:5f92:f7ee with SMTP id bs6-20020a05690c070600b005455f92f7eemr11663447ywb.2.1681795757018; Mon, 17 Apr 2023 22:29:17 -0700 (PDT) Date: Tue, 18 Apr 2023 05:28:59 +0000 In-Reply-To: <20230418052902.1336866-1-joychakr@google.com> Mime-Version: 1.0 References: <20230418052902.1336866-1-joychakr@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230418052902.1336866-3-joychakr@google.com> Subject: [PATCH v7 2/5] spi: dw: Move dw_spi_can_dma() From: Joy Chakraborty To: Serge Semin , Mark Brown , Andy Shevchenko Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, rohitner@google.com, Joy Chakraborty Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move dw_spi_can_dma() implementation below dw_spi_dma_convert_width() for handing compile dependency in future patches. Signed-off-by: Joy Chakraborty --- drivers/spi/spi-dw-dma.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c index c1b42cb59965..f19c092920a1 100644 --- a/drivers/spi/spi-dw-dma.c +++ b/drivers/spi/spi-dw-dma.c @@ -198,14 +198,6 @@ static irqreturn_t dw_spi_dma_transfer_handler(struct dw_spi *dws) return IRQ_HANDLED; } -static bool dw_spi_can_dma(struct spi_controller *master, - struct spi_device *spi, struct spi_transfer *xfer) -{ - struct dw_spi *dws = spi_controller_get_devdata(master); - - return xfer->len > dws->fifo_len; -} - static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) { switch (n_bytes) { @@ -220,6 +212,14 @@ static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes) } } +static bool dw_spi_can_dma(struct spi_controller *master, + struct spi_device *spi, struct spi_transfer *xfer) +{ + struct dw_spi *dws = spi_controller_get_devdata(master); + + return xfer->len > dws->fifo_len; +} + static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed) { unsigned long long ms; -- 2.40.0.634.g4ca3ef3211-goog