Commit 6eca10a1 authored by Ruan Jinjie's avatar Ruan Jinjie Committed by Sebastian Reichel
Browse files

power: supply: 88pm860x_battery: 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: default avatarRuan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230731113959.1957820-1-ruanjinjie@huawei.com


Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 5b69b5f2
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -921,12 +921,12 @@ static int pm860x_battery_probe(struct platform_device *pdev)
		return -ENOMEM;

	info->irq_cc = platform_get_irq(pdev, 0);
	if (info->irq_cc <= 0)
		return -EINVAL;
	if (info->irq_cc < 0)
		return info->irq_cc;

	info->irq_batt = platform_get_irq(pdev, 1);
	if (info->irq_batt <= 0)
		return -EINVAL;
	if (info->irq_batt < 0)
		return info->irq_batt;

	info->chip = chip;
	info->i2c =