Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp182304pxa; Wed, 26 Aug 2020 07:57:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpu41cFDlbe/UC8NlhepqIoIr+b7CfnqgUqucOegu5DVRutpAR9f2bxUWQHULEW5+Pc7qn X-Received: by 2002:a17:906:2a1a:: with SMTP id j26mr15847428eje.456.1598453834740; Wed, 26 Aug 2020 07:57:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598453834; cv=none; d=google.com; s=arc-20160816; b=SEbpb0sfX8kWu2PX9iOeHU0F4lKxf2jd/bMkiR1up5K4jEQ17wM4r4CAXG9Q/iRHVz Y5Iz2W9z9wN9dSw6sV6F73FH+ZxyB5V2VBeK9yuUf6VO1V4/9O3UyrYcf7PnUPU8o9Jz fEcxj18/4aQmUs4BqhLRIyx2jG4nyK5EjlH2ctt62L1e+NW2rqVf7lVNff5J8rsaxLbt ppNEVK2uqWzcQfwq5sBdW3KRkIdN7hZ7ryeS5ohvu522OZ/C3guw9u3s6DMdYMnEaVff xh2jrsDJ+M8J/F4/VfV1Flqdz3oVn3qQQv3R9PLd8NICtef82lX9ZeNrcIIlBEEJgOjo 81ww== 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:to:from:dkim-signature; bh=kHFwhk8rnL/vOQhvm/jNe3uUQGZgY40se4fmn/nXvfc=; b=CnJs8+mdGxMFqtKB31T37Ho6/5oy8BEsgxo2rHf7GCoc++tUrpoMwFqJDS2Cl8sJWV LTdkKpjeGUBcYQNip/f27qPZvf95BttPSYwEcKZrZM96+VOIcST3CMeXt9VMDk+PRjAh L0aMaAl61nOZjrhzcibgRMJAf85X/mojt0IU+fY/Gc7bHgULZdPPLO3FKTrCfE+bT6fK pr3S1kWJIEFqKptU5o0EGod9xrleMYF5Mqp+UhvZv3G3ApI74GjS5fFwJJFbSjYEdCqq h9xo18Xu7/CRhgy4RmVxV/qLhIKV6meaG1n6xv87RyxAwqGI4dgmvVUYLsPgX2q5fDs8 cNJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ldIBv5k3; 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 a17si1754273ejx.396.2020.08.26.07.56.52; Wed, 26 Aug 2020 07:57:14 -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=ldIBv5k3; 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 S1728182AbgHZOxJ (ORCPT + 99 others); Wed, 26 Aug 2020 10:53:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:39292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728135AbgHZOwl (ORCPT ); Wed, 26 Aug 2020 10:52:41 -0400 Received: from localhost.localdomain (unknown [194.230.155.216]) (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 69A5B2078D; Wed, 26 Aug 2020 14:52:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453561; bh=puGjOEDLy1X0v7TsUcfxnMsdsGraY1mRsNBw6Wv3Cv4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ldIBv5k3e8+FgbZ2n0OafK9d/gfOuB8cpZ3ndZLJbp0j51kuUE4udvnkuwnRZhk6E VCbrjo05ajjrlxIrvwUmAYd963AMJ/HR3rw3z8bcjYfSevDPJHo6BMt8NCVX/SfASx OjqFXjQIkWcN0Q8QtJtMZ+iN5Uq6VI9zPsWy5veI= From: Krzysztof Kozlowski To: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , Krzysztof Kozlowski , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Jonathan Bakker , Alexandru Ardelean , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-amlogic@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: [PATCH 07/16] iio: adc: rcar-gyroadc: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:44 +0200 Message-Id: <20200826145153.10444-7-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200826145153.10444-1-krzk@kernel.org> References: <20200826145153.10444-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 also it prints the error value. Signed-off-by: Krzysztof Kozlowski --- drivers/iio/adc/rcar-gyroadc.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/rcar-gyroadc.c b/drivers/iio/adc/rcar-gyroadc.c index d2c1419e72a0..dcaefc108ff6 100644 --- a/drivers/iio/adc/rcar-gyroadc.c +++ b/drivers/iio/adc/rcar-gyroadc.c @@ -495,12 +495,9 @@ static int rcar_gyroadc_probe(struct platform_device *pdev) return PTR_ERR(priv->regs); priv->clk = devm_clk_get(dev, "fck"); - if (IS_ERR(priv->clk)) { - ret = PTR_ERR(priv->clk); - if (ret != -EPROBE_DEFER) - dev_err(dev, "Failed to get IF clock (ret=%i)\n", ret); - return ret; - } + if (IS_ERR(priv->clk)) + return dev_err_probe(dev, PTR_ERR(priv->clk), + "Failed to get IF clock\n"); ret = rcar_gyroadc_parse_subdevs(indio_dev); if (ret) -- 2.17.1