]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
staging: iio: ad9834: add a check for devm_clk_get
authorChuhong Yuan <hslester96@gmail.com>
Wed, 16 Oct 2019 14:25:40 +0000 (22:25 +0800)
committerKhalid Elmously <khalid.elmously@canonical.com>
Wed, 29 Jan 2020 05:00:31 +0000 (00:00 -0500)
BugLink: https://bugs.launchpad.net/bugs/1860490
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/staging/iio/frequency/ad9834.c

index 038d6732c3fdbb15ee98c29e04cfef8c7a2091aa..23026978a5a5f5f12b42508551ab1d0b875127df 100644 (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) {