Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1326475pxk; Thu, 10 Sep 2020 12:34:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiBTmBmLcEaiYZAl1zRmETnNVvPIGMvO92itZvGJpnLn/eZ83nlDocUSUxgkFQSte9ieur X-Received: by 2002:a17:906:a981:: with SMTP id jr1mr9973311ejb.99.1599766470839; Thu, 10 Sep 2020 12:34:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599766470; cv=none; d=google.com; s=arc-20160816; b=HXmp+KcrPaKCg1hRwdrgCPxXlZLarq/sWlAfR57u9bEV9haCqYfNQvhPULVRtFxqGT pexLwhF1KEXdR9xszALaANy+jCfDejYJgL6YCcXkT9NCPv2zDSAJMcOeZZ41qwL8fZYf ymXy1sgyYQTnSWOAiRfc6d5HlYuzhDAwQG+TDi+ljIz4s5+K8m4YipYVhTU7Idv8cXlG B59ch3NRJ2vw/qwQZvs19DJ25ep0yKUFFH54r2vMpKKpTAgmUkryBKLuLBYrAaETBR82 idpbmhIoyU+ywNOUYIf8boqrKkMrWlFQL0FLkcgB/Bs0EoRovjwcicEVXgVKyIHrIgTk FLgA== 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=KqqKVmwu2ke+TMPQ9ZXp2K/LmqycHYVEworO29ar2eY=; b=cV3K83y4jLUNP1FhwFmi6LEFvev3gslE99OsB4jI8mM3bYaPptHJMux8Ee0Wp1TmkM jEn1Jb1YQ7NOVyFq0s9Lne7DW6+cOj4A/yoqmK2Dy1UOv3tx90TC4+eDfAAFsCjwIitK MLGtRYCt9O2T7CjS2mYwJE5UK8lLnLvEObpHiSG3aeQWI9AVnInJnJGYU1ZIhLCUrF0g jOnjDFhUmYrlVn9u2I93vAtxlL95YJ8+odcq0HTH7KiBLSSyGMiZwJKiSz06P5MqiyUq 3h4Tjt5MLJkzLApfivhC2/u9nWRiQweRm4JKyy5A8rMcaVW6kKMllMK0P+WyW4DksvO8 LegQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OSCBpD75; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 q5si4050876ejj.123.2020.09.10.12.34.06; Thu, 10 Sep 2020 12:34:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=OSCBpD75; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-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 S1726957AbgIJTbd (ORCPT + 99 others); Thu, 10 Sep 2020 15:31:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:48022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727792AbgIJT3d (ORCPT ); Thu, 10 Sep 2020 15:29:33 -0400 Received: from localhost.localdomain (unknown [194.230.155.174]) (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 4E329221E3; Thu, 10 Sep 2020 19:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1599766173; bh=EfUI1dyzt3SWILGjbm4xkkgdUT1vq2/kiW2omjKTGf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OSCBpD756N1pMGFV1zwLMRNM19gRS8a2dhOg90mvNF7mb+Ar1IgS2igUxh3Bo2Weq ESCmBWUVBP2inW2aO8MjkGBUVRmj/A+FiXF6LGNzv9ryvdxBQJZw5U0AbFk1DOJwNp S4UkmbMXjHDszVqNzkujQJ/hVuLqH1mvXIH0NG4Y= From: Krzysztof Kozlowski To: Corentin Labbe , Herbert Xu , "David S. Miller" , Maxime Ripard , Chen-Yu Tsai , =?UTF-8?q?Horia=20Geant=C4=83?= , Aymen Sghaier , Maxime Coquelin , Alexandre Torgue , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com Cc: Iuliana Prodan , Krzysztof Kozlowski Subject: [PATCH v2 3/4] crypto: stm32-hash - Simplify with dev_err_probe() Date: Thu, 10 Sep 2020 21:29:18 +0200 Message-Id: <20200910192919.12503-3-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200910192919.12503-1-krzk@kernel.org> References: <20200910192919.12503-1-krzk@kernel.org> Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@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 --- Changes since v1: 1. None --- drivers/crypto/stm32/stm32-hash.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index e84330f247d9..e3e25278a970 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -1464,14 +1464,9 @@ static int stm32_hash_probe(struct platform_device *pdev) } hdev->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(hdev->clk)) { - if (PTR_ERR(hdev->clk) != -EPROBE_DEFER) { - dev_err(dev, "failed to get clock for hash (%lu)\n", - PTR_ERR(hdev->clk)); - } - - return PTR_ERR(hdev->clk); - } + if (IS_ERR(hdev->clk)) + return dev_err_probe(dev, PTR_ERR(hdev->clk), + "failed to get clock for hash\n"); ret = clk_prepare_enable(hdev->clk); if (ret) { -- 2.17.1