From patchwork Tue Sep 1 15:27:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11749155 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88485109A for ; Tue, 1 Sep 2020 16:43:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6EF75207D3 for ; Tue, 1 Sep 2020 16:43:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598978583; bh=o8qlZ2EryFTu3cjlwAR8kRQlz7lJkpkfP6U3eaeoReE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=tugK1uiCN9Jbs1fE9asmuhonH8c4bSlHXfdz7B7M4A+f3yGVcH40r3ONxNKPjkBVm B1+1BV2n7uTRzcNQd4IPx65ruUJdjS6T5ZEU5YDGLUrT34MBlz+IAgVY7ecUk1ZtRO btwr8yegMIs2wBQmYbcD9QHSpT4KWKSJgrE81A3M= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732229AbgIAQnB (ORCPT ); Tue, 1 Sep 2020 12:43:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:55394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728331AbgIAP1u (ORCPT ); Tue, 1 Sep 2020 11:27:50 -0400 Received: from kozik-lap.mshome.net (unknown [194.230.155.106]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81CC82078B; Tue, 1 Sep 2020 15:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974069; bh=o8qlZ2EryFTu3cjlwAR8kRQlz7lJkpkfP6U3eaeoReE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LnBeGSSXnEMQ4CLcP1ia4NPBE1xz6UJfBgv5qLJlLwDIXOlWFOMKFvKfOYau0Wrp5 t+qX6bomEziRTl4D9pW4LjSoJtxAWrDw/V2kooxiPBLWtDGz3XwxN970p60F1uiDgH YVip6d1dTCUU1c4xzjgbWDLgdUfBeinrVW2AUDGs= From: Krzysztof Kozlowski To: Tudor Ambarus , Mark Brown , Nicolas Ferre , Alexandre Belloni , Ludovic Desroches , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Andy Gross , Bjorn Andersson , Orson Zhai , Baolin Wang , Chunyan Zhang , Maxime Coquelin , Alexandre Torgue , Masahisa Kojima , Jassi Brar , Laxman Dewangan , Thierry Reding , Jonathan Hunter , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-tegra@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 04/11] spi: bcm2835: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:27:06 +0200 Message-Id: <20200901152713.18629-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200901152713.18629-1-krzk@kernel.org> References: <20200901152713.18629-1-krzk@kernel.org> Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org Common pattern of handling deferred probe can be simplified with dev_err_probe(). Less code and the error value gets printed. Signed-off-by: Krzysztof Kozlowski --- drivers/spi/spi-bcm2835.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/spi/spi-bcm2835.c b/drivers/spi/spi-bcm2835.c index c45d76c848c8..5519f1eda238 100644 --- a/drivers/spi/spi-bcm2835.c +++ b/drivers/spi/spi-bcm2835.c @@ -1319,11 +1319,8 @@ static int bcm2835_spi_probe(struct platform_device *pdev) bs->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(bs->clk)) { - err = PTR_ERR(bs->clk); - if (err == -EPROBE_DEFER) - dev_dbg(&pdev->dev, "could not get clk: %d\n", err); - else - dev_err(&pdev->dev, "could not get clk: %d\n", err); + err = dev_err_probe(&pdev->dev, PTR_ERR(bs->clk), + "could not get clk\n"); goto out_controller_put; }