diff mbox

iio: adc: xilinx: Fix error handling

Message ID 20170219202928.20296-1-christophe.jaillet@wanadoo.fr (mailing list archive)
State New, archived
Headers show

Commit Message

Christophe JAILLET Feb. 19, 2017, 8:29 p.m. UTC
Reorder error handling labels in order to match the way resources have
been allocated.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/iio/adc/xilinx-xadc-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Lars-Peter Clausen Feb. 20, 2017, 8:35 a.m. UTC | #1
On 02/19/2017 09:29 PM, 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, looks good.

Acked-by: Lars-Peter Clausen <lars@metafoo.de>

I think there is one more issue

    ret = xadc->ops->setup(pdev, indio_dev, irq);
    if (ret)
        goto err_free_samplerate_trigger;

should be

	goto err_clk_disable_unprepare;
Christophe JAILLET Feb. 20, 2017, 8:25 p.m. UTC | #2
Le 20/02/2017 à 09:35, Lars-Peter Clausen a écrit :
> On 02/19/2017 09:29 PM, 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, looks good.
>
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>
>
> I think there is one more issue
>
>      ret = xadc->ops->setup(pdev, indio_dev, irq);
>      if (ret)
>          goto err_free_samplerate_trigger;
>
> should be
>
> 	goto err_clk_disable_unprepare;
>
I agree.

Would you like me to send a V2 with both fixes or a sepparate patch?

CJ
Christophe JAILLET Feb. 20, 2017, 8:25 p.m. UTC | #3
Le 20/02/2017 à 09:35, Lars-Peter Clausen a écrit :
> On 02/19/2017 09:29 PM, Christophe JAILLET wrote:
>> Reorder error handling labels in order to match the way resources have
>> been allocated.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
> Thanks, looks good.
>
> Acked-by: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
>
> I think there is one more issue
>
>      ret = xadc->ops->setup(pdev, indio_dev, irq);
>      if (ret)
>          goto err_free_samplerate_trigger;
>
> should be
>
> 	goto err_clk_disable_unprepare;
>
I agree.

Would you like me to send a V2 with both fixes or a sepparate patch?

CJ
Lars-Peter Clausen Feb. 20, 2017, 8:58 p.m. UTC | #4
On 02/20/2017 09:25 PM, Christophe JAILLET wrote:
> Le 20/02/2017 à 09:35, Lars-Peter Clausen a écrit :
>> On 02/19/2017 09:29 PM, Christophe JAILLET wrote:
>>> Reorder error handling labels in order to match the way resources have
>>> been allocated.
>>>
>>> Signed-off-by: Christophe JAILLET
>>> <christophe.jaillet-39ZsbGIQGT5GWvitb5QawA@public.gmane.org>
>> Thanks, looks good.
>>
>> Acked-by: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
>>
>> I think there is one more issue
>>
>>      ret = xadc->ops->setup(pdev, indio_dev, irq);
>>      if (ret)
>>          goto err_free_samplerate_trigger;
>>
>> should be
>>
>>     goto err_clk_disable_unprepare;
>>
> I agree.
> 
> Would you like me to send a V2 with both fixes or a sepparate patch?

Up to you.
diff mbox

Patch

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
@@ -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);