Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp438131rwe; Fri, 14 Apr 2023 05:19:10 -0700 (PDT) X-Google-Smtp-Source: AKy350YxUDbmryX9/QQLMqn0KVUPMGgIPE7X/vwSCaug2T8u+mO2xRE3Xlck3g2y4e2c11UCv+Ee X-Received: by 2002:a17:902:7489:b0:19f:3d59:e0ac with SMTP id h9-20020a170902748900b0019f3d59e0acmr2544105pll.44.1681474749865; Fri, 14 Apr 2023 05:19:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681474749; cv=none; d=google.com; s=arc-20160816; b=HfRd4kOmHpFkV9sQgmqthPEGrBCdbHKyEvPIROxQFs9aMwL32e+BUJ/yraVNlTefdU /6BwWnBgk8hHl/Iy2DkK/i4ACWxUBiNwvl6hhQ7lhP8KuHJniLi5aEBNtIwglYuXFJqc EmXv/zCpxDMEIdv6SYlooRLsfOBTjT0Jg+liZyiwWMEFNFl/7WZTA1o/iU5snbeK82ZB kV/7X6uuNxFkh/MRVXkH6dYPe09RGpQeVwQc/adoZmMEOms6mYdvD2Rez0HFmMeq4nhy R+yyXuBIztmDPgb5ufSXyyybSVRl43Wpkh97yyOYFHvu8ZW/ny5CIPrR4WkL1mn421qF cUcw== 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=65uwjwswhP+aUopNhPv3UiA4NcKEqdUIfoVkzM6bAyo=; b=yKQWQOna1l/ohIJQBDweJMR27O3L2L+13q68M+PSterUup2AJe4B6ZZ+bEbToWBpYx KrRX8LL83f4k9hg1a/i5pAcCqt2BGYHy6yFdyUStOZmO+xD+xCNqYV7aI/IoUz84ElpG 7u1eklX0DtyTyklv2P7SPSixwCqa1hycFBYzbDiuhUFsFS4JMVZ3idevRHRDx4fhGJsa 9CBlq0xOdPSNo00B+lSkSm9xDEF2UGLoAj/KgK+YlDSLkd8i43MDlJSURb58ex9EwiFg YaLhYAXYdyq0XMJpRofYWbd/ZqcV13DrY0ErsGgUSkMnO7yi0VtzZtKwAoiOU32ZHTDQ QhTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=uQubCHw7; 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 jh1-20020a170903328100b001a50ede507csi4432347plb.171.2023.04.14.05.18.57; Fri, 14 Apr 2023 05:19:09 -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=uQubCHw7; 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 S230206AbjDNMFj (ORCPT + 99 others); Fri, 14 Apr 2023 08:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbjDNMFh (ORCPT ); Fri, 14 Apr 2023 08:05:37 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D3E59EE3 for ; Fri, 14 Apr 2023 05:05:36 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id j193-20020a2523ca000000b00b8f6b82ec94so2504384ybj.18 for ; Fri, 14 Apr 2023 05:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1681473936; x=1684065936; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=65uwjwswhP+aUopNhPv3UiA4NcKEqdUIfoVkzM6bAyo=; b=uQubCHw71w6O5XUQutjA0LoDpSL+v+TuXE7SpijzhdY0JXfM0e0pQaW2iEN6icIOIn /s75BK6Tjvx1t0KMTqBurrQfuw3f6vYbuyu4tcYmsAXpvsr0nZKk1831iznXGpFKYWYJ UcftyaBaMnZ4i2G6zZJTBSS7QWCMH3Al34GMKx8XLeB2UrazIZsFWXpLrzEKvADfMYyX nuvtJjH8kJ9QMIgrJ17Rn0gQ+Dy+EVO6Yo8R0ZOaQ9LNL4i/jynn5CGsLzwBkafmpoa4 r4PdLkG5fgB0AJfp++xDofE0gCar0kFtZRO88adxNRP//ldNAki3n3toqaKsW0p/WsnZ fGKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681473936; x=1684065936; 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=65uwjwswhP+aUopNhPv3UiA4NcKEqdUIfoVkzM6bAyo=; b=hM9vp/0N/gA93x3MTrK88DacqwLJmaH6xDITRTjZZ/U60ZZKcXdZU0YNNfur/yFRlL QA24tDZ88cyLczs+o6rnjQAmXyZ5QZx/7d8icndalWYxuz54Rf4cThd3vsk8UQWrCjg5 rqyvGvhb2DbiZaCuBhWPn3J5EcCguTuD4os7jK9Y6YQXgkuGGUQM+3dZa3IKbvHfQjJV lc+nfxsIdQ344BTGh2dQXXwdaOaw2O0O0oDfyMVFAVFj2ey2Ngpq6yN3XqZ8SDSCxvPg 8NWuXYe6IrSQQ4mBCErDng8kMVfiHrmVEa4JI7SRFbcZ5iKTSld2y3GE8fJr+xojYTjL POsg== X-Gm-Message-State: AAQBX9doImSSfihsFPy8iupbXwVwP49IiIL7j1g6jVDzb6iWgWwP2Y9D ch/lixGkaVrWqIoykZnKvEAJC/jKp9+o0w== X-Received: from joychakr.c.googlers.com ([fda3:e722:ac3:cc00:4f:4b78:c0a8:6ea]) (user=joychakr job=sendgmr) by 2002:a81:b303:0:b0:545:1d7f:abfe with SMTP id r3-20020a81b303000000b005451d7fabfemr3555808ywh.7.1681473935975; Fri, 14 Apr 2023 05:05:35 -0700 (PDT) Date: Fri, 14 Apr 2023 12:05:17 +0000 In-Reply-To: <20230414120520.360291-1-joychakr@google.com> Mime-Version: 1.0 References: <20230414120520.360291-1-joychakr@google.com> X-Mailer: git-send-email 2.40.0.634.g4ca3ef3211-goog Message-ID: <20230414120520.360291-3-joychakr@google.com> Subject: [PATCH v6 2/5] spi: dw: Move "dw_spi_can_dma" function 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=ham 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" function implementation below "dw_spi_dma_convert_width" function for handing compile dependency in future patches. Signed-off-by: Joy Chakraborty --- drivers/spi/spi-dw-dma.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c index c1b42cb59965..75e1b11af7c9 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,15 @@ 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