From patchwork Fri May 31 19:42:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682075 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 B7129C27C50 for ; Fri, 31 May 2024 19:48:03 +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=lUWAH8wlRj80ze15wvsFhmpIUdhT04Bw9mfNmmLTJ/g=; b=qxvq1HSIbZadFL fsR7y42zZgrQ0SbtBZafNm23TLZKGdmykZPK4/bhnVYONtk4LAZJjuQK6fq/5FPSPcipPMVojVxWs AOLUfzeM20DOSxyj7QFFDRju4Xp1EURJWFvFYmiDOMiYyB4gjEcuJEiOIxrS//qjv+aLOXrAjjTjV txt91LRpZzPqdNeIBBaL9Zqe8XuscptDb2kdpdyxcRidCylF9De5xTor/oaItGOA8GP9G6jzztWyS 3i7fq1eVDjJDcI/+/LBmX9pKuqiFbrDptmKjdNmi1q4H1qG/bHkcVhAN8yKB+wZguNxf0a9+E4KnD w8uBK79b1OkNOMgl3OtA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8EB-0000000BIVa-0j6m; Fri, 31 May 2024 19:47:51 +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-0000000BIOc-1StI 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=u6yy5HS9GWcxuh4VW7Sd1i06Xno0PecsrxtOQkR0GKk=; b=j2Q+3PnQVN1FqiyAuy3Do74uNbxBQhoue0V4lt77A+K8s+jsw7PLQdxc rTOiH601oLCbAPGjdYzsoHegpcGN7v06WMzn5oyxnVxPyJOHghffCWN3R E7Up2I70MUGkK/muRWBzRbLyUbjesc/OXSIRi/bN4l9IqfIcwxgYsyZVZ PiCkogyED8iiZ4rChK6KlZFXZe5FxYN0fXSDw0xdDme13RsL5x62XCNR5 HYwJna3Is/VoMD0lDZWTDAeZaz5q7ugxoLwr5q+4AGsSxH0+nAA0HRl6R h7OsQWQUFgG4StZGzwjuXrOnUflLKt+NBj+9FIDuvyUqX/aDqImTa9F59 A==; X-CSE-ConnectionGUID: MZnAsZ8VQZ2WLJzsG0JCEg== X-CSE-MsgGUID: eMcoSR3DSTKLY1msEi7yDg== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144685" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144685" 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: +smJlGlEQgC0zD0PglNuGQ== X-CSE-MsgGUID: ztqxSOKHSeaBviE9im6WJw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452630" 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 3B1FA679; 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 5/8] spi: pxa2xx: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:37 +0300 Message-ID: <20240531194723.1761567-6-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_443381_C473771A X-CRM114-Status: GOOD ( 11.61 ) 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-pxa2xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 1fb30201459f..16b96eb176cd 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -26,6 +26,7 @@ #include +#include "internals.h" #include "spi-pxa2xx.h" #define TIMOUT_DFLT 1000 @@ -993,11 +994,8 @@ static int pxa2xx_spi_transfer_one(struct spi_controller *controller, } dma_thresh = SSCR1_RxTresh(RX_THRESH_DFLT) | SSCR1_TxTresh(TX_THRESH_DFLT); - dma_mapped = controller->can_dma && - controller->can_dma(controller, spi, transfer) && - controller->cur_msg_mapped; + dma_mapped = spi_xfer_is_dma_mapped(controller, spi, transfer); if (dma_mapped) { - /* Ensure we have the correct interrupt handler */ drv_data->transfer_handler = pxa2xx_spi_dma_transfer;