lkml.org 
[lkml]   [2022]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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/ |
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2022-03-08 16:46    [W:0.159 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site