public inbox for linux-arm-kernel@lists.infradead.org 
 help / color / mirror / Atom feed
From: Tomasz Duszynski <tomasz.duszynski@octakon•com>
To: Krzysztof Kozlowski <krzk@kernel•org>
Cc: Peter Meerwald-Stadler <pmeerw@pmeerw•net>,
	Neil Armstrong <narmstrong@baylibre•com>,
	Jonathan Bakker <xc-racer2@live•ca>,
	Tomasz Duszynski <tomasz.duszynski@octakon•com>,
	linux-stm32@st-md-mailman•stormreply.com,
	Jerome Brunet <jbrunet@baylibre•com>,
	Lars-Peter Clausen <lars@metafoo•de>,
	Kevin Hilman <khilman@baylibre•com>,
	Marek Vasut <marek.vasut@gmail•com>,
	Kukjin Kim <kgene@kernel•org>,
	Alexandru Ardelean <alexandru.ardelean@analog•com>,
	Linus Walleij <linus.walleij@linaro•org>,
	Alexandre Torgue <alexandre.torgue@st•com>,
	Michael Hennerich <Michael.Hennerich@analog•com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail•com>,
	linux-samsung-soc@vger•kernel.org,
	linux-amlogic@lists•infradead.org,
	linux-arm-kernel@lists•infradead.org,
	linux-kernel@vger•kernel.org,
	Beniamin Bia <beniamin.bia@analog•com>,
	Maxime Coquelin <mcoquelin.stm32@gmail•com>,
	Hartmut Knaack <knaack.h@gmx•de>, Peter Rosin <peda@axentia•se>,
	Jonathan Cameron <jic23@kernel•org>
Subject: Re: [PATCH 11/16] iio: chemical: scd30: Simplify with dev_err_probe()
Date: Wed, 26 Aug 2020 17:34:34 +0200	[thread overview]
Message-ID: <20200826153434.GA7468@arch> (raw)
In-Reply-To: <20200826145153.10444-11-krzk@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 <krzk@kernel•org>
> ---
>  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 <tomasz.duszynski@octakon•com>

>
>  	ret = regulator_enable(state->vdd);
>  	if (ret)
> --
> 2.17.1
>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-26 15:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 14:51 [PATCH 01/16] iio: accel: bma180: Simplify with dev_err_probe() Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 02/16] iio: accel: mma8452: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 03/16] iio: adc: envelope-detector: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 04/16] iio: adc: exynos_adc: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 05/16] iio: adc: ltc2497: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 06/16] iio: adc: meson_saradc: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 07/16] iio: adc: rcar-gyroadc: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 08/16] iio: adc: stm32: " Krzysztof Kozlowski
2020-08-26 16:17   ` Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 09/16] iio: afe: iio-rescale: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 10/16] iio: amplifiers: hmc425a: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 11/16] iio: chemical: scd30: " Krzysztof Kozlowski
2020-08-26 15:34   ` Tomasz Duszynski [this message]
2020-08-26 15:57     ` Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 12/16] iio: dac: dpot-dac: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 13/16] iio: imu: inv_mpu6050: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 14/16] iio: light: isl29018: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 15/16] iio: light: tsl2772: " Krzysztof Kozlowski
2020-08-26 14:51 ` [PATCH 16/16] iio: magnetometer: ak8974: " Krzysztof Kozlowski
2020-08-28 13:03   ` Linus Walleij
2020-08-27 11:26 ` [PATCH 01/16] iio: accel: bma180: " Jonathan Cameron
2020-08-27 11:28   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200826153434.GA7468@arch \
    --to=tomasz.duszynski@octakon$(echo .)com \
    --cc=Michael.Hennerich@analog$(echo .)com \
    --cc=alexandre.torgue@st$(echo .)com \
    --cc=alexandru.ardelean@analog$(echo .)com \
    --cc=beniamin.bia@analog$(echo .)com \
    --cc=jbrunet@baylibre$(echo .)com \
    --cc=jic23@kernel$(echo .)org \
    --cc=kgene@kernel$(echo .)org \
    --cc=khilman@baylibre$(echo .)com \
    --cc=knaack.h@gmx$(echo .)de \
    --cc=krzk@kernel$(echo .)org \
    --cc=lars@metafoo$(echo .)de \
    --cc=linus.walleij@linaro$(echo .)org \
    --cc=linux-amlogic@lists$(echo .)infradead.org \
    --cc=linux-arm-kernel@lists$(echo .)infradead.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-samsung-soc@vger$(echo .)kernel.org \
    --cc=linux-stm32@st-md-mailman$(echo .)stormreply.com \
    --cc=marek.vasut@gmail$(echo .)com \
    --cc=martin.blumenstingl@googlemail$(echo .)com \
    --cc=mcoquelin.stm32@gmail$(echo .)com \
    --cc=narmstrong@baylibre$(echo .)com \
    --cc=peda@axentia$(echo .)se \
    --cc=pmeerw@pmeerw$(echo .)net \
    --cc=xc-racer2@live$(echo .)ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox