From patchwork Thu Jan 25 14:49:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13530993 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 244ACC47258 for ; Thu, 25 Jan 2024 14:51:17 +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=uTdQifmzgyvZzu99jhsVqVJwz1ITAH5i9Aruv93YHp8=; b=KoiwFU/tUWT3ZP pr2zXsQhD1VDaoCZZPzK9AbFogw/RULNP9SAwI0tDHyxFDyExvbK1vvdbORMxy7e+nHgQfRuOvSVi pTi+EKb9OLDVpU/ecIJbzfJqNA9Qh45T8Pw6ja2jKXxpZd3O/hUKSP4Hbs5VzaC6QFPi95b9dom6k b8f3KzWsEWlzyffAu9w0RDeCtrbGEEY5mu2yH6es2041yA5JCKTaKhizEF6+Feb8GO9n/1txE1wuT 3mQ6Zy9dxdsIEoGMx5efsYEmcdAJcKHGLK02yli37du+GmE/H8zVSsMfAdSZi45WZEN7sqjllXrny iN0ALmod6gcYLksJPQNw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT14K-00000000SYc-3vXq; Thu, 25 Jan 2024 14:51:04 +0000 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rT13d-00000000Ryc-2fDi for linux-arm-kernel@lists.infradead.org; Thu, 25 Jan 2024 14:50:23 +0000 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-40eacb6067dso54901685e9.1 for ; Thu, 25 Jan 2024 06:50:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706194220; x=1706799020; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hyD58l2q8nhDuUGflXpNsuJj2JpRaUrHNBwM4NRI1zM=; b=JflAtwkU64VkQWyUl6LU68BFD90Wu2HtHLPQFMY7bG1fa1i/hM+qRP1Zt8IR0obQy+ X97tIVsJiem83xXCHKr7rO40mnF7KvZky3mlF597ptsu/Mm+6KLmJ8lPA9p0lck2yxX1 MVo2gbWUorcuELMAXBAWdvnOZE5Ph0SnQ9XNAgT0BMZ01/whFN/ue0XMdQD2J/xjJDey ev4pjxYu+RHYsmjiuRhMo83/eqWR+4AEJCE2bDAVf/V0d16CUh8YrnDNmE8ff+M2OKEL PRepGqxKoUKv2SlYMUP02AQBrN882xFReA1knxZf63707jlLnpgvNV5JV9npkUbzR2wq ZPtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706194220; x=1706799020; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hyD58l2q8nhDuUGflXpNsuJj2JpRaUrHNBwM4NRI1zM=; b=WeXLrFTsWNS6BCfy4PQRNtSApstoYriXNcS9sxfUrcZRCydiu/pqHxTFYQYRexQFJh 60nBCpxbgepsYr1NbJQnQGb+2lemawhPM9w2cc3AIwDJdLszpYHxGwJdtLmfRehtxdoP rY6D5D1EbjXxUBZi6C/1oDiEb0GhOSgn9wQlPlayKQHlF6F4h0PSZy8yGlQtm2/9yK9M HBi3616TvhmY6PBf8qj7kA+g3o+94xDvkffC3/rnP8JuYWO4BvYmw2l1F07//yZRq2wH NnvNTzYqTQKy5p9mCuaRTkkcbI4aCsuKAf/LxaY5z1DtBvXqg2Rn8lVREomGlgkCdUUm Yz0Q== X-Gm-Message-State: AOJu0Yx+BZtocmGkZZIDKxgQXr0nC8kS/reybgdSOmdchvJbMGCxrpRi VQ7ghfeZQjkHx/qC/v20sdh5t1SiHwGEimhQjgOsXjZ71g7ZvEP3orvX65LK9BY= X-Google-Smtp-Source: AGHT+IFZ3UUBgZszn/1wxPMDahDYbmeO132hJ61mryKHgvR3GcuAuY7RIRfAUkP4M4TdvC1n34cQtw== X-Received: by 2002:a05:600c:2a4a:b0:40e:46d5:144f with SMTP id x10-20020a05600c2a4a00b0040e46d5144fmr290304wme.373.1706194220403; Thu, 25 Jan 2024 06:50:20 -0800 (PST) Received: from ta2.c.googlers.com.com (88.140.78.34.bc.googleusercontent.com. [34.78.140.88]) by smtp.gmail.com with ESMTPSA id v17-20020a05600c471100b0040d91fa270fsm2875875wmo.36.2024.01.25.06.50.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 06:50:19 -0800 (PST) From: Tudor Ambarus To: broonie@kernel.org, andi.shyti@kernel.org, arnd@arndb.de Cc: robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, alim.akhtar@samsung.com, linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, andre.draszik@linaro.org, peter.griffin@linaro.org, semen.protsenko@linaro.org, kernel-team@android.com, willmcvicker@google.com, Tudor Ambarus Subject: [PATCH v2 11/28] spi: s3c64xx: move common code outside if else Date: Thu, 25 Jan 2024 14:49:49 +0000 Message-ID: <20240125145007.748295-12-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240125145007.748295-1-tudor.ambarus@linaro.org> References: <20240125145007.748295-1-tudor.ambarus@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240125_065021_833066_681B07F0 X-CRM114-Status: GOOD ( 10.42 ) 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 Move common code outside if else to avoid code duplication. Signed-off-by: Tudor Ambarus Reviewed-by: Sam Protsenko --- drivers/spi/spi-s3c64xx.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index b048e81e6207..107b4200ab00 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -286,20 +286,18 @@ static int prepare_dma(struct s3c64xx_spi_dma_data *dma, if (dma->direction == DMA_DEV_TO_MEM) { sdd = container_of((void *)dma, struct s3c64xx_spi_driver_data, rx_dma); - config.direction = dma->direction; config.src_addr = sdd->sfr_start + S3C64XX_SPI_RX_DATA; config.src_addr_width = sdd->cur_bpw / 8; config.src_maxburst = 1; - dmaengine_slave_config(dma->ch, &config); } else { sdd = container_of((void *)dma, struct s3c64xx_spi_driver_data, tx_dma); - config.direction = dma->direction; config.dst_addr = sdd->sfr_start + S3C64XX_SPI_TX_DATA; config.dst_addr_width = sdd->cur_bpw / 8; config.dst_maxburst = 1; - dmaengine_slave_config(dma->ch, &config); } + config.direction = dma->direction; + dmaengine_slave_config(dma->ch, &config); desc = dmaengine_prep_slave_sg(dma->ch, sgt->sgl, sgt->nents, dma->direction, DMA_PREP_INTERRUPT);