Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp183315pxa; Wed, 26 Aug 2020 07:58:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkWiycyXl/WEiI2HfjxKXF/kfaSU8iQdxbazn/xfwwl1bPkGY4iZyJraclk+H9ALD5csJ1 X-Received: by 2002:a17:906:6b87:: with SMTP id l7mr15370235ejr.198.1598453934074; Wed, 26 Aug 2020 07:58:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598453934; cv=none; d=google.com; s=arc-20160816; b=ck/Bd+gZStJ3jTOnx9tsIYRCIcBjxFmzE8ep3DmuCtkmtFRnkp5PnSjZ1gxqdJFvTs dmI0Jm0hmiJ3xChciZqkltmSNdjY3T7e7aQtirvrIdwpheAc65iSPcfgrp1scB5AXwKa MVcTpCdgncAHXwAFGVRyV4GToKhBUvVZwfVwlLRvXLqhvUlIEKPp3YucYLXnBW4s3P8D FY33CTctMSAJgbF2xdR/g7Jpx1E2XhGjZq2FXdQJPLw/QF9mISNCOtVuwlToOq3U457L tUTgbItso6ky+WJ+ClMs7Dp63SdpSTX0LtmwZ6G7cb0Lp6FVYwRuea1yBNkpuI9ucmoX bDSw== 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=6k78JgRAJuSLsrFK99tulINV1I1EiN7MqWq+R62YeDA=; b=V66CYWs1tMWeuPSlVT+j10IcdrsAnwGrHySmQtCA56GnefA8XjN3Q95//t9R4aAIOD plitG/I19tU86fjuJ7mtfpvuH61sJpKk8ZvXK8yFwUAF4kbr01sHWYY0TQo9dinR8th5 zDp+ppx8KkHMP18SDrdkHlTCdE/7qeYjBB67xCBxfd/Nrf2vWz9m42sToeO3OU7Y3uw4 jR14f0d3GSLuwhV1U3Irxzg9tVbhOQFPJh5bxGV2/jduw+mEtrCPzQu0Yfa3O9/Oz7LF hrPhWl8YCR3qCEapDea3UGieOhf5y4YdLZWMu9sLFBZI6EJ6r8EiXNyoecsS1L5Il+1H uUew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=H83nW6V5; 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 i6si1561170edq.131.2020.08.26.07.58.30; Wed, 26 Aug 2020 07:58:54 -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=H83nW6V5; 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 S1728234AbgHZOxZ (ORCPT + 99 others); Wed, 26 Aug 2020 10:53:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:39566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726870AbgHZOwx (ORCPT ); Wed, 26 Aug 2020 10:52:53 -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 3FABE2177B; Wed, 26 Aug 2020 14:52:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453572; bh=kkISLubLn02Pqd4uTanIQMpVWj7X3BN+1/yofvSuWc8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=H83nW6V5S3urOUpULphtz3zccovbw9g0fFCefrjuYoLXand4Ge+9p3+Qyf/Srtffc YmReJ+BHI1bG1UUo4u3E1DyrY/ZG2fhUgi/JEZbJBWLnHhmG2Rw6sbUKkSHiVsfKm3 XeueJ6nAcItK/oN4JmekPru4Me0xq7pfmGDQHOR8= 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 09/16] iio: afe: iio-rescale: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:46 +0200 Message-Id: <20200826145153.10444-9-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/afe/iio-rescale.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c index 69c0f277ada0..e42ea2b1707d 100644 --- a/drivers/iio/afe/iio-rescale.c +++ b/drivers/iio/afe/iio-rescale.c @@ -276,11 +276,9 @@ static int rescale_probe(struct platform_device *pdev) int ret; source = devm_iio_channel_get(dev, NULL); - if (IS_ERR(source)) { - if (PTR_ERR(source) != -EPROBE_DEFER) - dev_err(dev, "failed to get source channel\n"); - return PTR_ERR(source); - } + if (IS_ERR(source)) + return dev_err_probe(dev, PTR_ERR(source), + "failed to get source channel\n"); sizeof_ext_info = iio_get_channel_ext_info_count(source); if (sizeof_ext_info) { -- 2.17.1