diff options
author | Ruan Jinjie <ruanjinjie@huawei.com> | 2023-07-31 19:27:55 +0800 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2023-08-08 15:36:58 +0200 |
commit | 5140b46caf337bbad0803a24caa17e4158411d5c (patch) | |
tree | d3ca27326e84d7dfca8677747b9854b2ed00d1f4 /drivers/i2c | |
parent | 55f5cd6148b220c265483e5ace653f8686df3957 (diff) | |
download | linux-stable-5140b46caf337bbad0803a24caa17e4158411d5c.tar.gz linux-stable-5140b46caf337bbad0803a24caa17e4158411d5c.tar.bz2 linux-stable-5140b46caf337bbad0803a24caa17e4158411d5c.zip |
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-stm32f7.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index e897d9101434..579b30581725 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -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"); |