diff mbox series

[4/4] scsi: ufs: ufs-qcom: Use dev_err() where possible

Message ID 20221201230810.1019834-5-ahalaney@redhat.com (mailing list archive)
State Accepted
Headers show
Series scsi: ufs: ufs-qcom: Debug clean ups | expand

Commit Message

Andrew Halaney Dec. 1, 2022, 11:08 p.m. UTC
dev_err() statements are better to use than pr_err(), so switch to
those.

In a similar vein, the check on the dev_req_params pointer here is
not needed, the two places this function is called never pass in a
NULL pointer, so instead of using dev_err() there just remove it.

Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
---
 drivers/ufs/host/ufs-qcom.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

Comments

Manivannan Sadhasivam Dec. 2, 2022, 7:40 a.m. UTC | #1
On Thu, Dec 01, 2022 at 05:08:10PM -0600, Andrew Halaney wrote:
> dev_err() statements are better to use than pr_err(), so switch to
> those.
> 
> In a similar vein, the check on the dev_req_params pointer here is
> not needed, the two places this function is called never pass in a
> NULL pointer, so instead of using dev_err() there just remove it.
> 
> Signed-off-by: Andrew Halaney <ahalaney@redhat.com>

Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>

Thanks,
Mani

> ---
>  drivers/ufs/host/ufs-qcom.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
> index b1fcff1fad0c..4350c44a6fc7 100644
> --- a/drivers/ufs/host/ufs-qcom.c
> +++ b/drivers/ufs/host/ufs-qcom.c
> @@ -680,12 +680,6 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
>  	struct ufs_dev_params ufs_qcom_cap;
>  	int ret = 0;
>  
> -	if (!dev_req_params) {
> -		pr_err("%s: incoming dev_req_params is NULL\n", __func__);
> -		ret = -EINVAL;
> -		goto out;
> -	}
> -
>  	switch (status) {
>  	case PRE_CHANGE:
>  		ufshcd_init_pwr_dev_param(&ufs_qcom_cap);
> @@ -709,7 +703,7 @@ static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
>  					       dev_max_params,
>  					       dev_req_params);
>  		if (ret) {
> -			pr_err("%s: failed to determine capabilities\n",
> +			dev_err(hba->dev, "%s: failed to determine capabilities\n",
>  					__func__);
>  			goto out;
>  		}
> -- 
> 2.38.1
>
diff mbox series

Patch

diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c
index b1fcff1fad0c..4350c44a6fc7 100644
--- a/drivers/ufs/host/ufs-qcom.c
+++ b/drivers/ufs/host/ufs-qcom.c
@@ -680,12 +680,6 @@  static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
 	struct ufs_dev_params ufs_qcom_cap;
 	int ret = 0;
 
-	if (!dev_req_params) {
-		pr_err("%s: incoming dev_req_params is NULL\n", __func__);
-		ret = -EINVAL;
-		goto out;
-	}
-
 	switch (status) {
 	case PRE_CHANGE:
 		ufshcd_init_pwr_dev_param(&ufs_qcom_cap);
@@ -709,7 +703,7 @@  static int ufs_qcom_pwr_change_notify(struct ufs_hba *hba,
 					       dev_max_params,
 					       dev_req_params);
 		if (ret) {
-			pr_err("%s: failed to determine capabilities\n",
+			dev_err(hba->dev, "%s: failed to determine capabilities\n",
 					__func__);
 			goto out;
 		}