Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp674679lqh; Fri, 31 May 2024 12:48:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVt5VGnKFHSOUwH0qxnNcYW2BvNbGX7+wAzEPl64e1hm/rxg21KDG2oWfiMTE4JMO8neIJEIgiVskBq3+hUB3e0+WM1TYI4cIOP4fFtYg== X-Google-Smtp-Source: AGHT+IHv6FN7OkB6ud5CXS6YeIj8u8HXUMWrtl4S8JFGkKDIB7qTLUOiibvDVTt4bMGl/iM59oKF X-Received: by 2002:a05:6358:e81b:b0:199:806e:6c79 with SMTP id e5c5f4694b2df-19b48c55b3dmr270348155d.5.1717184904193; Fri, 31 May 2024 12:48:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717184904; cv=pass; d=google.com; s=arc-20160816; b=C3Pf9hZsaptGUvAoSWl4UV03MYxBEnww/XGkFj+TriHVR/npcV7XF78LMV31DXgCK7 R4lILNZIpSCETt1zByubq1fbk8yQmzW+4445IlnLcL1iCT7Kofo5t60I7l5voa5DIjJQ J/PGzWnb7+Ok6twtHouL6sw7kVPijEjt3PCHzlOHhFyUVJcpqWM1H3PXybQkUaEx+8fx BMVWi0ib890YE+5xMQdJu8h3tEkgp8b/lqhDlJPsLyUYeBM3qO8VLCZyJCzfAF6sCpos agBQhOca1ImBL+2wexFCWx99uKiji69iF/Dxo30jnORStlzpTdTYshomb++0mRvNMajM cBqg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=2kysZSzkp1/xTlLl8cICc6nJbQW6ALILr9ITgAgFBiU=; fh=2o2HR2oDu6e4ue1RmqPLdveM2RcPJfbjbklM2aqgOvI=; b=TnBqj/CMaC1xoyZ0ywREOEzdmTaYmkYBoj7qc3TfOPpwnT4rVjp0CumXyIDt3tOoZk 5T78qHLnCUkyZXtd+1hTRe3IdIPwEMCLuG9wbJv+kpt5vbqomULElRMv3tdFAJSAuWdy nZZgnGuP6E73Pl5hkCaqu+a8ppYaLhlsMvc/au3E1g7VBu/tuVfKnFSHiagbCei+DPnz RgSLhWunViLwABgQIYMsCw6+QyUW7WDuIwhPB6ye4euoQc1vElSUZrx7GWejVT0W7JZN 7IsKpZ3Ps7fjrtyol5DC7w7l6Kbvb1TpusoOppqVtlzSCj33zTNreAvYLfD/6yg1FA9f hOFg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UIME92Te; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-197401-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197401-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-6c35b40c872si2083004a12.556.2024.05.31.12.48.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 12:48:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197401-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UIME92Te; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-197401-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197401-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2D882288224 for ; Fri, 31 May 2024 19:48:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D17A817FAB6; Fri, 31 May 2024 19:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="UIME92Te" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A11DC17D895; Fri, 31 May 2024 19:47:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184854; cv=none; b=GHWHUGJngi/xs4d3nElRR1DAu0vxWCWiameEbp7wwUA1w7ZKrRYsozOMGiYzcMmNHW5ES7vPoON4FNfPtDg5C03DElnJuA88iLV1ZCfIbmWAvw1JgnRHJvs8W5QfpaT/iYP2Q+mxpeWFBM83k42ftpCAoTtll4OTANlj6AUZSJc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717184854; c=relaxed/simple; bh=NPol/R/h+TdNNpLaDetGmpColwfnbBnkxBZCvk+JrSg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kjAFfS89wPGbhNtkr9Er3i/XozVktkg3tGmHVZVF6hjCtR99eZJnKSK+GiJhtSoBdeYp1hMpmrDLLWP91djolamrnsPGXf50ILf9p1ZFm0N/QJIi14cQywS1knMFFQD05YVZ+JTOD13Lb2v706nJhOmZLqG1uk/P/Iz628Lop2w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=UIME92Te; arc=none smtp.client-ip=192.198.163.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1717184853; x=1748720853; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NPol/R/h+TdNNpLaDetGmpColwfnbBnkxBZCvk+JrSg=; b=UIME92TeV3Af4Av7Xsu0DVqQekwRLPeAsNHDRpNwramT6MYbcXLK9tQH VvvVMRSKSQXRThdDUggDB8XPTs81fV+gPdpNaqDa2ERdkpywat2/YbNxv shM3HCYlUgT/8xND6cZhPkyGs86lm78obvVBc0fZbI3FT4azpcpCpGoZw C/0ur0l5LxNbfmND3iOXZKY9zT9Xl8XbmzudyPTNHDacM+WyYQtr8Yhm8 2s+jMTEAnZNYvsaM/KXIsu6sVzutZ5KPzlX/d0i3g04Ynmi0AVZT0AbrL QLcSlPU49/hfPCA4hAK0KOAz92jb07O/ysORHH0NnpqZTDy+GDxD2Sazv g==; X-CSE-ConnectionGUID: wnvTS4zYRdOyVdoC3xh7rg== X-CSE-MsgGUID: m9xTh+NHRPOJlR0nX9Lkfw== X-IronPort-AV: E=McAfee;i="6600,9927,11089"; a="39144663" X-IronPort-AV: E=Sophos;i="6.08,205,1712646000"; d="scan'208";a="39144663" 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=20F=20=2E=20R=20=2E=20A=20=2E=20Prado?= , 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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) -- 2.43.0.rc1.1336.g36b5255a03ac