Re: [PATCH 1/3] driver core: add probe_err log helper

From: Javier Martinez Canillas
Date: Tue Oct 16 2018 - 05:32:40 EST


Hello Andrzej,

On 10/16/2018 09:22 AM, Andrzej Hajda wrote:
> During probe every time driver gets resource it should usually check for error
> printk some message if it is not -EPROBE_DEFER and return the error. This
> pattern is simple but requires adding few lines after any resource acquisition
> code, as a result it is often omited or implemented only partially.
> probe_err helps to replace such code seqences with simple call, so code:
> if (err != -EPROBE_DEFER)
> dev_err(dev, ...);
> return err;
> becomes:
> return probe_err(dev, err, ...);
>
> Signed-off-by: Andrzej Hajda <a.hajda@xxxxxxxxxxx>
> ---

Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>

Best regards,
--
Javier Martinez Canillas
Software Engineer - Desktop Hardware Enablement
Red Hat