mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-08 17:49:45 +00:00
iio: frequency: adf4350: disable reg and clk on error in adf4350_probe()
commit c8cc4cf60b
upstream.
Disable reg and clk when devm_gpiod_get_optional() fails in adf4350_probe().
Fixes:4a89d2f47ccd ("iio: adf4350: Convert to use GPIO descriptor")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210601142605.3613605-1-yangyingliang@huawei.com
Cc: <Stable@vger.kernel.org>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a6f7bf2652
commit
6534a5e0c2
1 changed files with 4 additions and 2 deletions
|
@ -563,8 +563,10 @@ static int adf4350_probe(struct spi_device *spi)
|
|||
|
||||
st->lock_detect_gpiod = devm_gpiod_get_optional(&spi->dev, NULL,
|
||||
GPIOD_IN);
|
||||
if (IS_ERR(st->lock_detect_gpiod))
|
||||
return PTR_ERR(st->lock_detect_gpiod);
|
||||
if (IS_ERR(st->lock_detect_gpiod)) {
|
||||
ret = PTR_ERR(st->lock_detect_gpiod);
|
||||
goto error_disable_reg;
|
||||
}
|
||||
|
||||
if (pdata->power_up_frequency) {
|
||||
ret = adf4350_set_freq(st, pdata->power_up_frequency);
|
||||
|
|
Loading…
Reference in a new issue