summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Yadav <arvind.yadav.cs@gmail.com>2017-05-26 12:07:41 +0530
committerJonathan Cameron <jic23@kernel.org>2017-06-03 09:55:23 +0100
commit0a178fd7327e13ec7f8079a06a20b0ee42ade1eb (patch)
treeb41dae23b21ae6b45102f435d844d149bb857afd
parentec183bf8b5e5f950907705950cf3fd058b17ad1a (diff)
downloadop-kernel-dev-0a178fd7327e13ec7f8079a06a20b0ee42ade1eb.zip
op-kernel-dev-0a178fd7327e13ec7f8079a06a20b0ee42ade1eb.tar.gz
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>
-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 56cf590..4a60497 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)
OpenPOWER on IntegriCloud