linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iio: adc: aspeed: Fix error handling path
@ 2018-01-08  6:47 Christophe JAILLET
  2018-01-14 11:03 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2018-01-08  6:47 UTC (permalink / raw)
  To: jic23, knaack.h, lars, pmeerw, raltherr, joel, arvind.yadav.cs,
	mykolak
  Cc: linux-iio, linux-kernel, kernel-janitors, Christophe JAILLET

The labels and branching order of the error path of 'aspeed_adc_probe()'
are broken.
Re-order the labels and goto statements.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Not sure where it comes from.
Merge conflict incorrectly fixed?
---
 drivers/iio/adc/aspeed_adc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
index 327a49ba1991..9515ca165dfd 100644
--- a/drivers/iio/adc/aspeed_adc.c
+++ b/drivers/iio/adc/aspeed_adc.c
@@ -243,7 +243,7 @@ static int aspeed_adc_probe(struct platform_device *pdev)
 					 ASPEED_ADC_INIT_POLLING_TIME,
 					 ASPEED_ADC_INIT_TIMEOUT);
 		if (ret)
-			goto scaler_error;
+			goto poll_timeout_error;
 	}
 
 	/* Start all channels in normal mode. */
@@ -274,9 +274,10 @@ static int aspeed_adc_probe(struct platform_device *pdev)
 	writel(ASPEED_OPERATION_MODE_POWER_DOWN,
 		data->base + ASPEED_REG_ENGINE_CONTROL);
 	clk_disable_unprepare(data->clk_scaler->clk);
-reset_error:
-	reset_control_assert(data->rst);
 clk_enable_error:
+poll_timeout_error:
+	reset_control_assert(data->rst);
+reset_error:
 	clk_hw_unregister_divider(data->clk_scaler);
 scaler_error:
 	clk_hw_unregister_divider(data->clk_prescaler);
-- 
2.14.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iio: adc: aspeed: Fix error handling path
  2018-01-08  6:47 [PATCH] iio: adc: aspeed: Fix error handling path Christophe JAILLET
@ 2018-01-14 11:03 ` Jonathan Cameron
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-01-14 11:03 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: knaack.h, lars, pmeerw, raltherr, joel, arvind.yadav.cs, mykolak,
	linux-iio, linux-kernel, kernel-janitors

On Mon,  8 Jan 2018 07:47:36 +0100
Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote:

> The labels and branching order of the error path of 'aspeed_adc_probe()'
> are broken.
> Re-order the labels and goto statements.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Applied to the fixes-togreg-post-rc1 branch of iio.git.

The patch doesn't apply that far back so I'm going to assume
you are right and that it was a merge conflict that went wrong.

Anyhow, will go in sometime after rc1.

Thanks,

Jonathan

> ---
> Not sure where it comes from.
> Merge conflict incorrectly fixed?
> ---
>  drivers/iio/adc/aspeed_adc.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/adc/aspeed_adc.c b/drivers/iio/adc/aspeed_adc.c
> index 327a49ba1991..9515ca165dfd 100644
> --- a/drivers/iio/adc/aspeed_adc.c
> +++ b/drivers/iio/adc/aspeed_adc.c
> @@ -243,7 +243,7 @@ static int aspeed_adc_probe(struct platform_device *pdev)
>  					 ASPEED_ADC_INIT_POLLING_TIME,
>  					 ASPEED_ADC_INIT_TIMEOUT);
>  		if (ret)
> -			goto scaler_error;
> +			goto poll_timeout_error;
>  	}
>  
>  	/* Start all channels in normal mode. */
> @@ -274,9 +274,10 @@ static int aspeed_adc_probe(struct platform_device *pdev)
>  	writel(ASPEED_OPERATION_MODE_POWER_DOWN,
>  		data->base + ASPEED_REG_ENGINE_CONTROL);
>  	clk_disable_unprepare(data->clk_scaler->clk);
> -reset_error:
> -	reset_control_assert(data->rst);
>  clk_enable_error:
> +poll_timeout_error:
> +	reset_control_assert(data->rst);
> +reset_error:
>  	clk_hw_unregister_divider(data->clk_scaler);
>  scaler_error:
>  	clk_hw_unregister_divider(data->clk_prescaler);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-14 11:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-08  6:47 [PATCH] iio: adc: aspeed: Fix error handling path Christophe JAILLET
2018-01-14 11:03 ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).