Re: [PATCH 1/2] memory: brcmstb_dpfe: Simplify with dev_err_probe()
From: Markus Mayer
Date: Fri Aug 28 2020 - 12:12:23 EST
On Fri, 28 Aug 2020 at 08:37, Krzysztof Kozlowski <krzk@xxxxxxxxxx> wrote:
>
> Common pattern of handling deferred probe can be simplified with
> dev_err_probe(). Less code and the error value gets printed.
>
> Signed-off-by: Krzysztof Kozlowski <krzk@xxxxxxxxxx>
Acked-by: Markus Mayer <mmayer@xxxxxxxxxxxx>
> ---
> drivers/memory/brcmstb_dpfe.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c
> index dcf50bb8dd69..f43ba69fbb3e 100644
> --- a/drivers/memory/brcmstb_dpfe.c
> +++ b/drivers/memory/brcmstb_dpfe.c
> @@ -901,11 +901,8 @@ static int brcmstb_dpfe_probe(struct platform_device *pdev)
> }
>
> ret = brcmstb_dpfe_download_firmware(priv);
> - if (ret) {
> - if (ret != -EPROBE_DEFER)
> - dev_err(dev, "Couldn't download firmware -- %d\n", ret);
> - return ret;
> - }
> + if (ret)
> + return dev_err_probe(dev, ret, "Couldn't download firmware\n");
>
> ret = sysfs_create_groups(&pdev->dev.kobj, priv->dpfe_api->sysfs_attrs);
> if (!ret)
> --
> 2.17.1
>