From patchwork Fri May 31 19:42:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682077 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 5833CC27C4F for ; Fri, 31 May 2024 19:48:07 +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=8LlpTtCRydtDSIOoGl+yBpS9JidgVdAIHjmX4bYb/X4=; b=nQLqssAmHyBbMe RIh0SPdMLIY1sWZCuEq94IstD3SuyEmLhv89SvKkv/aHKgWxwpk7c/Xc6oyb4iL92RF9KvP5iJGxN rbLKJMdAxCRL7l5XUMpMxTuhq5JUmGSvQvXVZhlyLd74Gy17Xjni8PvSUHq9+JiysQZ9nKeEtpXYT g7keKL9RC7jwoNOEOPvoTZoKVSgMRK0Dhf4Wgd1gmAv5tGckuscHr1HC8WfwyPL9yfieB4p5X/+ak bfqhJqhdPo6TL2zwuzdyoiAGhEf3S2X0O4hmaJmCV+DdGDRzHfEeqhqWB2sS4pFZ3D08lcr1k5ooU htywjE/0ShdotDbzkbIA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8EE-0000000BIXf-1ImF; Fri, 31 May 2024 19:47:54 +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 1sD8Dy-0000000BIPs-1aDO 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=V8BjWKXND1DprtSPvDdNYQPO5LtJssRIUnnGwI0067k=; b=GNtqa/ayQTRAITiceijvc98BT4OzBvIpqxAllM15ILSsZVkXz6w2h7je QDIZm8CEOVdaw84OoW+jrKOHDZDYV6v9g5NqM/aX0V6Av8L33rYNaq9kG EIgOnmuhVX6Wto+88yMtsu2gZa5XjboJ/rSnHmPYtOLEjCWXAhh0oKzYz 02Fofqee4f9bmJryIBN7FDq0GkqPXpmZBBp89bAKGyv2pgLPahRBx5uos pOBBz2FnYIE/8wGshQclA+SGYEwOGPlkscSti4h0e3HI2/I6gwDn03ZIQ 4ksQsRsZradbeECjHP2xcUIo7kGL22Ukc2VR+4SxvwLQFmr3PNNtjdsE/ A==; X-CSE-ConnectionGUID: ro7w4vrCSN2tSg9jR7Ca7A== X-CSE-MsgGUID: Xdf9cCJeRIqxEVf/vKT0zw== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144709" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144709" 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: 1A16O+DhRjmT9I//t+XD+Q== X-CSE-MsgGUID: oI9PyvAUSjmVJuk2u7GBNg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452633" 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 5206E6AB; 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 7/8] spi: qup: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:39 +0300 Message-ID: <20240531194723.1761567-8-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_124738_464577_77FCF7E9 X-CRM114-Status: GOOD ( 11.88 ) 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: Bryan O'Donoghue --- drivers/spi/spi-qup.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index 2af63040ac6e..06da4aa7eeb7 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -5,6 +5,8 @@ #include #include +#include +#include #include #include #include @@ -16,8 +18,7 @@ #include #include #include -#include -#include +#include "internals.h" #define QUP_CONFIG 0x0000 #define QUP_STATE 0x0004 @@ -709,9 +710,7 @@ static int spi_qup_io_prep(struct spi_device *spi, struct spi_transfer *xfer) if (controller->n_words <= (controller->in_fifo_sz / sizeof(u32))) controller->mode = QUP_IO_M_MODE_FIFO; - else if (spi->controller->can_dma && - spi->controller->can_dma(spi->controller, spi, xfer) && - spi->controller->cur_msg_mapped) + else if (spi_xfer_is_dma_mapped(spi->controller, spi, xfer)) controller->mode = QUP_IO_M_MODE_BAM; else controller->mode = QUP_IO_M_MODE_BLOCK;