[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231210141344.c7ym5jupttir3i2n@pengutronix.de>
Date: Sun, 10 Dec 2023 15:13:44 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
kernel@...gutronix.de
Subject: Re: [PATCH 2/2] bus: ts-nbus: Improve error reporting
Hello,
[dropped Sebastien from Cc, the address doesn't work]
On Sun, Dec 10, 2023 at 07:55:02AM +0100, Christophe JAILLET wrote:
> Le 09/12/2023 à 23:35, Uwe Kleine-König a écrit :
> > Using dev_err_probe() brings several improvements:
> >
> > - emits the symbolic error code
> > - properly handles EPROBE_DEFER
> > - combines error message generation and return value handling
> >
> > While at it add error messages to two error paths that were silent
> > before.
> >
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> > ---
> > drivers/bus/ts-nbus.c | 65 ++++++++++++++++++-------------------------
> > 1 file changed, 27 insertions(+), 38 deletions(-)
> >
> > diff --git a/drivers/bus/ts-nbus.c b/drivers/bus/ts-nbus.c
>
> ...
>
> > @@ -289,25 +283,19 @@ static int ts_nbus_probe(struct platform_device *pdev)
> > return ret;
> > pwm = devm_pwm_get(dev, NULL);
> > - if (IS_ERR(pwm)) {
> > - ret = PTR_ERR(pwm);
> > - if (ret != -EPROBE_DEFER)
> > - dev_err(dev, "unable to request PWM\n");
> > - return ret;
> > - }
> > + if (IS_ERR(pwm))
> > + return dev_err_probe(dev, ret, "unable to request PWM\n");
>
> s/ret/PTR_ERR(pwm)/
Indeed. Thanks for spotting that. Will send a v2 after waiting a bit
more for feedback.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | https://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists