Re: [PATCH v2 2/2] pwm:sunplus-pwm:Add Sunplus SoC PWM Driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/ |

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux