From patchwork Tue Jan 23 15:34:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tudor Ambarus X-Patchwork-Id: 13527633 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 44B05C47DDB for ; Tue, 23 Jan 2024 15:35:44 +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=E/eTQvzPSDmzT0qZdtbWS26DMZnW+i8ittl0R1Ar3b8=; b=t+ZT3xLyDmZFD9 wMs4ZqApCpj+rOp14dDG24/gH9+1QKts3OP/p9kG/1Lfd/G1OUrSPQG3jRY3KYCizS9AyuBFdAhM4 CuV8NhMU8hecaoxKGjVP15dmEJk7Be8k71Y90g7YeLCK4PcCSHVuufz2Yk4zJVhsMxWvqoTz+WRib /ru7FyanmCdp+lPumVKLCCg1S9qqkOVfDxzWnGmZHfB8XL3oNZ8U8jH0MI/DP2ZLnQN8yKbqF7AG+ gYv96r2WHNmK71SwW0dZpbd4OHCsj5ZUYtrkt4OitttSez6SmFvOx6jyJbzAsO8An+rOGmGqNrvzm IC1gi/3Z7H5nCGCEXIOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSInv-00H3pK-2q; Tue, 23 Jan 2024 15:35:11 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSInL-00H3Np-2P for linux-arm-kernel@lists.infradead.org; Tue, 23 Jan 2024 15:34:37 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-40e80046246so27054695e9.1 for ; Tue, 23 Jan 2024 07:34:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1706024074; x=1706628874; 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=iCR0lpI4fVpLmP3DQ9mG8C0OncX2u+kTHiicR+nRZek=; b=tG6B71nSp6mlX9N9RnL5/hIlm746z9CR0XuCjcUAZPVcjKFIfqYlt68UPl66kfaV2C ebOz2WLw1ymCxGqfPv84N3WbVIVlmxtZH8hAmCEebxNcn9CoUyOgWGjmvu7aHukGdmpE C+Zt6Jamr5VCUHB/Tdno2FNLhQWGv5P923x7CNLCTdREK6JWihmT9xSMrObddNTdgi2s BeQuN83vwOqZP7aK74eeA8BtZlxU2wbefnTldL2sjsKBiwKAxhrpWohilCWjclzp9QHg Nx5PfAtv5e/ep65YWzeRXd4k7PdslFWNKqNUMQi9VJ+5OtQ5AtgeSnbiFlmc6kkpjUxC 416g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706024074; x=1706628874; 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=iCR0lpI4fVpLmP3DQ9mG8C0OncX2u+kTHiicR+nRZek=; b=HTJekD9Xk5ryPODS/y3YVq1dc8FzDPG6ec1KRFGKej5eutO0EBmOEFDH2rZCu7uqj0 N8ayEel38k8YjaRkBPcDlFOdRTL2TXdrqmsdVlMJ0ig2B98B+u5G+W3Jt2dHwHyMfutx bC18EU4nc7ENT0XWhmM3RreNOiMzYTHdJfsCmXlI5RO97wKI+tybCsCdkjze0dilshga oExOqjmNKEsPo9N5xFK+cs0zFYt4MV8X9yfC12EKEGSmYkKx1R4kc95uWbz1NpgE8OtQ iTEI7WRShzkLTvZF2Mm5i+MchCR0tph5zS3DP0MYfqsXWZWHIqbUbFghiEf4LGyHU6BA HUgQ== X-Gm-Message-State: AOJu0YyK4DA2KHj7qpbbeGoQmirFnKKb8/mUPO508m2FHqMnV/OXl7Bh Cwopq/Jfg2nD1t+E0s0RD8aTkhCQi+ESWoEMDKszfT07hqvC7pKmoxvmIJbVaPM= X-Google-Smtp-Source: AGHT+IG9ffmjdMTbmPgzKsGlfFXptU3Y/H2kV8L9oXd6VmUQvvbkly+26/+kAPCJ0iTtA2RQs4aNqw== X-Received: by 2002:a05:600c:3784:b0:40e:a366:e718 with SMTP id o4-20020a05600c378400b0040ea366e718mr247710wmr.42.1706024074578; Tue, 23 Jan 2024 07:34:34 -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 p21-20020a05600c359500b0040e3488f16dsm42457536wmq.12.2024.01.23.07.34.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 07:34:33 -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 10/21] spi: s3c64xx: move common code outside if else Date: Tue, 23 Jan 2024 15:34:09 +0000 Message-ID: <20240123153421.715951-11-tudor.ambarus@linaro.org> X-Mailer: git-send-email 2.43.0.429.g432eaa2c6b-goog In-Reply-To: <20240123153421.715951-1-tudor.ambarus@linaro.org> References: <20240123153421.715951-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-20240123_073435_781958_B31F362F X-CRM114-Status: GOOD ( 10.27 ) 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 --- 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 a06b83b952c6..4b13252da8b8 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -285,20 +285,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);