From patchwork Sat Jan 8 12:07:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 12707489 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 642CFC43217 for ; Sat, 8 Jan 2022 12:08:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231818AbiAHMH6 (ORCPT ); Sat, 8 Jan 2022 07:07:58 -0500 Received: from smtp03.smtpout.orange.fr ([80.12.242.125]:59663 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231778AbiAHMH6 (ORCPT ); Sat, 8 Jan 2022 07:07:58 -0500 Received: from pop-os.home ([90.11.185.88]) by smtp.orange.fr with ESMTPA id 6AVnn9cLGUGql6AVnn8Qbq; Sat, 08 Jan 2022 13:07:56 +0100 X-ME-Helo: pop-os.home X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Sat, 08 Jan 2022 13:07:56 +0100 X-ME-IP: 90.11.185.88 From: Christophe JAILLET To: agross@kernel.org, bjorn.andersson@linaro.org, broonie@kernel.org Cc: linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH] spi: qcom: geni: Simplify DMA setting Date: Sat, 8 Jan 2022 13:07:54 +0100 Message-Id: <1b14e4ce91a33c16b2c655389c728071a9c9aa2e.1641643601.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org As stated in [1], dma_set_mask() with a 64-bit mask will never fail if dev->dma_mask is non-NULL. So, if it fails, the 32 bits case will also fail for the same reason. Simplify code and remove some dead code accordingly. [1]: https://lkml.org/lkml/2021/6/7/398 Signed-off-by: Christophe JAILLET --- drivers/spi/spi-geni-qcom.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index f7d905d2a90f..4e83cc5b445d 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -898,11 +898,8 @@ static int spi_geni_probe(struct platform_device *pdev) return irq; ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(64)); - if (ret) { - ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); - if (ret) - return dev_err_probe(dev, ret, "could not set DMA mask\n"); - } + if (ret) + return dev_err_probe(dev, ret, "could not set DMA mask\n"); base = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(base))