iio: adc: stm32-adc: don't print an error on probe deferral
diff mbox series

Message ID 1578921539-6353-1-git-send-email-fabrice.gasnier@st.com
State New
Headers show
Series
  • iio: adc: stm32-adc: don't print an error on probe deferral
Related show

Commit Message

Fabrice Gasnier Jan. 13, 2020, 1:18 p.m. UTC
From: Etienne Carriere <etienne.carriere@st.com>

Do not print an error trace when deferring probe for some resource.

Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 drivers/iio/adc/stm32-adc-core.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Jonathan Cameron Jan. 18, 2020, 2:22 p.m. UTC | #1
On Mon, 13 Jan 2020 14:18:59 +0100
Fabrice Gasnier <fabrice.gasnier@st.com> wrote:

> From: Etienne Carriere <etienne.carriere@st.com>
> 
> Do not print an error trace when deferring probe for some resource.
> 
> Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Applied.

Thanks,

Jonathan

> ---
>  drivers/iio/adc/stm32-adc-core.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
> index 97655d7..2df88d2 100644
> --- a/drivers/iio/adc/stm32-adc-core.c
> +++ b/drivers/iio/adc/stm32-adc-core.c
> @@ -688,7 +688,8 @@ static int stm32_adc_probe(struct platform_device *pdev)
>  	priv->vref = devm_regulator_get(&pdev->dev, "vref");
>  	if (IS_ERR(priv->vref)) {
>  		ret = PTR_ERR(priv->vref);
> -		dev_err(&pdev->dev, "vref get failed, %d\n", ret);
> +		if (ret != -EPROBE_DEFER)
> +			dev_err(&pdev->dev, "vref get failed, %d\n", ret);
>  		return ret;
>  	}
>  
> @@ -696,7 +697,8 @@ static int stm32_adc_probe(struct platform_device *pdev)
>  	if (IS_ERR(priv->aclk)) {
>  		ret = PTR_ERR(priv->aclk);
>  		if (ret != -ENOENT) {
> -			dev_err(&pdev->dev, "Can't get 'adc' clock\n");
> +			if (ret != -EPROBE_DEFER)
> +				dev_err(&pdev->dev, "Can't get 'adc' clock\n");
>  			return ret;
>  		}
>  		priv->aclk = NULL;
> @@ -706,7 +708,8 @@ static int stm32_adc_probe(struct platform_device *pdev)
>  	if (IS_ERR(priv->bclk)) {
>  		ret = PTR_ERR(priv->bclk);
>  		if (ret != -ENOENT) {
> -			dev_err(&pdev->dev, "Can't get 'bus' clock\n");
> +			if (ret != -EPROBE_DEFER)
> +				dev_err(&pdev->dev, "Can't get 'bus' clock\n");
>  			return ret;
>  		}
>  		priv->bclk = NULL;

Patch
diff mbox series

diff --git a/drivers/iio/adc/stm32-adc-core.c b/drivers/iio/adc/stm32-adc-core.c
index 97655d7..2df88d2 100644
--- a/drivers/iio/adc/stm32-adc-core.c
+++ b/drivers/iio/adc/stm32-adc-core.c
@@ -688,7 +688,8 @@  static int stm32_adc_probe(struct platform_device *pdev)
 	priv->vref = devm_regulator_get(&pdev->dev, "vref");
 	if (IS_ERR(priv->vref)) {
 		ret = PTR_ERR(priv->vref);
-		dev_err(&pdev->dev, "vref get failed, %d\n", ret);
+		if (ret != -EPROBE_DEFER)
+			dev_err(&pdev->dev, "vref get failed, %d\n", ret);
 		return ret;
 	}
 
@@ -696,7 +697,8 @@  static int stm32_adc_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->aclk)) {
 		ret = PTR_ERR(priv->aclk);
 		if (ret != -ENOENT) {
-			dev_err(&pdev->dev, "Can't get 'adc' clock\n");
+			if (ret != -EPROBE_DEFER)
+				dev_err(&pdev->dev, "Can't get 'adc' clock\n");
 			return ret;
 		}
 		priv->aclk = NULL;
@@ -706,7 +708,8 @@  static int stm32_adc_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->bclk)) {
 		ret = PTR_ERR(priv->bclk);
 		if (ret != -ENOENT) {
-			dev_err(&pdev->dev, "Can't get 'bus' clock\n");
+			if (ret != -EPROBE_DEFER)
+				dev_err(&pdev->dev, "Can't get 'bus' clock\n");
 			return ret;
 		}
 		priv->bclk = NULL;