Message ID | 20230414120520.360291-3-joychakr@google.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp337470vqo; Fri, 14 Apr 2023 05:20:12 -0700 (PDT) X-Google-Smtp-Source: AKy350azENlq3w4pOLsqcKHXn9P4Fdb1cDtGxSxvY9OXa4dlagzMDY98Q8caje1PRtTsdOCWcogR X-Received: by 2002:a05:6a20:7345:b0:ed:2657:8860 with SMTP id v5-20020a056a20734500b000ed26578860mr3946705pzc.6.1681474812020; Fri, 14 Apr 2023 05:20:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681474812; cv=none; d=google.com; s=arc-20160816; b=g43moPeyHbf25ByqaPNP6QX9tMV2N9qvW0qxmnRDOnsgPLd4dhaBcaqRI2Fu9BN+Hi QW7fg12lmNwzuN/stS+0ZcvkpxnjfuDjCeY2Z0G74Qy0gq7fnB4PgV9GUOjiEwc711ad RIicdwiP3jFAdVzfK7i0neoIuGfkuf1Fw7S69SgodqgqTsbI29N7Fzf2fd7F9euxH1PP QlECDAs+gfNpcp0Ux7FMxy2duErdkusElHLv62Nwr3McWzJraYTVwfNU1i6D9rn4U8eS zRcQWwwJeJpkuJ6pqvQrs0O5sk0QdsMG558wNUzMasCweK/MHuJaGVVzg/+YchyP75F5 rk2A== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r20-20020a6560d4000000b005181ce23024si4446937pgv.896.2023.04.14.05.19.59; Fri, 14 Apr 2023 05:20:11 -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 S230209AbjDNMFj (ORCPT <rfc822;leviz.kernel.dev@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; Fri, 14 Apr 2023 05:05:36 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id j193-20020a2523ca000000b00b8f6b82ec94so2504384ybj.18 for <linux-kernel@vger.kernel.org>; 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 <joychakr@google.com> To: Serge Semin <fancer.lancer@gmail.com>, Mark Brown <broonie@kernel.org>, Andy Shevchenko <andriy.shevchenko@intel.com> Cc: linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, manugautam@google.com, rohitner@google.com, Joy Chakraborty <joychakr@google.com> 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763154132484769225?= X-GMAIL-MSGID: =?utf-8?q?1763154132484769225?= |
Series |
spi: dw: DW SPI DMA Driver updates
|
|
Commit Message
Joy Chakraborty
April 14, 2023, 12:05 p.m. UTC
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 <joychakr@google.com>
---
drivers/spi/spi-dw-dma.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
Comments
On Fri, Apr 14, 2023 at 12:05:17PM +0000, Joy Chakraborty wrote: > Move "dw_spi_can_dma" function implementation below > "dw_spi_dma_convert_width" function for handing compile dependency in > future patches. We refer to the functions like func(). ... > +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; > +} > + > + Single blank line is enough.
On Mon, Apr 17, 2023 at 4:13 PM Andy Shevchenko <andriy.shevchenko@intel.com> wrote: > > On Fri, Apr 14, 2023 at 12:05:17PM +0000, Joy Chakraborty wrote: > > Move "dw_spi_can_dma" function implementation below > > "dw_spi_dma_convert_width" function for handing compile dependency in > > future patches. > > We refer to the functions like func(). > > ... > > > +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; > > +} > > > + > > + > > Single blank line is enough. Sure,I will make these changes and send V7. Will wait for some time to see if Serge(y) has any other comments on the patch series. > > -- > With Best Regards, > Andy Shevchenko > >
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;