From patchwork Fri May 31 19:42:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682071 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 7EB64C25B75 for ; Fri, 31 May 2024 19:47:53 +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=zH7IRP9QpyXlCCJRCEBxGZSm5dWJlNDbkEgxcmAp6Xo=; b=UF23lwIuk8eFYB 5llXKwFXOIUfj2DF9s880Eu1GGNbudQBI2hHOcXAd1AxOagGKlY9cVDFeuKCW/jLT0SCNt9+0LegE PHOVtYTKS/UzN4mD9O2rQJ2SlREM1cNUauGO9wRQkHYXbKBbKViUijwJrSgsxwpBoQS5Gg8eXBPxD zm+VkG6dsnPlH5B8AKWr9+VirqzJsCuBWoExxbQWrXo8LciskeCLVEsoalgDocfoyTIWl3NoPftoz uiGOds0xgNG/ANdcKs+IE/j4NL5+UwNHgL7ysLFnGDlDBpR/ok1OaCAXTvoEqhg5PPzGquuqNU0OC P4boyIMPUAAamNS7SsaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8E0-0000000BIR7-0VVT; Fri, 31 May 2024 19:47:40 +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 1sD8Du-0000000BIOt-1t7f for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184855; x=1748720855; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=h+TKuS+Kdb3EPN8yAMusweqbJNDGlVqQOxmyBy/mh6A=; b=RiiH/wTB5pdkP/SimkbFPjaWMRCMU0m7d46CyQ9YO+ReZwlyi4KBbdP+ HNZtGWn6KxAluZIzwHM37MHSRik5KJU4sRL+Jik+DAwsvE8jaV6OetACo FemHZPCgIs12bmfOrQ4wProst9mzImFy7g/oR3VW1pTLJYYulW+4vRTXy ux2uXs0JtFivP47zEuzr3IttTNeEi1rSxGkf/46sLBBFRcxGa7v8nhzMs NNXVGV48YAgq29p3NJhdZXlDCl+r/mJcMsfUHetBIPbFt+RBkFD9NZrp8 7xpb4ec9aiprTors3EceJgHD3729M1dbGioj1jmOIhLbw2KLhsaX2DHNH Q==; X-CSE-ConnectionGUID: w1USwMviRzmUtPwExBW6Lw== X-CSE-MsgGUID: RF6FTT6UQ0C9ysFwjdkyfw== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144642" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144642" 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:29 -0700 X-CSE-ConnectionGUID: wmQx8GSBSMyebRW4k5MCGA== X-CSE-MsgGUID: BrgdulQQRBK5Wbl/9p+0fQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452621" 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 1639641D; 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 2/8] spi: dw: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:34 +0300 Message-ID: <20240531194723.1761567-3-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_124734_628084_06E7DBD0 X-CRM114-Status: GOOD ( 12.54 ) 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 Reviewed-by: Serge Semin --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index ddfdb903047a..431788dd848c 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -19,6 +19,7 @@ #include #include +#include "internals.h" #include "spi-dw.h" #ifdef CONFIG_DEBUG_FS @@ -438,8 +439,7 @@ static int dw_spi_transfer_one(struct spi_controller *host, transfer->effective_speed_hz = dws->current_freq; /* Check if current transfer is a DMA transaction */ - if (host->can_dma && host->can_dma(host, spi, transfer)) - dws->dma_mapped = host->cur_msg_mapped; + dws->dma_mapped = spi_xfer_is_dma_mapped(host, spi, transfer); /* For poll mode just disable all interrupts */ dw_spi_mask_intr(dws, 0xff);