mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
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:
parent
55f5cd6148
commit
5140b46caf
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user