Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp219764pxa; Wed, 26 Aug 2020 08:49:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFtiAXDGGU6lcBBeqv7Ph2d1ZtpIMuIZyb6JunCNffvqKazLiSfRHrZ7cOXT/iyiYtAbN2 X-Received: by 2002:a17:906:957:: with SMTP id j23mr16428883ejd.344.1598456974761; Wed, 26 Aug 2020 08:49:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598456974; cv=none; d=google.com; s=arc-20160816; b=uZOdF+jsd23pvJyngDgL8lsosRUTExKbALgbmLeiuSPXzGTdsd/JHtrmLQkK1vPqfu /uYoVO6qazkQCo+bUPGHAKcRSKh9orYfVcsyEcKQ1eBaiBHuO3LWNHGaXYfdcbqCV6Wb I+co+28bEdBT2TRJETKAH8Uvub0jJbiXXOL1s6H/3D2GhbiHrzEVN6f3VFQBB2UTui7m EGn70hlkvoX4AuoFGMWWR6EMkBeawsSszXIns+cDOv0XLNwuDtSOT2BUxVfuJr/x03a1 z/TeIF01s0Wk+UhihPskq4mkrjt5NwpFjaMl/Z9WuC4vy27cpTTSi/U1DsRA4MXKLPFv 5IMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=DTWjetJOXFXUBIC3+8XSkW7SzL6tSzfwq4vALN3uYj8=; b=DcDhuUgyfK6EPJVvPC9eRioXGuwk1EoUM7njhfiG81oa/G11H1VqfJkQhkUFGie13G fUPMWvb0TA3yVKoj9ZT0od78NfkxfbPXPVdOT3iNxmmFbLYuHAB0/CXGQAX7WL9ddvPz ekt/FWobB8KL0xNVxlbFn5VmWvGsTTaMwmUnCP2xHL0ZbCHtCnnDmvToFFjDcl837s9E PXVGnzjfgRyUqLinEeF52sWHlAzArdxmikmpOCqSIAkLJa+TNeADWn7KSodwqXdkPHpc Zwwd9HPKs9Zo/qsX5YlmI+rFF/3OvjpNJLb9WGrd1v4x3A6GTS2RRYIZlhNdXPgoYuA8 BzoA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p24si1758909ejf.495.2020.08.26.08.49.10; Wed, 26 Aug 2020 08:49:34 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727022AbgHZPr6 (ORCPT + 99 others); Wed, 26 Aug 2020 11:47:58 -0400 Received: from smtpout1.mo803.mail-out.ovh.net ([79.137.123.219]:54677 "EHLO smtpout1.mo803.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726739AbgHZPr5 (ORCPT ); Wed, 26 Aug 2020 11:47:57 -0400 X-Greylist: delayed 575 seconds by postgrey-1.27 at vger.kernel.org; Wed, 26 Aug 2020 11:47:56 EDT Received: from pro2.mail.ovh.net (unknown [10.109.156.191]) by mo803.mail-out.ovh.net (Postfix) with ESMTPS id 6EAE963F16E0; Wed, 26 Aug 2020 17:38:18 +0200 (CEST) Received: from localhost (34.103.240.152) by DAG2EX1.emp2.local (172.16.2.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2044.4; Wed, 26 Aug 2020 17:38:17 +0200 Date: Wed, 26 Aug 2020 17:34:34 +0200 From: Tomasz Duszynski To: Krzysztof Kozlowski CC: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Peter Rosin , Kukjin Kim , 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 , , , , , Subject: Re: [PATCH 11/16] iio: chemical: scd30: Simplify with dev_err_probe() Message-ID: <20200826153434.GA7468@arch> References: <20200826145153.10444-1-krzk@kernel.org> <20200826145153.10444-11-krzk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20200826145153.10444-11-krzk@kernel.org> X-Originating-IP: [34.103.240.152] X-ClientProxiedBy: CAS2.emp2.local (172.16.1.2) To DAG2EX1.emp2.local (172.16.2.11) X-Ovh-Tracer-Id: 9361576253439499417 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedruddvvddgledtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepfffhvffukfhfgggtuggjihesthdtredttddtjeenucfhrhhomhepvfhomhgrshiiucffuhhsiiihnhhskhhiuceothhomhgrshiirdguuhhsiiihnhhskhhisehotghtrghkohhnrdgtohhmqeenucggtffrrghtthgvrhhnpedtheevtefhffduteejfedtkeeuheejgeejvdetfffgveekffefgeffueeghefgjeenucfkpheptddrtddrtddrtddpfeegrddutdefrddvgedtrdduhedvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhrohdvrdhmrghilhdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepthhomhgrshiirdguuhhsiiihnhhskhhisehotghtrghkohhnrdgtohhmpdhrtghpthhtoheplhhinhhugidqshhtmhefvdesshhtqdhmugdqmhgrihhlmhgrnhdrshhtohhrmhhrvghplhihrdgtohhm Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 26, 2020 at 04:51:48PM +0200, Krzysztof Kozlowski wrote: > 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/chemical/scd30_core.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/iio/chemical/scd30_core.c b/drivers/iio/chemical/scd30_core.c > index eac76972f83e..92358797796d 100644 > --- a/drivers/iio/chemical/scd30_core.c > +++ b/drivers/iio/chemical/scd30_core.c > @@ -705,13 +705,9 @@ int scd30_probe(struct device *dev, int irq, const char *name, void *priv, > indio_dev->available_scan_masks = scd30_scan_masks; > > state->vdd = devm_regulator_get(dev, "vdd"); > - if (IS_ERR(state->vdd)) { > - if (PTR_ERR(state->vdd) == -EPROBE_DEFER) > - return -EPROBE_DEFER; > - > - dev_err(dev, "failed to get regulator\n"); > - return PTR_ERR(state->vdd); > - } > + if (IS_ERR(state->vdd)) > + return dev_err_probe(dev, PTR_ERR(state->vdd), > + "failed to get regulator\n"); I'd say that removing like break would slightly improve readability. Besides, staying within 100 columns seems socially acceptable now. Otherwise, Acked-by: Tomasz Duszynski > > ret = regulator_enable(state->vdd); > if (ret) > -- > 2.17.1 >