Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp1708062pxa; Fri, 28 Aug 2020 23:49:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycbZuf86mAKFUZtkAJGCaYmdrUR5olJxYaJ+Q05hWrBxMNSoKSBuEgg5kkKbi3JYPQSfK6 X-Received: by 2002:aa7:d981:: with SMTP id u1mr2230537eds.311.1598683790875; Fri, 28 Aug 2020 23:49:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598683790; cv=none; d=google.com; s=arc-20160816; b=f+8A7HuZSszLizuGUqeztUHRBcs4kTr01+5rQbT/UFcYWMP+2T60ZlC7brX5sH8kOP NZDOSJMrbZmg/L0Z/ge5O5iqz3zpNXkzIZhg2555CNycEBlTV9lz6PkxWoXwP96r3Q5o EB7xfB4ptEJV5xCi90BMAmMl6nmb+9w83WmbIm657vaLj/1fglCqHmjGNdilvTYprYPJ HpvceaMNsrq03DRiRjAU+eytQhWa0BDb5XlY18YISLrQoeu4WcjvmIav4ZbH3H8qAHuI bVzqPHEyKfA5fHo1/BwURse764pKwXnVGwhzt82p2fA3ioPrGnHsPGf/Lna5pqqah0u1 nBXQ== 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=0Gd9uYzii8KTRVB55iQSC0ESn4MvG/kWHvD6nHYcg6U=; b=jb2m5HG1Tj6o3pjsFffChB4A/KifwT2VrokNP11D/qiZqD0wJ7R2HpobjQKTV2WuTv L5/93C4rVmQTH8ldCnsQhHyI9QtJlNSEPR5VmWSr0Pep7FdGVhfeFmd7kgq7ZhBwR1Xl mmeJVE/YiSOmyh4o1iCsCXW2DUZbcSasGVU+neC9c5804i6Zul6LUZ0BPIYY9f7M3rws aJUZ8XRyc/GUxghQQW6JXizCb2JNaWDClXJms/lBQ8sMwYW4VHdzX1omlshhNX1p/xC3 z8ZeNPzJFiFffi0k0pLFx0XJUo6anSH0zmfMUbsVTwxF9NGyZZNnZizqN0cY/jB+J5qE FuBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FlJiwlmJ; 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 k23si1244724ejg.514.2020.08.28.23.49.28; Fri, 28 Aug 2020 23:49:50 -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=FlJiwlmJ; 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 S1727105AbgH2Gsk (ORCPT + 99 others); Sat, 29 Aug 2020 02:48:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:41366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727024AbgH2Gsd (ORCPT ); Sat, 29 Aug 2020 02:48:33 -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 635092137B; Sat, 29 Aug 2020 06:48:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598683713; bh=q8HI6Zm7rrRPqVe1eb6PzsXiCtitXv9sgq9WQhNoADo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FlJiwlmJ/eHlpJIJJ9BSxU4PqYPRgC3cKYkPTHh9d/+Dr0YvNtCy1juaWK4MMAtnF 8fUFw+f+34uf7wphW0zsJk1jSYOwaaSQOwQgqSCr4L4Pl6ZFxu2FZMmL/l/7mUB1fn 1gKGAHQhVbDCxwsjBFe2HDqSHZ8MAl+DJ1UJU2tc= 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 09/18] iio: afe: iio-rescale: Simplify with dev_err_probe() Date: Sat, 29 Aug 2020 08:47:17 +0200 Message-Id: <20200829064726.26268-9-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/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