staging: iio: ad9834: add a check for devm_clk_get

ad9834_probe misses a check for devm_clk_get and may cause problems.
Add a check like what ad9832 does to fix it.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
Chuhong Yuan 2019-10-16 22:25:40 +08:00 committed by Jonathan Cameron
parent d26c9abeed
commit a96de13930
1 changed files with 4 additions and 0 deletions

View File

@ -417,6 +417,10 @@ static int ad9834_probe(struct spi_device *spi)
st = iio_priv(indio_dev);
mutex_init(&st->lock);
st->mclk = devm_clk_get(&spi->dev, NULL);
if (IS_ERR(st->mclk)) {
ret = PTR_ERR(st->mclk);
goto error_disable_reg;
}
ret = clk_prepare_enable(st->mclk);
if (ret) {