From patchwork Fri May 31 19:42:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682076 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7D1D0C25B75 for ; Fri, 31 May 2024 19:48:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=aFo2Oqq/9ERmd8B7KQwn/XlB/m2Vp/6L9at5MEbVxVk=; b=gYs8S2bwZqozYn mAC2AsDO9Nvsi6XFYVtJ8DcwczXm546jPhgysM+2STX7h7gT39HryvI/JHZxV3mwX6PBHqZ3pgEDR PgOSAYd1yc6IzAJtJ1hqm7YnbiLVQau66BHu/AWKpTPEh//TaL16yiQ0UaEgSHE5aGuZDfVbjfoTf t7SO3w89v5sL+GuA9y5b3NjrEJ5KArEFDH4rOIMIolatCgV7Y/g22DQjMcx9dq/fnSXnfmfnJwduw 1pyciaOVE9OEJtCT8f7DQJlfdV7X9Y8scmXQlYit5kbWwL4RIvJrR5luzEk0ZaRuq3JXGifP+Cxei YXQRXnST1gl0W88v7tkg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8E9-0000000BIUZ-31nR; Fri, 31 May 2024 19:47:49 +0000 Received: from mgamail.intel.com ([192.198.163.7]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8Dw-0000000BIPs-2YH0 for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184857; x=1748720857; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=m6PMMUoDxsMJTLuxxmK/JswtaHUXsRGOeRWlSpgoV5M=; b=bzGOqV6OHvEztBW929gIqbBQ/XdJm4Y6WXgQHnAkjU208ucSBFRh7JoO 5D2RThvVVpf+LRTMobXYTmUHO/7tUopQRzpykhFi2Z2nxh44MEz4qpeIo /B3K72jQ594ckBWYgNcc9rxdOscrU3zTGciXK7s3Dku30nCbAysUdNfHw Ht2BUqck/0OlL5G7QzJPMzyLiWmbyGfQZl1hhkTpr8gODIuwRS0og8D6m /IAi9WHAWNY/1S3F7N4hkfp7KKvniSWxrM9wYEVA2L24KOr3bdmq5BUbk Zb06NIXkIXx21jFkG5fGFPPjJerddxuEXRGTNd/6+3T9eVP4OUk+Ax9qq g==; X-CSE-ConnectionGUID: iBE19M6mRji551EnoYSNGQ== X-CSE-MsgGUID: e7t+kCQcSMWS2YW6uga1Fg== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144665" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144665" Received: from fmviesa001.fm.intel.com ([10.60.135.141]) by fmvoesa101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 31 May 2024 12:47:30 -0700 X-CSE-ConnectionGUID: hnQdOcRDTgGX5Z0NhqkDKg== X-CSE-MsgGUID: dlchLsbuS/6MVxz8w1FczA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452620" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:26 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2CF12668; Fri, 31 May 2024 22:47:25 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , Mark Brown , Yang Yingliang , Christophe JAILLET , Thangaraj Samynathan , linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org Cc: Serge Semin , Daniel Mack , Haojian Zhuang , Robert Jarzmik , =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E?= =?utf-8?q?_A_=2E_Prado?= , Neil Armstrong Subject: [PATCH v1 4/8] spi: omap2-mcspi: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:36 +0300 Message-ID: <20240531194723.1761567-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.43.0.rc1.1336.g36b5255a03ac In-Reply-To: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> References: <20240531194723.1761567-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240531_124737_054998_5B33D66C X-CRM114-Status: GOOD ( 10.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper. Signed-off-by: Andy Shevchenko --- drivers/spi/spi-omap2-mcspi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-omap2-mcspi.c b/drivers/spi/spi-omap2-mcspi.c index 7e3083b83534..b624cc472857 100644 --- a/drivers/spi/spi-omap2-mcspi.c +++ b/drivers/spi/spi-omap2-mcspi.c @@ -27,6 +27,8 @@ #include +#include "internals.h" + #include #define OMAP2_MCSPI_MAX_FREQ 48000000 @@ -1208,8 +1210,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr, unsigned count; if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) && - ctlr->cur_msg_mapped && - ctlr->can_dma(ctlr, spi, t)) + spi_xfer_is_dma_mapped(ctlr, spi, t)) omap2_mcspi_set_fifo(spi, t, 1); omap2_mcspi_set_enable(spi, 1); @@ -1220,8 +1221,7 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr, + OMAP2_MCSPI_TX0); if ((mcspi_dma->dma_rx && mcspi_dma->dma_tx) && - ctlr->cur_msg_mapped && - ctlr->can_dma(ctlr, spi, t)) + spi_xfer_is_dma_mapped(ctlr, spi, t)) count = omap2_mcspi_txrx_dma(spi, t); else count = omap2_mcspi_txrx_pio(spi, t);