Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp182589pxa; Wed, 26 Aug 2020 07:57:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6hMAtbak/7mBHX1y6gIuYkMAVRoqU6j7YKuvlCHeRzVhvL2u/ts7A95RM/nGvCUwuXnnK X-Received: by 2002:a05:6402:297:: with SMTP id l23mr15436877edv.145.1598453860840; Wed, 26 Aug 2020 07:57:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598453860; cv=none; d=google.com; s=arc-20160816; b=TtuxrHLAQ2rZJQbyGQe4UDofcqlfb/iotXM0M7dGhZrIfaxcLGT4K2we4KHxkIleMm Q+rHKIn+aUXS/p8wFWsByLyu2ABs3dGfwm7xA6pb/GCxpa53yN+vOyl+Ybp5C4ikAdk5 x84Yt/NAO2rumcdeKwgfcXvyJMo8eDtGSv8nfvYhvlzE2rcpQ1WB22Ff/THitGCE+sVS EAWKnQtwIESq9+JSO2Sje+U5VMvlAVWMwtqiJA5krxmQBJ3XEuKCMEWR9vb7KjkNucnT pHsFX0nN+/YUfLLEySOeIwdvVXS9E4DomazKwtN1mvHufAuHwv2q/qO4/WwKAEpgHmH1 DHeA== 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=jCSaLTd+mmKwDiFcTCoUhbB0Gz9IWZNmxk16QuhfYGo=; b=CiRtHxONWGZkkxacC+qeyMuZd513iGXeilLlFrOSkQ43uEYpqsVyB0kjducHhuvG56 fJ0ZIkDY8RmkJXKb63qzKi/JFBuCldEkzNEYJJTTyxMNUwPqfcqvZhXDBaxyjcpJ20u9 Rm83qkdX7N4n4+Qex6IsitT2q25IJJUspogdNgqJRUrlEM8cgSgGI531U4wV8YW/jt/U XVbz0RI5QK5G12t+PtURxIQk0MaCkQ8a04OZKjVGCbtO+rhZuACr8FIVC1brCAsrFs9j F8nuueWrQ0VHNcncsFXRLJnU0z6nVC2HtKaXDqKQ+u3KKyRWXnLZq3LCpPxxvZDx+/I+ jJkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QpJqNogr; 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 gh10si598144ejb.75.2020.08.26.07.57.18; Wed, 26 Aug 2020 07:57:40 -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=QpJqNogr; 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 S1727790AbgHZOxl (ORCPT + 99 others); Wed, 26 Aug 2020 10:53:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:40830 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728252AbgHZOxa (ORCPT ); Wed, 26 Aug 2020 10:53: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 045DA2078D; Wed, 26 Aug 2020 14:53:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598453609; bh=J8VgXHUUZP2pCXXB1Ijbi0zWjJmibqmGMPN7gfP7amg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=QpJqNogrcmlIGvb4oSew7Gtwl5VPXjukXCXYclJ6UOVEGs06JEbRVTgRxwLro9q62 ADpxRrdQhRq5jU8PZrmfqvjl/YGPxs25o142b1BzCgT5UUTbRXSHIdJJ8PL0kEme+y Fkm7I6YSAVvX2QO4Fik8Br5k9Gus3sl77yPC/kyo= 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 15/16] iio: light: tsl2772: Simplify with dev_err_probe() Date: Wed, 26 Aug 2020 16:51:52 +0200 Message-Id: <20200826145153.10444-15-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/light/tsl2772.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iio/light/tsl2772.c b/drivers/iio/light/tsl2772.c index 735399405417..00073346ad1e 100644 --- a/drivers/iio/light/tsl2772.c +++ b/drivers/iio/light/tsl2772.c @@ -1776,14 +1776,9 @@ static int tsl2772_probe(struct i2c_client *clientp, ret = devm_regulator_bulk_get(&clientp->dev, ARRAY_SIZE(chip->supplies), chip->supplies); - if (ret < 0) { - if (ret != -EPROBE_DEFER) - dev_err(&clientp->dev, - "Failed to get regulators: %d\n", - ret); - - return ret; - } + if (ret < 0) + return dev_err_probe(&clientp->dev, ret, + "Failed to get regulators\n"); ret = regulator_bulk_enable(ARRAY_SIZE(chip->supplies), chip->supplies); if (ret < 0) { -- 2.17.1