From patchwork Tue Sep 1 15:27:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11749149 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 30D52109A for ; Tue, 1 Sep 2020 16:41:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1173F214D8 for ; Tue, 1 Sep 2020 16:41:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598978487; bh=uyuKVf8uyPR9u2scaonksVNg5fPRWdlOMNM/ynHZBEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=CrL53U/DKAWuWuQGg/xpkNnLqTmYe7NiyrvGEs9debW/nBJdrIikn7BHmX2R3BIly TmUkWc5e+Kb5xLGB/yJQicYdnf4mTgEJyFBweEijW12Gtm77D8sfE7u2HI0LVrMgNa z4iLsIVrxRLwELwKl3vluvlhskh8ed3K+iS4yp9w= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730732AbgIAQlN (ORCPT ); Tue, 1 Sep 2020 12:41:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:56156 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729988AbgIAP2H (ORCPT ); Tue, 1 Sep 2020 11:28:07 -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 D92BD21548; Tue, 1 Sep 2020 15:27:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974087; bh=uyuKVf8uyPR9u2scaonksVNg5fPRWdlOMNM/ynHZBEs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KloMfyfrljgAztJGg/yBc71QjVACSRqACydoic4P2ZfIayFSerWPG5xIr1nIyOlBi WR+c2wRDbfV1J/QPQyjAJ2b3JgWlC0csmySua9N2Ht7I233uPH6/bofFxEnClI1hUr iQ1EGVHXUaomWCizEU1DpvFdtIeMZi7i1cR7mv2w= 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 06/11] spi: spi-mux: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:27:08 +0200 Message-Id: <20200901152713.18629-6-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-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@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-mux.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-mux.c b/drivers/spi/spi-mux.c index cc9ef371db14..37dfc6e82804 100644 --- a/drivers/spi/spi-mux.c +++ b/drivers/spi/spi-mux.c @@ -139,9 +139,8 @@ static int spi_mux_probe(struct spi_device *spi) priv->mux = devm_mux_control_get(&spi->dev, NULL); if (IS_ERR(priv->mux)) { - ret = PTR_ERR(priv->mux); - if (ret != -EPROBE_DEFER) - dev_err(&spi->dev, "failed to get control-mux\n"); + ret = dev_err_probe(&spi->dev, PTR_ERR(priv->mux), + "failed to get control-mux\n"); goto err_put_ctlr; }