power: supply: cpcap-charger: fix incorrect return value check
authorPan Bian <bianpan2016@163.com>
Sun, 12 Nov 2017 15:52:02 +0000 (23:52 +0800)
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>
Mon, 13 Nov 2017 10:56:12 +0000 (11:56 +0100)
commit838c8afa67f98014970c9f56107805e767ed87ad
tree60faf31c3ca8e32304d500efbe2ba975a693746f
parent33a7067732cf1b86b5dc672cfa9bbc15460117e5
power: supply: cpcap-charger: fix incorrect return value check

Function platform_get_irq_byname() returns a negative error code on
failure, and a zero or positive number on success. However, in function
cpcap_usb_init_irq(), positive IRQ numbers are also taken as error
cases. Use "if (irq < 0)" instead of "if (!irq)" to validate the return
value of platform_get_irq_byname().

Signed-off-by: Pan Bian <bianpan2016@163.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
drivers/power/supply/cpcap-charger.c