Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp184604pxa; Wed, 26 Aug 2020 08:00:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwi6UH9DldZbp2bZBb3YiTss967DSDnx6u1mf79M1oFt9SkcOFNniYHACF7cq4FfsOqF1BG X-Received: by 2002:a17:906:1756:: with SMTP id d22mr15948440eje.29.1598454047448; Wed, 26 Aug 2020 08:00:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598454047; cv=none; d=google.com; s=arc-20160816; b=nkPcfvx4/HfivyAPAT62sq/wM/RvY3TIU84VGOIOAL+CF5aZDFpKRck0Xeoi9rdE7l nIAza3fL8GNkHnxSL21mWTi/1blhflI5laMEpStxXL50FI2F1s9S/g3ip7qZkrmorzMl 8n/L7CfwUpFr4SY4LxXp4LkdvxSrgKZiuGd5VN9NxaCu1zfSWdGlbSkC87G+HrypdGxC l1bESLOCaNSV0sZdGXe9Ks5IvlEsVl8+XdU/waeJX27Zv9dIqNmg4oo/DLgGZku3RLAw 82WFhOQnvZYh4ltS0mc6u3rnS9H7xO7lKV3TKpXs6DvZ1fYCh+bVAVfQdHqgrw70xcP9 029A== 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=tajcPl0PS/GyV9CgA79rpeBSwYb/a2pjRmYr5sT8ESY=; b=ZSlVoRTVVtHHsLOBZLIypew5BmNIgdCqrKRRhOtOYr4e0X7XJeGefrY/Wpq/cfab9H pxLecWQIXJCxOxF8kHRkA9sWgpsUz1gausOBsOI4CEvfZ45MC5pa7HAPE2OgJ9gFNjHV jSPXKdXnOdxRARi8co/Mzz3mvHoUAiZaNSGtH1fod0hxK+20Cd2cO9hY2O07dU1evm/r DNQBc8gPaggumeWS33XEntgPtL57EhLuvPT2ZmTghVmWk7LZamdCxURmln6N1WrD/uxq +XdL8fEzuDDrAcYVM6UTBwOTSBZ4/Odtyf1033hQvCqw5FwMn9VZsL8kPPGHS1y/NbJP 4+Cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rB7PYhCc; 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 u20si1525993edq.327.2020.08.26.08.00.25; Wed, 26 Aug 2020 08:00:47 -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=rB7PYhCc; 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 S1728149AbgHZOwo (ORCPT + 99 others); Wed, 26 Aug 2020 10:52:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:38952 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727103AbgHZOwa (ORCPT ); Wed, 26 Aug 2020 10:52:30 -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 1ABD422B47; Wed, 26 Aug 2020 14:52:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453550; bh=mbBY3f6IkcYP5UmsdfBs0Q121Pfo6ZsXqMxj84C8/3I=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rB7PYhCcZUbVXTNWIxUq3/hcQjjDTXkjrfU3ygh4GZvyLFhEW1z8v4VlGLqOqeQ6u 66XzLFpv+MgP3RqBh/tnxe6osJhbstejzE0wboV5gK1fGX9LzGAXwIFpjlciotio6E xH+Yfg9ZhHN9H/nprX/O+zTjHcjpap6WjiYFSHvI= 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 05/16] iio: adc: ltc2497: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:42 +0200 Message-Id: <20200826145153.10444-5-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/adc/ltc2497-core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/iio/adc/ltc2497-core.c b/drivers/iio/adc/ltc2497-core.c index 9b8fd9c32364..2a485c8a1940 100644 --- a/drivers/iio/adc/ltc2497-core.c +++ b/drivers/iio/adc/ltc2497-core.c @@ -180,13 +180,9 @@ int ltc2497core_probe(struct device *dev, struct iio_dev *indio_dev) return ret; ddata->ref = devm_regulator_get(dev, "vref"); - if (IS_ERR(ddata->ref)) { - if (PTR_ERR(ddata->ref) != -EPROBE_DEFER) - dev_err(dev, "Failed to get vref regulator: %pe\n", - ddata->ref); - - return PTR_ERR(ddata->ref); - } + if (IS_ERR(ddata->ref)) + return dev_err_probe(dev, PTR_ERR(ddata->ref), + "Failed to get vref regulator\n"); ret = regulator_enable(ddata->ref); if (ret < 0) { -- 2.17.1