* [PATCH v2] iio: adc: xilinx: Fix error handling
@ 2017-02-21 6:34 Christophe JAILLET
2017-02-21 11:55 ` Lars-Peter Clausen
0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2017-02-21 6:34 UTC (permalink / raw)
To: jic23, knaack.h, lars, pmeerw, michal.simek, soren.brinkmann
Cc: linux-iio, linux-arm-kernel, linux-kernel, kernel-janitors,
Christophe JAILLET
Reorder error handling labels in order to match the way resources have
been allocated.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
v2: update goto label if 'xadc->ops->setup()' fails
---
drivers/iio/adc/xilinx-xadc-core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 0a6beb3d99cb..515b91963db5 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1206,11 +1206,11 @@ static int xadc_probe(struct platform_device *pdev)
}
clk_prepare_enable(xadc->clk);
ret = xadc->ops->setup(pdev, indio_dev, irq);
if (ret)
- goto err_free_samplerate_trigger;
+ goto err_clk_disable_unprepare;
ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
dev_name(&pdev->dev), indio_dev);
if (ret)
goto err_clk_disable_unprepare;
@@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
err_free_irq:
free_irq(irq, indio_dev);
+err_clk_disable_unprepare:
+ clk_disable_unprepare(xadc->clk);
err_free_samplerate_trigger:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_trigger_free(xadc->samplerate_trigger);
@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
err_triggered_buffer_cleanup:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_triggered_buffer_cleanup(indio_dev);
-err_clk_disable_unprepare:
- clk_disable_unprepare(xadc->clk);
err_device_free:
kfree(indio_dev->channels);
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] iio: adc: xilinx: Fix error handling
2017-02-21 6:34 [PATCH v2] iio: adc: xilinx: Fix error handling Christophe JAILLET
@ 2017-02-21 11:55 ` Lars-Peter Clausen
2017-02-25 16:41 ` Jonathan Cameron
0 siblings, 1 reply; 3+ messages in thread
From: Lars-Peter Clausen @ 2017-02-21 11:55 UTC (permalink / raw)
To: Christophe JAILLET, jic23, knaack.h, pmeerw, michal.simek,
soren.brinkmann
Cc: linux-iio, linux-arm-kernel, linux-kernel, kernel-janitors
On 02/21/2017 07:34 AM, Christophe JAILLET wrote:
> Reorder error handling labels in order to match the way resources have
> been allocated.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Thanks.
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
> ---
> v2: update goto label if 'xadc->ops->setup()' fails
> ---
> drivers/iio/adc/xilinx-xadc-core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
> index 0a6beb3d99cb..515b91963db5 100644
> --- a/drivers/iio/adc/xilinx-xadc-core.c
> +++ b/drivers/iio/adc/xilinx-xadc-core.c
> @@ -1206,11 +1206,11 @@ static int xadc_probe(struct platform_device *pdev)
> }
> clk_prepare_enable(xadc->clk);
>
> ret = xadc->ops->setup(pdev, indio_dev, irq);
> if (ret)
> - goto err_free_samplerate_trigger;
> + goto err_clk_disable_unprepare;
>
> ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
> dev_name(&pdev->dev), indio_dev);
> if (ret)
> goto err_clk_disable_unprepare;
> @@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
>
> err_free_irq:
> free_irq(irq, indio_dev);
> +err_clk_disable_unprepare:
> + clk_disable_unprepare(xadc->clk);
> err_free_samplerate_trigger:
> if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
> iio_trigger_free(xadc->samplerate_trigger);
> @@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
> err_triggered_buffer_cleanup:
> if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
> iio_triggered_buffer_cleanup(indio_dev);
> -err_clk_disable_unprepare:
> - clk_disable_unprepare(xadc->clk);
> err_device_free:
> kfree(indio_dev->channels);
>
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] iio: adc: xilinx: Fix error handling
2017-02-21 11:55 ` Lars-Peter Clausen
@ 2017-02-25 16:41 ` Jonathan Cameron
0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2017-02-25 16:41 UTC (permalink / raw)
To: Lars-Peter Clausen, Christophe JAILLET, knaack.h, pmeerw,
michal.simek, soren.brinkmann
Cc: linux-iio, linux-arm-kernel, linux-kernel, kernel-janitors
On 21/02/17 11:55, Lars-Peter Clausen wrote:
> On 02/21/2017 07:34 AM, Christophe JAILLET wrote:
>> Reorder error handling labels in order to match the way resources have
>> been allocated.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>
> Thanks.
>
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Applied to the fixes-togreg-post-rc1 branch of iio.git.
Thanks,
Jonathan
>
>> ---
>> v2: update goto label if 'xadc->ops->setup()' fails
>> ---
>> drivers/iio/adc/xilinx-xadc-core.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
>> index 0a6beb3d99cb..515b91963db5 100644
>> --- a/drivers/iio/adc/xilinx-xadc-core.c
>> +++ b/drivers/iio/adc/xilinx-xadc-core.c
>> @@ -1206,11 +1206,11 @@ static int xadc_probe(struct platform_device *pdev)
>> }
>> clk_prepare_enable(xadc->clk);
>>
>> ret = xadc->ops->setup(pdev, indio_dev, irq);
>> if (ret)
>> - goto err_free_samplerate_trigger;
>> + goto err_clk_disable_unprepare;
>>
>> ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
>> dev_name(&pdev->dev), indio_dev);
>> if (ret)
>> goto err_clk_disable_unprepare;
>> @@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
>>
>> err_free_irq:
>> free_irq(irq, indio_dev);
>> +err_clk_disable_unprepare:
>> + clk_disable_unprepare(xadc->clk);
>> err_free_samplerate_trigger:
>> if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
>> iio_trigger_free(xadc->samplerate_trigger);
>> @@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
>> err_triggered_buffer_cleanup:
>> if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
>> iio_triggered_buffer_cleanup(indio_dev);
>> -err_clk_disable_unprepare:
>> - clk_disable_unprepare(xadc->clk);
>> err_device_free:
>> kfree(indio_dev->channels);
>>
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-02-25 16:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-21 6:34 [PATCH v2] iio: adc: xilinx: Fix error handling Christophe JAILLET
2017-02-21 11:55 ` Lars-Peter Clausen
2017-02-25 16:41 ` 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).