Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp227433pxa; Wed, 26 Aug 2020 09:02:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqU3jh8S2xh+AZA5/7Xe2msxUzYHbJEWvC/uZB5Mm36SaayeRS8c5UR8yKJjhRkrz6x1iQ X-Received: by 2002:aa7:d3c8:: with SMTP id o8mr8056299edr.23.1598457725989; Wed, 26 Aug 2020 09:02:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598457725; cv=none; d=google.com; s=arc-20160816; b=k08LHRPR8AYSeO6MS7hCdsBiXKiJ4RGVhmrrvAbzyCjSRnWGw1oJ/pUqqJySOL54IJ 1BWT6OVNGTTWfgBl6I2/ZBLNtDGUz9irVlxpAsTbLxTsTkDrYKX6alndmenRqLTu4lZb Oci9+bQbti+KPK1iBEd08+S0q+HiklOVaJmTTW8atBn9nivkvnYRF6fEt5Pn6NVA4fBa zyX8xYWD22Hzyr7OL8rmANjhLCNML2bbZnyxJ5/5utgeRxjsekQr+7wPkouCdhfe2yi6 r1V+tKtDoZDQ6SQ8nDR+38R/jA750q0AOlmaR+F6+TLnrJQyIgUvkHfMgEvpDq51Ehr5 YM4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=45MPvxSTPW26+XDfgYCIUeSzgGp+rsYJNL1Xl/Rrc7s=; b=phwk2WEQJwlScdlpRI3MxE+dnmQrBbvfGbNHi6UUsJ6WILCC//uln74ihTH//gdpsz WSToVe9ijjxnHzRnnTg6Gwsm76ttlQqSlShrr1x5l1PsOk4xVf/pvfCSFr+6xzoJyekQ 6QaJINRCBMzflcDykKv2d6EZAgZnNL6b3dQe4oC33/iX5RSzx+Lzr+caIp4bpH+nywMx ya38dpc2h+CMN1aYE2u0wYqP4FltJvOTiOAk31ngMwyLZkBrhRf33M2F4Mh3MvOor3G2 j+TnLYr/sTc9hMnqwwlKH3CzjKdaX90vUtNwh5QTcvilj8mRlWbbBKtPHsKLLybqhaSq Ukcg== 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; 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 cm16si780386edb.538.2020.08.26.09.01.42; Wed, 26 Aug 2020 09:02:05 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726836AbgHZP5y (ORCPT + 99 others); Wed, 26 Aug 2020 11:57:54 -0400 Received: from mail-ej1-f68.google.com ([209.85.218.68]:34209 "EHLO mail-ej1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726840AbgHZP52 (ORCPT ); Wed, 26 Aug 2020 11:57:28 -0400 Received: by mail-ej1-f68.google.com with SMTP id d26so3601415ejr.1; Wed, 26 Aug 2020 08:57:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=45MPvxSTPW26+XDfgYCIUeSzgGp+rsYJNL1Xl/Rrc7s=; b=L1IkuHH/tdLs91wySmKRLjfhnRiKDjGiDA4+Hjin5wIhV/kOYPdQAxnUaqmmkGXdCL ozpHXCY5Svodwvd01YI/5CZIcQ4l8/X9HxxgVfalNcBglDZBggp67z00pZYiv3zAdEuY OTATIjMg1fTH4Av0YIkX2/wyXfOEt+5QP+mF0b0LkzR9zDB2jeA1uPIyWIltOVG2Zbo8 M6YrZc587v9/GXNR54Z1DE05KPz2f5KQxSuHik6mn0NG3t47vPPoLFdnrCr5XwNKV3f5 hj++9fnl6DSYfxVw5LfgqG5g/cViBZ+vpsEnZXKZXTpdnLvMOLN52TShbanvhBdTCa2H olkQ== X-Gm-Message-State: AOAM53330SwVVx+2vjptReIKwL2o2iPJucF4eg/s1nDbKDgd1NiSCrky nB7J+575fWJKda+pzOYNc5s= X-Received: by 2002:a17:906:1404:: with SMTP id p4mr16196580ejc.256.1598457446440; Wed, 26 Aug 2020 08:57:26 -0700 (PDT) Received: from kozik-lap ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id v17sm2590422eju.22.2020.08.26.08.57.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Aug 2020 08:57:25 -0700 (PDT) Date: Wed, 26 Aug 2020 17:57:23 +0200 From: Krzysztof Kozlowski To: Tomasz Duszynski 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 , 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: Re: [PATCH 11/16] iio: chemical: scd30: Simplify with dev_err_probe() Message-ID: <20200826155723.GA31748@kozik-lap> References: <20200826145153.10444-1-krzk@kernel.org> <20200826145153.10444-11-krzk@kernel.org> <20200826153434.GA7468@arch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200826153434.GA7468@arch> User-Agent: Mutt/1.9.4 (2018-02-28) 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 05:34:34PM +0200, Tomasz Duszynski wrote: > 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 Indeed. Although 80 is still mentioned as preferred (in commit bdc48fa11 and in coding style) but here having longer line would be better. I guess this could be fixed up easily when applying but if resend is wanted, let me know. Best regards, Krzysztof