summaryrefslogtreecommitdiff
path: root/drivers/iio/adc
diff options
context:
space:
mode:
authorManish Narani <manish.narani@xilinx.com>2018-07-23 20:32:03 +0530
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2018-07-29 13:30:35 +0100
commit2fa03b92b62982c420c9c77a58bda52b96ed8ba4 (patch)
treef9a9bdfe206877a24e38d9798575baa407ca78ab /drivers/iio/adc
parent50e8e9f3096bd4e9ce2f42da11f3824358a826a7 (diff)
iio: adc: xilinx: Move request_irq before enabling interrupts
Enabling the Interrupts before registering the irq handler is a bad idea. This patch corrects the same for XADC driver. Signed-off-by: Manish Narani <manish.narani@xilinx.com> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc')
-rw-r--r--drivers/iio/adc/xilinx-xadc-core.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 44a25198387d..3f6be5ac049a 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1226,15 +1226,15 @@ static int xadc_probe(struct platform_device *pdev)
if (ret)
goto err_free_samplerate_trigger;
- ret = xadc->ops->setup(pdev, indio_dev, xadc->irq);
- if (ret)
- goto err_clk_disable_unprepare;
-
ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0,
dev_name(&pdev->dev), indio_dev);
if (ret)
goto err_clk_disable_unprepare;
+ ret = xadc->ops->setup(pdev, indio_dev, xadc->irq);
+ if (ret)
+ goto err_free_irq;
+
for (i = 0; i < 16; i++)
xadc_read_adc_reg(xadc, XADC_REG_THRESHOLD(i),
&xadc->threshold[i]);