Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp669916pxa; Thu, 27 Aug 2020 12:29:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVYyChK0PU8Xa16o3Tj5xv4eTxegeFtRl9uZcWKWOO66Sj7gIl9ybj1JZABoIeS86TGGSd X-Received: by 2002:a17:906:fb85:: with SMTP id lr5mr22954476ejb.328.1598556546287; Thu, 27 Aug 2020 12:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598556546; cv=none; d=google.com; s=arc-20160816; b=Q6cMZSbcL+PZAOBRLioj/EIhnpYltD1jTwhH1uCr75LmprMlNOglnuHpXSQx5Mkphi jYCNVjHyuT/WWNP+lblNkJmfJUX6g+Hms6PydDYq7Rriso69eq0dZnyrrUUzIOfv9H1d pn2o/+f+66Uq48Ri7PKNwS74wXBWK3M8UHOHd387iTSULMbxYPTaeX+IbI3iMoB2O73l rzNyRi2i3SgSUUlrAGBI5HUSrM7cEuiTY7Mrh+cJQ/I/zDryD9/kcink47KzH9kPk8Sx iogtK9CJ2ewm3Z0LHfSAOnXViZlPaaNf5fNCFQ77xXubQUl+bPs/AQ7s5jFhJiQJCLJb T0AQ== 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=D2Oxoo2GJ79ZiOcDWYbIzEBk6g/SQGornr1wq55lub0=; b=uFpYfEfiI8+ZUCGaf3+uMW2MlL4k/j2dJv+GUGygvnGi5bWS7jk060fAZ8RZrRRzq4 oKMUMfEfdq3/9pJDZel/mZMSHubtmiXUO9nb6B2hq7QZbiqjxEoWeuxF/I80IPpJAPgy bT5iIcCMm/jYAG65aLaI1PtFt2dDrGomMbA44BQ94bGR5pgg5yzHFyRpqIcM5Ag7a9sK 0tRLnD7gTn5CoJy1Qshw49HjeQKjgpUEUe5BtnVHblz5X/L945vviGHw4VYQvte19yyN OWSEEFneOpamrCGcZ1jPC23s8rI55CgcpH9tflFd/nG5kFeBJZTk/t2ii3Soey9jFn86 MIjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=k2f7aVJF; 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 c3si2379057edl.567.2020.08.27.12.28.43; Thu, 27 Aug 2020 12:29:06 -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=k2f7aVJF; 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 S1726936AbgH0T1v (ORCPT + 99 others); Thu, 27 Aug 2020 15:27:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:58698 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbgH0T1u (ORCPT ); Thu, 27 Aug 2020 15:27:50 -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 0A528207CD; Thu, 27 Aug 2020 19:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598556469; bh=nO07OHVtqYTYYgYXG9kFf3Gxi+yDeW2oQQkBmlm177s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=k2f7aVJFj4bXD51NGX2cAVppPH/aVQDanfa8llcV1nYctPMf6LmiIC/KJbJmb8WHD 9eSWB3C7sSdZhBRMpSTtKkNtAWEc3q0dVkFWVgYs3YhXfGIR2mRl5rCiKcZJ+9oSmf RmEnwuBTnbt7fXl4frQrycGFpDI6oZGYa32S4y+c= 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 , Andy Shevchenko , 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 Subject: [PATCH v2 04/18] iio: adc: exynos_adc: Simplify with dev_err_probe() Date: Thu, 27 Aug 2020 21:26:28 +0200 Message-Id: <20200827192642.1725-4-krzk@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200827192642.1725-1-krzk@kernel.org> References: <20200827192642.1725-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 --- Changes since v1: 1. Wrap dev_err_probe() lines at 100 character --- drivers/iio/adc/exynos_adc.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/exynos_adc.c b/drivers/iio/adc/exynos_adc.c index 7d23b6c33284..40585a96c848 100644 --- a/drivers/iio/adc/exynos_adc.c +++ b/drivers/iio/adc/exynos_adc.c @@ -844,13 +844,8 @@ static int exynos_adc_probe(struct platform_device *pdev) } info->vdd = devm_regulator_get(&pdev->dev, "vdd"); - if (IS_ERR(info->vdd)) { - if (PTR_ERR(info->vdd) != -EPROBE_DEFER) - dev_err(&pdev->dev, - "failed getting regulator, err = %ld\n", - PTR_ERR(info->vdd)); - return PTR_ERR(info->vdd); - } + if (IS_ERR(info->vdd)) + return dev_err_probe(&pdev->dev, PTR_ERR(info->vdd), "failed getting regulator"); ret = regulator_enable(info->vdd); if (ret) -- 2.17.1