[PATCH v3 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init

Brian Masney posted 2 patches 2 years ago
[PATCH v3 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init
Posted by Brian Masney 2 years ago
Convert ufshcd_pltfrm_init() over to use dev_err_probe() to avoid
the following log message on bootup due to an -EPROBE_DEFER return
code:

    ufshcd-qcom 1d84000.ufs: Initialization failed

While this line is changed, let's also go ahead and add the error code
to the message as well.

Signed-off-by: Brian Masney <bmasney@redhat.com>
---
Changes since v2
- Add error code to message

Changes since v1
- None

 drivers/ufs/host/ufshcd-pltfrm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
index 0b7430033047..c81a14f9eaf5 100644
--- a/drivers/ufs/host/ufshcd-pltfrm.c
+++ b/drivers/ufs/host/ufshcd-pltfrm.c
@@ -373,7 +373,8 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
 
 	err = ufshcd_init(hba, mmio_base, irq);
 	if (err) {
-		dev_err(dev, "Initialization failed\n");
+		dev_err_probe(dev, err, "Initialization failed with error %d\n",
+			      err);
 		goto dealloc_host;
 	}
 
-- 
2.41.0
Re: [PATCH v3 2/2] scsi: ufs: host: convert to dev_err_probe() in pltfrm_init
Posted by Bao D. Nguyen 2 years ago
> diff --git a/drivers/ufs/host/ufshcd-pltfrm.c b/drivers/ufs/host/ufshcd-pltfrm.c
> index 0b7430033047..c81a14f9eaf5 100644
> --- a/drivers/ufs/host/ufshcd-pltfrm.c
> +++ b/drivers/ufs/host/ufshcd-pltfrm.c
> @@ -373,7 +373,8 @@ int ufshcd_pltfrm_init(struct platform_device *pdev,
>   
>   	err = ufshcd_init(hba, mmio_base, irq);
>   	if (err) {
> -		dev_err(dev, "Initialization failed\n");
> +		dev_err_probe(dev, err, "Initialization failed with error %d\n",
> +			      err);
>   		goto dealloc_host;
>   	}
>   

Reviewed-by: Bao D. Nguyen <quic_nguyenb@quicinc.com>