From patchwork Sat Aug 29 06:47:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 11744123 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 4BF0113B1 for ; Sat, 29 Aug 2020 06:49:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3365820E65 for ; Sat, 29 Aug 2020 06:49:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598683765; bh=NEcenenUcbzd6lORmkCXVctqSBGbaMDN9QPAnMp0744=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qWqmIMKUNhdHJBvsFMp1vzi1YMs60GUN/+D7fS0eW/wu9Z8tnooVH0iUFcGeRTbGX KCwkfpPw9Hk1SO0t7s+kdEJO3zpeAP498r+4Nt20PiZi5l2qMDuJc2v/Ds7UM1IIsN DRkRZuQgClyA38sJ4qlPcoZAsqbMB/1Myz2MlFTg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbgH2Gs3 (ORCPT ); Sat, 29 Aug 2020 02:48:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:41068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727024AbgH2Gs0 (ORCPT ); Sat, 29 Aug 2020 02:48:26 -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 633EE21527; Sat, 29 Aug 2020 06:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598683706; bh=NEcenenUcbzd6lORmkCXVctqSBGbaMDN9QPAnMp0744=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0yCi57U8/gwDZjDeiVoaqj/ObrtIczk+aNECWfPoBCKZi9js3zT9EMe/pYr1PPjKk /xIQaDBjWsj0zueLeZYlkYViahrki0B6wQQKWI6uaBb0pP6eDLih9R/c5AiuEHXE+i Jvo54mDY37BEHAdX90RgIjW06kN/WLZ/PuNeTci4= From: Krzysztof Kozlowski To: Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Michael Hennerich , Marek Vasut , Tomasz Duszynski , linux-iio@vger.kernel.org, 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 Cc: Andy Shevchenko , Krzysztof Kozlowski Subject: [PATCH v3 07/18] iio: adc: rcar-gyroadc: Simplify with dev_err_probe() Date: Sat, 29 Aug 2020 08:47:15 +0200 Message-Id: <20200829064726.26268-7-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200829064726.26268-1-krzk@kernel.org> References: <20200829064726.26268-1-krzk@kernel.org> Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@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 Reviewed-by: Andy Shevchenko --- Changes since v2: 1. Wrap dev_err_probe() lines at 80 character Changes since v1: 1. Wrap dev_err_probe() lines at 100 character --- 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)