mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
staging: iio: ad9834: add a check for devm_clk_get
[ Upstream commit a96de139301385e5992768c0f60240ddfbb33325 ] 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:
parent
5e1d763c38
commit
699aab8bb6
1 changed files with 4 additions and 0 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue