i2c: stm32: Do not check for 0 return after calling platform_get_irq()

It is not possible for platform_get_irq() to return 0. Use the
return value from platform_get_irq().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Acked-by: Alain Volmat <alain.volmat@foss.st.com>
Link: https://lore.kernel.org/r/20230731112755.1943630-1-ruanjinjie@huawei.com
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
This commit is contained in:
Ruan Jinjie 2023-07-31 19:27:55 +08:00 committed by Andi Shyti
parent 55f5cd6148
commit 5140b46caf

View File

@ -2121,12 +2121,12 @@ static int stm32f7_i2c_probe(struct platform_device *pdev)
phy_addr = (dma_addr_t)res->start;
irq_event = platform_get_irq(pdev, 0);
if (irq_event <= 0)
return irq_event ? : -ENOENT;
if (irq_event < 0)
return irq_event;
irq_error = platform_get_irq(pdev, 1);
if (irq_error <= 0)
return irq_error ? : -ENOENT;
if (irq_error < 0)
return irq_error;
i2c_dev->wakeup_src = of_property_read_bool(pdev->dev.of_node,
"wakeup-source");