diff mbox series

[V6,6/7] iio: adc: Update debug prints

Message ID 1590684869-15400-7-git-send-email-jprakash@codeaurora.org (mailing list archive)
State Superseded
Headers show
Series iio: adc: Add support for QCOM SPMI PMIC7 ADC | expand

Commit Message

Jishnu Prakash May 28, 2020, 4:54 p.m. UTC
Change pr_err/pr_debug statements to dev_err/dev_dbg for
increased clarity.

Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
 drivers/iio/adc/qcom-spmi-adc5.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Jonathan Cameron May 31, 2020, 10:53 a.m. UTC | #1
On Thu, 28 May 2020 22:24:28 +0530
Jishnu Prakash <jprakash@codeaurora.org> wrote:

> Change pr_err/pr_debug statements to dev_err/dev_dbg for
> increased clarity.
> 
> Signed-off-by: Jishnu Prakash <jprakash@codeaurora.org>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

Applied. Thanks, J
> ---
>  drivers/iio/adc/qcom-spmi-adc5.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
> index 3022313..0f9af66 100644
> --- a/drivers/iio/adc/qcom-spmi-adc5.c
> +++ b/drivers/iio/adc/qcom-spmi-adc5.c
> @@ -246,11 +246,11 @@ static int adc5_read_voltage_data(struct adc5_chip *adc, u16 *data)
>  	*data = (rslt_msb << 8) | rslt_lsb;
>  
>  	if (*data == ADC5_USR_DATA_CHECK) {
> -		pr_err("Invalid data:0x%x\n", *data);
> +		dev_err(adc->dev, "Invalid data:0x%x\n", *data);
>  		return -EINVAL;
>  	}
>  
> -	pr_debug("voltage raw code:0x%x\n", *data);
> +	dev_dbg(adc->dev, "voltage raw code:0x%x\n", *data);
>  
>  	return 0;
>  }
> @@ -382,24 +382,24 @@ static int adc5_do_conversion(struct adc5_chip *adc,
>  
>  	ret = adc5_configure(adc, prop);
>  	if (ret) {
> -		pr_err("ADC configure failed with %d\n", ret);
> +		dev_err(adc->dev, "ADC configure failed with %d\n", ret);
>  		goto unlock;
>  	}
>  
>  	if (adc->poll_eoc) {
>  		ret = adc5_poll_wait_eoc(adc);
>  		if (ret) {
> -			pr_err("EOC bit not set\n");
> +			dev_err(adc->dev, "EOC bit not set\n");
>  			goto unlock;
>  		}
>  	} else {
>  		ret = wait_for_completion_timeout(&adc->complete,
>  							ADC5_CONV_TIMEOUT);
>  		if (!ret) {
> -			pr_debug("Did not get completion timeout.\n");
> +			dev_dbg(adc->dev, "Did not get completion timeout.\n");
>  			ret = adc5_poll_wait_eoc(adc);
>  			if (ret) {
> -				pr_err("EOC bit not set\n");
> +				dev_err(adc->dev, "EOC bit not set\n");
>  				goto unlock;
>  			}
>  		}
> @@ -721,7 +721,7 @@ static int adc5_get_dt_channel_data(struct adc5_chip *adc,
>  	channel_name = of_get_property(node,
>  				"label", NULL) ? : node->name;
>  	if (!channel_name) {
> -		pr_err("Invalid channel name\n");
> +		dev_err(dev, "Invalid channel name\n");
>  		return -EINVAL;
>  	}
>  	prop->datasheet_name = channel_name;
> @@ -764,7 +764,7 @@ static int adc5_get_dt_channel_data(struct adc5_chip *adc,
>  			return ret;
>  		}
>  
> -		pr_debug("dig_ver:minor:%d, major:%d\n", dig_version[0],
> +		dev_dbg(dev, "dig_ver:minor:%d, major:%d\n", dig_version[0],
>  						dig_version[1]);
>  		/* Digital controller >= 5.3 have hw_settle_2 option */
>  		if ((dig_version[0] >= ADC5_HW_SETTLE_DIFF_MINOR &&
> @@ -966,7 +966,7 @@ static int adc5_probe(struct platform_device *pdev)
>  
>  	ret = adc5_get_dt_data(adc, node);
>  	if (ret) {
> -		pr_err("adc get dt data failed\n");
> +		dev_err(dev, "adc get dt data failed\n");
>  		return ret;
>  	}
>
diff mbox series

Patch

diff --git a/drivers/iio/adc/qcom-spmi-adc5.c b/drivers/iio/adc/qcom-spmi-adc5.c
index 3022313..0f9af66 100644
--- a/drivers/iio/adc/qcom-spmi-adc5.c
+++ b/drivers/iio/adc/qcom-spmi-adc5.c
@@ -246,11 +246,11 @@  static int adc5_read_voltage_data(struct adc5_chip *adc, u16 *data)
 	*data = (rslt_msb << 8) | rslt_lsb;
 
 	if (*data == ADC5_USR_DATA_CHECK) {
-		pr_err("Invalid data:0x%x\n", *data);
+		dev_err(adc->dev, "Invalid data:0x%x\n", *data);
 		return -EINVAL;
 	}
 
-	pr_debug("voltage raw code:0x%x\n", *data);
+	dev_dbg(adc->dev, "voltage raw code:0x%x\n", *data);
 
 	return 0;
 }
@@ -382,24 +382,24 @@  static int adc5_do_conversion(struct adc5_chip *adc,
 
 	ret = adc5_configure(adc, prop);
 	if (ret) {
-		pr_err("ADC configure failed with %d\n", ret);
+		dev_err(adc->dev, "ADC configure failed with %d\n", ret);
 		goto unlock;
 	}
 
 	if (adc->poll_eoc) {
 		ret = adc5_poll_wait_eoc(adc);
 		if (ret) {
-			pr_err("EOC bit not set\n");
+			dev_err(adc->dev, "EOC bit not set\n");
 			goto unlock;
 		}
 	} else {
 		ret = wait_for_completion_timeout(&adc->complete,
 							ADC5_CONV_TIMEOUT);
 		if (!ret) {
-			pr_debug("Did not get completion timeout.\n");
+			dev_dbg(adc->dev, "Did not get completion timeout.\n");
 			ret = adc5_poll_wait_eoc(adc);
 			if (ret) {
-				pr_err("EOC bit not set\n");
+				dev_err(adc->dev, "EOC bit not set\n");
 				goto unlock;
 			}
 		}
@@ -721,7 +721,7 @@  static int adc5_get_dt_channel_data(struct adc5_chip *adc,
 	channel_name = of_get_property(node,
 				"label", NULL) ? : node->name;
 	if (!channel_name) {
-		pr_err("Invalid channel name\n");
+		dev_err(dev, "Invalid channel name\n");
 		return -EINVAL;
 	}
 	prop->datasheet_name = channel_name;
@@ -764,7 +764,7 @@  static int adc5_get_dt_channel_data(struct adc5_chip *adc,
 			return ret;
 		}
 
-		pr_debug("dig_ver:minor:%d, major:%d\n", dig_version[0],
+		dev_dbg(dev, "dig_ver:minor:%d, major:%d\n", dig_version[0],
 						dig_version[1]);
 		/* Digital controller >= 5.3 have hw_settle_2 option */
 		if ((dig_version[0] >= ADC5_HW_SETTLE_DIFF_MINOR &&
@@ -966,7 +966,7 @@  static int adc5_probe(struct platform_device *pdev)
 
 	ret = adc5_get_dt_data(adc, node);
 	if (ret) {
-		pr_err("adc get dt data failed\n");
+		dev_err(dev, "adc get dt data failed\n");
 		return ret;
 	}