diff mbox series

[-next,2/2] soc: xilinx: Do not check for 0 return after calling platform_get_irq()

Message ID 20230803104807.814005-3-ruanjinjie@huawei.com (mailing list archive)
State Handled Elsewhere
Headers show
Series soc: Do not check for 0 return after calling platform_get_irq() | expand

Commit Message

Jinjie Ruan Aug. 3, 2023, 10:48 a.m. UTC
There is no possible for platform_get_irq() to
return 0. Use the return value from platform_get_irq().

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
---
 drivers/soc/xilinx/zynqmp_power.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Michal Simek Aug. 4, 2023, 6:53 a.m. UTC | #1
On 8/3/23 12:48, Ruan Jinjie wrote:
> There is no possible for platform_get_irq() to
> return 0. Use the return value from platform_get_irq().
> 
> Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
> ---
>   drivers/soc/xilinx/zynqmp_power.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
> index 641dcc958911..eddfc8141a42 100644
> --- a/drivers/soc/xilinx/zynqmp_power.c
> +++ b/drivers/soc/xilinx/zynqmp_power.c
> @@ -242,8 +242,8 @@ static int zynqmp_pm_probe(struct platform_device *pdev)
>   		}
>   	} else if (of_property_present(pdev->dev.of_node, "interrupts")) {
>   		irq = platform_get_irq(pdev, 0);
> -		if (irq <= 0)
> -			return -ENXIO;
> +		if (irq < 0)
> +			return irq;
>   
>   		ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
>   						zynqmp_pm_isr,

Applied this 2/2 patch.

Thanks,
Michal
diff mbox series

Patch

diff --git a/drivers/soc/xilinx/zynqmp_power.c b/drivers/soc/xilinx/zynqmp_power.c
index 641dcc958911..eddfc8141a42 100644
--- a/drivers/soc/xilinx/zynqmp_power.c
+++ b/drivers/soc/xilinx/zynqmp_power.c
@@ -242,8 +242,8 @@  static int zynqmp_pm_probe(struct platform_device *pdev)
 		}
 	} else if (of_property_present(pdev->dev.of_node, "interrupts")) {
 		irq = platform_get_irq(pdev, 0);
-		if (irq <= 0)
-			return -ENXIO;
+		if (irq < 0)
+			return irq;
 
 		ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
 						zynqmp_pm_isr,