Commit ca1c39ef authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Jonathan Cameron

iio: adc: xilinx: Fix error handling

Reorder error handling labels in order to match the way resources have
been allocated.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent ca8d8e03
...@@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1208,7 +1208,7 @@ static int xadc_probe(struct platform_device *pdev)
ret = xadc->ops->setup(pdev, indio_dev, irq); ret = xadc->ops->setup(pdev, indio_dev, irq);
if (ret) if (ret)
goto err_free_samplerate_trigger; goto err_clk_disable_unprepare;
ret = request_irq(irq, xadc->ops->interrupt_handler, 0, ret = request_irq(irq, xadc->ops->interrupt_handler, 0,
dev_name(&pdev->dev), indio_dev); dev_name(&pdev->dev), indio_dev);
...@@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1268,6 +1268,8 @@ static int xadc_probe(struct platform_device *pdev)
err_free_irq: err_free_irq:
free_irq(irq, indio_dev); free_irq(irq, indio_dev);
err_clk_disable_unprepare:
clk_disable_unprepare(xadc->clk);
err_free_samplerate_trigger: err_free_samplerate_trigger:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED) if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_trigger_free(xadc->samplerate_trigger); iio_trigger_free(xadc->samplerate_trigger);
...@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1277,8 +1279,6 @@ static int xadc_probe(struct platform_device *pdev)
err_triggered_buffer_cleanup: err_triggered_buffer_cleanup:
if (xadc->ops->flags & XADC_FLAGS_BUFFERED) if (xadc->ops->flags & XADC_FLAGS_BUFFERED)
iio_triggered_buffer_cleanup(indio_dev); iio_triggered_buffer_cleanup(indio_dev);
err_clk_disable_unprepare:
clk_disable_unprepare(xadc->clk);
err_device_free: err_device_free:
kfree(indio_dev->channels); kfree(indio_dev->channels);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment