diff options
| author | Ruan Jinjie <ruanjinjie@huawei.com> | 2023-07-27 21:16:07 +0800 |
|---|---|---|
| committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-07-29 16:23:45 +0100 |
| commit | c09ddcdd4dd32ee9768dc233ead4b3d726f26d38 (patch) | |
| tree | 8206bd2bdd3358111eea275c1788e15583fc2908 /drivers/iio/adc/npcm_adc.c | |
| parent | 49d736313d0975ddeb156f4f59801da833f78b30 (diff) | |
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/npcm_adc.c')
| -rw-r--r-- | drivers/iio/adc/npcm_adc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/iio/adc/npcm_adc.c b/drivers/iio/adc/npcm_adc.c index ba4cd8f49f66..3d9207c160eb 100644 --- a/drivers/iio/adc/npcm_adc.c +++ b/drivers/iio/adc/npcm_adc.c @@ -244,8 +244,8 @@ static int npcm_adc_probe(struct platform_device *pdev) info->adc_sample_hz = clk_get_rate(info->adc_clk) / ((div + 1) * 2); irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - ret = -EINVAL; + if (irq < 0) { + ret = irq; goto err_disable_clk; } |
