Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1708039pxa; Fri, 28 Aug 2020 23:49:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxJ+njD0mXUi8nJs0sGObHNDrX+Cfk/a/r9K+7ICAeeW76yA3daMjkz4pbyZlnxe2zPJu67 X-Received: by 2002:a50:a418:: with SMTP id u24mr2290536edb.103.1598683784237; Fri, 28 Aug 2020 23:49:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598683784; cv=none; d=google.com; s=arc-20160816; b=Fc+4vvKQS57fZyhKZ7FENt3ZzgmQupiM4hOHXp4/i6d37brabDCSZUTEnjfgjtHdtm HlhjACvaHOMizPVAFekQutGovh+dt2Prq+XAJyLrcDH1lIkdJYjQQeEa4Qy6d41GJ0m4 +bkSh35X1tl5FSDkQbojjAGP/QRzRypqWhNP800oRxWTHdnD8EkprL4AuG/2Ye7lg6wy 5RF5BFVOq+4eWzadVaekdLLSnYJ0KnPPr/5n6IKrZbe+J0pdT5VzZVHwthQw+bs/Y+30 DPX7hyCTsscj09W/9sdaW/zdwCIuUq47AZznLMwLofrKf+nBcfa+qBSumFS6bbYiqAYJ K3kQ== 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=Q/YivTL8Ek9vumpgltKvLRu+UJzJqcOhfvWYaD+nLDc=; b=Y501qUGmneQXtF44htPwlMzhBetxuQAEInIKysBMbhKOzbpSCShYOBkIGlistMSnQf y8O4A84cfCtAjKSsBCwSXq/XPz+8uTxK5Euhr4ItNknRU6bhIXZh9sdfV2MXcGuaFMND ULGz+bwwM2H3u6uq0JC/EQWUlR3aY9hoFSapeer+0KFPYjouux2psKSdSCFG8NMQQ+GH IrBrWUTRploU4VY4Yr7Od9CmHT35TZAzR3izx6pRTKAPaMd14k3TcSttiYGoP+urCQvw m62Y1buOxVUZDesTwQrxx7U7oCuXMJ9BHWry1k6P8aDvPpGCOkMgv4jSc3j2FksRvA4I OAQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0yCi57U8; 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 s25si1029213edq.569.2020.08.28.23.49.21; Fri, 28 Aug 2020 23:49:44 -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=0yCi57U8; 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 S1727046AbgH2Gs3 (ORCPT + 99 others); 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-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 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) -- 2.17.1