From patchwork Sun Sep 29 09:21:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13815015 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 C1885CF6495 for ; Sun, 29 Sep 2024 09:47:19 +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=dd8hkosYQNeP8hiqwftbfxiFQ7kZSiJ72ZgocKTeG8s=; b=khelwZJ64y4fuJ BojBeoTQBZAKaepuC5WTxUMmVeD2BTcK0CSwoNuutnVqvGdWLg966i4sleUih5c1gtrC/4qXljAOq lp7u+Z5tz8K6MvMvGiebBG51X1oHcQSlvzFGE1hnQ+hvVP87zuK93cvYjQdLfle3tek7VjvoX/CuT SdvdLInVrsQOQcFIw8HitXgkRuesKBPhHBjnTGT6phUrxxHoZjljSzelA7OL+RIroeHo3HOk8Gyov X1q3g7a/oaktb5t43HqH2W6epjpilXRa0e3J0z9qBL6IpN3tkpmXJ6QJOHFA2ULmzFZEafiNsaVPZ w92UNwnuOR/JT+sbfeXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1suqWJ-0000000EYOL-2u2F; Sun, 29 Sep 2024 09:47:15 +0000 Received: from mail.manjaro.org ([2a01:4f8:c0c:51f3::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1suq8I-0000000EUp6-27WT; Sun, 29 Sep 2024 09:22:29 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1727601743; 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=kpp3peXn8LwBEdMA5eGMOZGlK98YLfThf9954gFiyVA=; b=sankRXs+6DVuPJrctyIP578YA8BSfh3sJjO/IiFILxyo2o2CvrQfig6OGOdYYvh3vn59kv O2JZdVyMIFw1jodU2i6HC8PnSAuq1xoERtfu+ZDnyJ6mob1CVuWQiCzov9oZF7bTXbTT6U izc/43if6sJwh00P6w/KIZjZCSjDMwu+8kcYnDjnTeGwY1sPLnvk7I0+9RhhqQIMU9AssH +7X0G8VNouC9b9ebFHXN2pEtkEb/KQpSm61a6zo53Fyz17Fnd/F7zIWpv3uLfJjd0RiwUM t4OxcOtdXmg2OVRBY3w4ZiB1Ac3A6jAg4Qp8x0UTKumFD9MAEgLqJa0IRb9rPg== To: linux-spi@vger.kernel.org, linux-rockchip@lists.infradead.org Cc: broonie@kernel.org, heiko@sntech.de, gregkh@linuxfoundation.org, rafael@kernel.org, oss@helene.moe, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/5] spi: rockchip-sfc: Use dev_err_probe() in the probe path Date: Sun, 29 Sep 2024 11:21:15 +0200 Message-Id: <398229ef316e64dc0c27944ea793dcddef1ead4e.1727601608.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-20240929_022226_848128_827AB632 X-CRM114-Status: UNSURE ( 9.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=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. Reviewed-by: Heiko Stuebner 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");