Skip to content

Commit

Permalink
iio: adc: xilinx: Fix error handling
Browse files Browse the repository at this point in the history
Reorder error handling labels in order to match the way resources have
been allocated.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
  • Loading branch information
tititiou36 authored and jic23 committed Feb 25, 2017
1 parent ca8d8e0 commit ca1c39e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/iio/adc/xilinx-xadc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev)

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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);

Expand Down

0 comments on commit ca1c39e

Please sign in to comment.