Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1866803pxk; Tue, 1 Sep 2020 09:34:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD/Cw6Ne+osu+/Ef2kN6nBo+os24D75zlOt5W74jv+w2NtUrHxQcKu6pnRlyxLY//eLlQH X-Received: by 2002:a17:906:a182:: with SMTP id s2mr2199024ejy.526.1598978085924; Tue, 01 Sep 2020 09:34:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598978085; cv=none; d=google.com; s=arc-20160816; b=xXP+FG5kN2wlayuNLRXM0izWE17vO8s8ogTcpgtsBVveQgitG2hhs2899IAjlJPOCe 23fFlS61gzfdb6m379PhIpR10IymT0EZowSCWx2wQWj4Y3XJik7MEpwCmSc8cY30VixF VV1VSMa2CFxk9aI3++YXXdQ9YsHvHDNjdeg6rBxowbvSn9oOfUoSWOg6t544uM1MfpiW RDenWwKDSdvmVXeckaOjUBXZnNJ8iZCr1UDTU8mxkzMSiziaIYXe4MxCFBundRJRzFdz yafIGmCXFjlxzUIvGHoM9YGa+uiOV9GWSu7AUWxFf3PkLTUao0D7vc6rbCQsBsRJOUs+ 8sWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=5iBv5VyIVzHhbKi14wXnsP+cF+dk/4brDJodPIdR3AY=; b=KvISigFVogWx1pkbhHpd3Fj1grAthAcG/iyBPc3O9Yv/MOVVfZZy8eF2chH6tEonti xWRueFn3XVOm1ZtkfkIPwWNSNh4rNJysAvkNoILuQZW/duyxBy2Og3CCemfjT67bRDwS cIAGUMbYi5OMWxYYNhkzLGtcwmgZhqGG1C9xwnLTeECpOJQdNGsBdWS8fhJLk0AFTAs2 xyPzBK+pHktv2IKwtzEJZVmzpefOdeAq0igLilyUWsvQda9VyISa3C0vXeMX3nJvROW2 uyDNkYiW9hPrZhANMZBUmOsjZbHJapY8W/yT6BWkw6TFlSjeyDXmrIxKgYJZZADsxS++ JxDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fSGtfZeZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb15si874342ejb.366.2020.09.01.09.34.21; Tue, 01 Sep 2020 09:34:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fSGtfZeZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730709AbgIAPbe (ORCPT + 99 others); Tue, 1 Sep 2020 11:31:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:56600 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730376AbgIAP2V (ORCPT ); Tue, 1 Sep 2020 11:28:21 -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 8B17B20684; Tue, 1 Sep 2020 15:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974100; bh=ZWHMnQM/CURbA1JIRAEZIvphDU5D8wae4PWN5Vo15i0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSGtfZeZCm3TiMylfkCI5P8pCwDKJys94RBEilJ2Sih8/T9FzFNb6CP+fOzBgYWO7 5P6A9z0uDBLqmNUh0iBzomdRI7o7WhsTuXSz9O2Ld9mB9RTBh3yZU3wq9cQ03ouo9i M2bAn5PBFZm4gbj8jQc+xWxqa/6K9c/qXY6AuULU= 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 08/11] spi: stm32: Simplify with dev_err_probe() Date: Tue, 1 Sep 2020 17:27:10 +0200 Message-Id: <20200901152713.18629-8-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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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-stm32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/spi/spi-stm32.c b/drivers/spi/spi-stm32.c index d4b33b358a31..f0e594b2fee4 100644 --- a/drivers/spi/spi-stm32.c +++ b/drivers/spi/spi-stm32.c @@ -1857,9 +1857,7 @@ static int stm32_spi_probe(struct platform_device *pdev) spi->irq = platform_get_irq(pdev, 0); if (spi->irq <= 0) { - ret = spi->irq; - if (ret != -EPROBE_DEFER) - dev_err(&pdev->dev, "failed to get irq: %d\n", ret); + ret = dev_err_probe(&pdev->dev, spi->irq, "failed to get irq\n"); goto err_master_put; } ret = devm_request_threaded_irq(&pdev->dev, spi->irq, -- 2.17.1