From patchwork Thu Sep 26 08:38:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13813086 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 471D7CCFA13 for ; Thu, 26 Sep 2024 09:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2zU9euMRPUNtRudXGXDojMT1hcsLIwDGY8GKYM1HzlQ=; b=ptAIJk5gQvB31ZrxukyMSQQUPp dHZLcYqfVylI61pEdrkRjA/HdMLjMPqcbZbufHWE3DJky/gNUlV/iOAsEa4tKu+yzPn4nDfSZC32c +IPVgFOfrI3wrzipOaqyxitRg4Qk8MDO1DLeiOTsJ2uVCmvH0ZmeXkWtwI9DGsDCz3h0IdGThmLia VnW8sBdO0ARFnA2NwbnXYqoDGZKQsjoGqJ+jNYbuyBK9FxrO+sArfyWDPN/RmSemADHBwGQYlpXZj HTjMdNwSGAE1VxbVTb0wNS6ypC3doLJd8WaRmH3l9lO5P2B12iT2jMW6BDfBinknaf2aatnXgvN01 pfujrlHg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1stklr-00000007sPr-0Rl1; Thu, 26 Sep 2024 09:26:47 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1stk17-00000007iH1-1GYq; Thu, 26 Sep 2024 08:38:31 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1727339907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2zU9euMRPUNtRudXGXDojMT1hcsLIwDGY8GKYM1HzlQ=; b=V6fVcQq1T1VhWGqyYNepekEB48Eox0YqFTBqP0KZwgUcejt7l7F7b7Ex0dLG4eLXWXKlxR 8n2vz5HiWTll95QqFpuJ8hMdnP2iq1/j0ev/oTNz8TWkCBkx/EgclMTxbm/hv3SViQe5m2 hsf01WweWvYrRZYyR7yaEyPjfmt2G0kSzkvNOjQVmXourk8iqwsasWFIoFRPwlhkg9vY0r CsJHf7QUKHh+n+vm3J5D/hqvMVFHYehCnaBedpOyRMqmotsKS87Js+muTdC/A95Z+cZEJx mLJmEkb9s9U6BRczZtwuscinpM8ptsLJNXOSd+NFsumsxYYt8AyNcCSEqU9yVw== To: linux-spi@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: broonie@kernel.org, heiko@sntech.de, oss@helene.moe, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] spi: rockchip-sfc: Use dev_err_probe() in the probe path Date: Thu, 26 Sep 2024 10:38:16 +0200 Message-Id: <8f65c1ec7737af7f2a538fcae3618756a53ba3fa.1727337732.git.dsimic@manjaro.org> In-Reply-To: References: MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240926_013829_516896_5145027B X-CRM114-Status: UNSURE ( 9.06 ) X-CRM114-Notice: Please train this message. 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 Use function dev_err_probe() in the probe path instead of dev_err() where appropriate, to make the code a bit more uniform and compact. Signed-off-by: Dragan Simic --- drivers/spi/spi-rockchip-sfc.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/spi/spi-rockchip-sfc.c b/drivers/spi/spi-rockchip-sfc.c index 505d5089bf03..7e0fb4944a34 100644 --- a/drivers/spi/spi-rockchip-sfc.c +++ b/drivers/spi/spi-rockchip-sfc.c @@ -580,16 +580,14 @@ static int rockchip_sfc_probe(struct platform_device *pdev) return PTR_ERR(sfc->regbase); sfc->clk = devm_clk_get(&pdev->dev, "clk_sfc"); - if (IS_ERR(sfc->clk)) { - dev_err(&pdev->dev, "Failed to get sfc interface clk\n"); - return PTR_ERR(sfc->clk); - } + if (IS_ERR(sfc->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(sfc->clk), + "Failed to get sfc interface clk\n"); sfc->hclk = devm_clk_get(&pdev->dev, "hclk_sfc"); - if (IS_ERR(sfc->hclk)) { - dev_err(&pdev->dev, "Failed to get sfc ahb clk\n"); - return PTR_ERR(sfc->hclk); - } + if (IS_ERR(sfc->hclk)) + return dev_err_probe(&pdev->dev, PTR_ERR(sfc->hclk), + "Failed to get sfc ahb clk\n"); sfc->use_dma = !of_property_read_bool(sfc->dev->of_node, "rockchip,sfc-no-dma");