[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20220308154429.ztv3l42euu2hf3ye@pengutronix.de>
Date: Tue, 8 Mar 2022 16:44:29 +0100
From: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To: hammer hsieh <hammerh0314@...il.com>
Cc: linux-pwm@...r.kernel.org, wells.lu@...plus.com,
devicetree@...r.kernel.org,
"hammer.hsieh" <hammer.hsieh@...plus.com>,
linux-kernel@...r.kernel.org, robh+dt@...nel.org,
thierry.reding@...il.com, kernel@...gutronix.de,
lee.jones@...aro.org
Subject: Re: [PATCH v2 2/2] pwm:sunplus-pwm:Add Sunplus SoC PWM Driver
Hello,
On Tue, Mar 08, 2022 at 08:03:55PM +0800, hammer hsieh wrote:
> > IMHO yes. (Though the most likely error -ENOMEM, in this case no error
> > message should be emitted.)
> >
>
> ok, will add error message like below.
> if (ret < 0) {
> dev_err(dev, "failed to release clock: %d\n", ret);
> return ret;
> }
> or should i modify like
> if (ret < 0) {
> dev_err(dev, "failed to release clock: %d\n", ret);
> return ERR_PTR(ret);
> }
> i didn't find reference code for it, not sure which one is better?
It depends if you return a pointer or an int. Also please make use of
%pe instead of %d for error codes to make it easier to understand.
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