diff options
author | Ruan Jinjie <ruanjinjie@huawei.com> | 2023-07-27 16:16:07 +0300 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-07-29 18:23:45 +0300 |
commit | c09ddcdd4dd32ee9768dc233ead4b3d726f26d38 (patch) | |
tree | 8206bd2bdd3358111eea275c1788e15583fc2908 /drivers/iio/adc/bcm_iproc_adc.c | |
parent | 49d736313d0975ddeb156f4f59801da833f78b30 (diff) | |
download | linux-c09ddcdd4dd32ee9768dc233ead4b3d726f26d38.tar.xz |
iio: adc: fix the return value handle for platform_get_irq()
There is no possible for platform_get_irq() to return 0
and the return value of platform_get_irq() is more sensible
to show the error reason.
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230727131607.2897937-1-ruanjinjie@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Diffstat (limited to 'drivers/iio/adc/bcm_iproc_adc.c')
-rw-r--r-- | drivers/iio/adc/bcm_iproc_adc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c index 44e1e53ada72..0d6885413a7e 100644 --- a/drivers/iio/adc/bcm_iproc_adc.c +++ b/drivers/iio/adc/bcm_iproc_adc.c @@ -540,8 +540,8 @@ static int iproc_adc_probe(struct platform_device *pdev) } adc_priv->irqno = platform_get_irq(pdev, 0); - if (adc_priv->irqno <= 0) - return -ENODEV; + if (adc_priv->irqno < 0) + return adc_priv->irqno; ret = regmap_update_bits(adc_priv->regmap, IPROC_REGCTL2, IPROC_ADC_AUXIN_SCAN_ENA, 0); |