mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Rosin <peda@axentia.se>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 3/3] mux: gpio: Simplify code by using dev_err_probe()
Date: Tue, 30 Mar 2021 18:13:03 +0200	[thread overview]
Message-ID: <b01d838e-e306-389f-cab2-b445fe339250@axentia.se> (raw)
In-Reply-To: <20210326172401.33685-3-andriy.shevchenko@linux.intel.com>

Hi!

On 2021-03-26 18:24, Andy Shevchenko wrote:
> Use already prepared dev_err_probe() introduced by the commit
> a787e5400a1c ("driver core: add device probe log helper").
> It simplifies EPROBE_DEFER handling.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mux/gpio.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/mux/gpio.c b/drivers/mux/gpio.c
> index e5ef9284e2b4..c3036bfffd50 100644
> --- a/drivers/mux/gpio.c
> +++ b/drivers/mux/gpio.c
> @@ -65,12 +65,8 @@ static int mux_gpio_probe(struct platform_device *pdev)
>  	mux_chip->ops = &mux_gpio_ops;
>  
>  	mux_gpio->gpios = devm_gpiod_get_array(dev, "mux", GPIOD_OUT_LOW);
> -	if (IS_ERR(mux_gpio->gpios)) {
> -		ret = PTR_ERR(mux_gpio->gpios);
> -		if (ret != -EPROBE_DEFER)
> -			dev_err(dev, "failed to get gpios\n");
> -		return ret;
> -	}
> +	if (IS_ERR(mux_gpio->gpios))
> +		return dev_err_probe(dev, PTR_ERR(mux_gpio->gpios), "failed to get gpios\n");

Please break this line, keeping it as one line does not significantly
increase readability. I know many people think long lines are super
nice, but I'm not sold and am stubbornly sticking to 80 cols. I'd rater
have room for one more window instead of wasting loads of screen on
mostly short lines and a long one here and there. Sorry to be a pest,
but coding-style.rst agrees with me:

"The preferred limit on the length of a single line is 80 columns."

So, with that changed,

Acked-by: Peter Rosin <peda@axentia.se>

Cheers,
Peter

>  	WARN_ON(pins != mux_gpio->gpios->ndescs);
>  	mux_chip->mux->states = BIT(pins);
>  
> 

  reply	other threads:[~2021-03-30 16:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-26 17:23 [PATCH v1 1/3] mux: gpio: Use bitmap API instead of direct assignment Andy Shevchenko
2021-03-26 17:24 ` [PATCH v1 2/3] mux: gpio: Make it OF independent Andy Shevchenko
2021-03-30 16:11   ` Peter Rosin
2021-03-26 17:24 ` [PATCH v1 3/3] mux: gpio: Simplify code by using dev_err_probe() Andy Shevchenko
2021-03-30 16:13   ` Peter Rosin [this message]
2021-03-29 12:37 ` [PATCH v1 1/3] mux: gpio: Use bitmap API instead of direct assignment Andy Shevchenko
2021-03-30 16:10 ` Peter Rosin

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=b01d838e-e306-389f-cab2-b445fe339250@axentia.se \
    --to=peda@axentia.se \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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

all inboxes | Powered by JetHome®