Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iio: adc: cpcap: fix incorrect validation
Function platform_get_irq_byname() returns a negative error code on failure, and a zero or positive number on success. However, in function cpcap_adc_probe(), positive IRQ numbers are also taken as error cases. Use "if (ddata->irq < 0)" instead of "if (!ddata->irq)" to validate the return value of platform_get_irq_byname(). Signed-off-by: Pan Bian <[email protected]> Fixes: 25ec249 ("iio: adc: cpcap: Add minimal support for CPCAP PMIC ADC") Reviewed-by: Sebastian Reichel <[email protected]> Acked-by: Tony Lindgren <[email protected]> Cc: <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
- Loading branch information