Re: [PATCH 06/24] Input: pwm-vibra - Simplify with dev_err_probe()

2020-08-27 Thread Krzysztof Kozlowski
On Thu, Aug 27, 2020 at 12:06:46PM +0300, Andy Shevchenko wrote:
> On Wed, Aug 26, 2020 at 9:18 PM Krzysztof Kozlowski  wrote:
> >
> > Common pattern of handling deferred probe can be simplified with
> > dev_err_probe().  Less code and also it prints the error value.
> 
> > err = PTR_ERR_OR_ZERO(vibrator->vcc);
> > +   if (err)
> > +   return dev_err_probe(&pdev->dev, err, "Failed to request 
> > regulator\n");
> 
> Same comment, no need to have additional PTR_ERR_OZR_ZERO().

Yes.

Best regards,
Krzysztof



Re: [PATCH 06/24] Input: pwm-vibra - Simplify with dev_err_probe()

2020-08-27 Thread Andy Shevchenko
On Wed, Aug 26, 2020 at 9:18 PM Krzysztof Kozlowski  wrote:
>
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe().  Less code and also it prints the error value.

> err = PTR_ERR_OR_ZERO(vibrator->vcc);
> +   if (err)
> +   return dev_err_probe(&pdev->dev, err, "Failed to request 
> regulator\n");

Same comment, no need to have additional PTR_ERR_OZR_ZERO().

-- 
With Best Regards,
Andy Shevchenko