mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
staging: iio: ad9834: add a check for devm_clk_get
[ Upstream commit a96de13930 ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5e1d763c38
commit
699aab8bb6
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user