From patchwork Fri May 31 19:42:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13682073 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 37B4BC27C50 for ; Fri, 31 May 2024 19:48:00 +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=omUsI/pm2VsoWa9x4UKgjjzl/kpwTavH+ylrAYHJQY0=; b=m3K67ppGq7JZYF qBF7hGrItXoZSsifrVl5oBanfscWSW8K5vtgV+1rwRVcm6n0PC457S4subYgi51ni/oOKnMuG0CkX FzFbdGnPRACvCuxSeWLp4MoYtKGoXolQmcavmeBtLvQbwxZUHrHG7Zjb4L602K72HVwJszGFhMVVO rwmzGjcldaAOygCPQe3IkHIZOx2efjYJKqYP21H5Ra2kc32j7ulLcpLH6LP9/Ws689UGcOYjsaLJ5 gFiDxEOKr8lzO8ogzAcAWdOKHOrmRNfcUrdzU2TdD1QD3gBUbQA9E4+wBMcuKE0PEABfLWJcUHo8b YyJ3ICLgzx0lWNWN/TXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sD8E8-0000000BITN-2LlL; Fri, 31 May 2024 19:47:48 +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-0000000BIOt-1ouf for linux-arm-kernel@lists.infradead.org; Fri, 31 May 2024 19:47:37 +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=NPol/R/h+TdNNpLaDetGmpColwfnbBnkxBZCvk+JrSg=; b=X+rCaItkrYfiOHCt8WTBRt/gLF/DfSiDltQWeyK7rqqnyWH/f47j1TE6 sR0yHrgzEu31q5dmC9c6Q0FFNvb4vtPfABhr+21HiPh8FdmloP3HuEIDf +dkUK0nDEh+GVBqGXyzBT2fqaGJKcAB0ZRFSDyS6pQmAOq/1IuUMgqnLz MuxGZdbJ0XFM0tW+u6aFl8MgJVzfGmXmPt0aJRK6mQpo6bD/YrraNnbq3 OOPGu7JuEBTf88i4s3l+LTs8HyMxTPUz3OTixB4jOOI/mHgXcSnYrGbS3 oGxsM19QueB52+HsNyXrBx3ySUnMO70BQWoCEHIrmddj5o4GeORQEf/Vr Q==; X-CSE-ConnectionGUID: MvdGg7p8SgORLOCHTB6zcQ== X-CSE-MsgGUID: 0s0DSWeZTaqRD8PQ/a5CBw== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144654" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144654" 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: 48QEDkXyQ/mungdUvq7PWg== X-CSE-MsgGUID: 4vLsBDPPRN+K8D49bPj6sw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="67452619" 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 2015E650; 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 3/8] spi: ingenic: Use new spi_xfer_is_dma_mapped() helper Date: Fri, 31 May 2024 22:42:35 +0300 Message-ID: <20240531194723.1761567-4-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_124736_512611_2A272AAA X-CRM114-Status: GOOD ( 13.32 ) 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-ingenic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-ingenic.c b/drivers/spi/spi-ingenic.c index 003a6d21c4c3..318b0768701e 100644 --- a/drivers/spi/spi-ingenic.c +++ b/drivers/spi/spi-ingenic.c @@ -16,6 +16,7 @@ #include #include #include +#include "internals.h" #define REG_SSIDR 0x0 #define REG_SSICR0 0x4 @@ -242,11 +243,10 @@ static int spi_ingenic_transfer_one(struct spi_controller *ctlr, { struct ingenic_spi *priv = spi_controller_get_devdata(ctlr); unsigned int bits = xfer->bits_per_word ?: spi->bits_per_word; - bool can_dma = ctlr->can_dma && ctlr->can_dma(ctlr, spi, xfer); spi_ingenic_prepare_transfer(priv, spi, xfer); - if (ctlr->cur_msg_mapped && can_dma) + if (spi_xfer_is_dma_mapped(ctlr, spi, xfer)) return spi_ingenic_dma_tx(ctlr, xfer, bits); if (bits > 16)