From patchwork Fri May 31 19:42:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682078 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 96B7AC25B75 for ; Fri, 31 May 2024 19:48:08 +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=4QgoeAi/61teo9fU0Q0DsirUUdMlbzWFIh7w7iSDP+s=; b=eQabFtwAQCCt+O r6ZvPoimt/+zeDF/9oTACf2Hilh7WjZHT/qKmPXi6TQBEAXwgMtoMSWDrcvu+1hrD6FKYXTHc5Nl+ PXbZLAOZWqqRpfisI/vWATGWZ1bcYnU1+2FAiAbBWOSZTlaFDuTbagvsyWTC2iSjvmKZ3GPlYYoP/ NzcztF/kAmJhWxRkBrSUIAqfqOI12Yga+3hUS0fUXoaDVwP/sKm0k1zpXc4VmksYFS8uSnIRVfJTr D9nugLU9qDAVwDhYVhagRwoNDv1ZyNAvaAscxusZc7f9SROSFW/TByuLsVH2S9KMomN6xZLPy+eyq BnEI+nKdMEPwB5k+hOoA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8EC-0000000BIWR-36Gh; Fri, 31 May 2024 19:47:52 +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 1sD8Dx-0000000BIOt-3jke for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184858; x=1748720858; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=/9eJLkmp3LgLhh+fMgJbD6pR0R5JNL/+VIoLm5XWU7o=; b=jZOXJ4y22njtZ2ZxC7qSlzUR8X4UPX45TmyRZyhRAn3nn1o9wAMBC0mm o5xZ34/M9NwIEfgGhwpHfPChdVwmJovdk9mObysu92ZgCMkllW+l2C0mp 8bSImEucEfgc7Ud5cGvfSTEJm44tthsNmchXDZXAfZFzZlYA0UMulJaxJ TakCvG7QrppAJHEFrOr1iQOc9CeidXTMvVG5VKymaTjwCOwmWKDTmGpbO 2FYHyCn3kk7aSMD5z641yV3BRHgqfRtUW+NZQpRs4uof5LmxFIXACo0rY fao0FG1M+Q/rJYe0LxW0/Y7IfNFY39UET7M7C6rD7iGHwUn1xXSN6LQK+ g==; X-CSE-ConnectionGUID: AzfUVJAgSyWYB/kH+gCPTA== X-CSE-MsgGUID: qhkijx/OQc+bNftrh1kDLg== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144696" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144696" 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:34 -0700 X-CSE-ConnectionGUID: OzG7PVx1Sj6oa374KfTxyw== X-CSE-MsgGUID: w7sprX4/QRubzrJxN+DHJg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452631" Received: from black.fi.intel.com ([10.237.72.28]) by fmviesa001.fm.intel.com with ESMTP; 31 May 2024 12:47:30 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 440BE3B3; 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 6/8] spi: pci1xxxx: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:38 +0300 Message-ID: <20240531194723.1761567-7-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_964608_ABEE9884 X-CRM114-Status: GOOD ( 12.56 ) 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-pci1xxxx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-pci1xxxx.c b/drivers/spi/spi-pci1xxxx.c index cc18d320370f..fc98979eba48 100644 --- a/drivers/spi/spi-pci1xxxx.c +++ b/drivers/spi/spi-pci1xxxx.c @@ -6,6 +6,7 @@ #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include #include -#include +#include "internals.h" #define DRV_NAME "spi-pci1xxxx" @@ -567,7 +568,7 @@ static int pci1xxxx_spi_transfer_with_dma(struct spi_controller *spi_ctlr, static int pci1xxxx_spi_transfer_one(struct spi_controller *spi_ctlr, struct spi_device *spi, struct spi_transfer *xfer) { - if (spi_ctlr->can_dma(spi_ctlr, spi, xfer) && spi_ctlr->cur_msg_mapped) + if (spi_xfer_is_dma_mapped(spi_ctlr, spi, xfer)) return pci1xxxx_spi_transfer_with_dma(spi_ctlr, spi, xfer); else return pci1xxxx_spi_transfer_with_io(spi_ctlr, spi, xfer);