summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-05-26 08:37:41 +0200
committerJonathan Cameron <jic23@kernel.org>2017-06-03 10:55:23 +0200
commit0a178fd7327e13ec7f8079a06a20b0ee42ade1eb (patch)
treeb41dae23b21ae6b45102f435d844d149bb857afd /drivers/iio
parentiio: use proper name for the R-Car SoC (diff)
downloadlinux-0a178fd7327e13ec7f8079a06a20b0ee42ade1eb.tar.xz
linux-0a178fd7327e13ec7f8079a06a20b0ee42ade1eb.zip
iio: adc: xilinx: Handle return value of clk_prepare_enable
clk_prepare_enable() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/xilinx-xadc-core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iio/adc/xilinx-xadc-core.c b/drivers/iio/adc/xilinx-xadc-core.c
index 56cf5907a5f0..4a60497a1f19 100644
--- a/drivers/iio/adc/xilinx-xadc-core.c
+++ b/drivers/iio/adc/xilinx-xadc-core.c
@@ -1204,7 +1204,10 @@ static int xadc_probe(struct platform_device *pdev)
ret = PTR_ERR(xadc->clk);
goto err_free_samplerate_trigger;
}
- clk_prepare_enable(xadc->clk);
+
+ ret = clk_prepare_enable(xadc->clk);
+ if (ret)
+ goto err_free_samplerate_trigger;
ret = xadc->ops->setup(pdev, indio_dev, irq);
if (ret)