Skip to contentSkip to conversation

spi: synquacer: drop redundant IRQ zero checks

PATCH New Felix Gu 1 participant 1 message Nov 20

Subsystems (2)
lore
Share & tools
lore

Felix Gu

author
#0 lore raw

PATCH 1/1 spi: synquacer: drop redundant IRQ zero checks

platform_get_irq() returns a positive IRQ number on success and a negative errno on failure. It already converts IRQ 0 to -EINVAL.

Check only for negative returns when looking up the RX and TX IRQs.

---
 drivers/spi/spi-synquacer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-synquacer.c +2 -2
index 6d0cd11637b5..6e1412008ea0 100644
@@ -667,7 +667,7 @@ static int synquacer_spi_probe(struct platform_device *pdev)
 	host->num_chipselect = SYNQUACER_HSSPI_NUM_CHIP_SELECT;
 
 	rx_irq = platform_get_irq(pdev, 0);
-	if (rx_irq <= 0) {
+	if (rx_irq < 0) {
 		ret = rx_irq;
 		goto disable_clk;
 	}
@@ -681,7 +681,7 @@ static int synquacer_spi_probe(struct platform_device *pdev)
 	}
 
 	tx_irq = platform_get_irq(pdev, 1);
-	if (tx_irq <= 0) {
+	if (tx_irq < 0) {
 		ret = tx_irq;
 		goto disable_clk;
 	}

---
base-commit: adcad7f4e6332cff3d6d7165f41584899f598534
change-id: 20261121-synquacer-fbdf1dac2165

Best regards,

Signature · 1 line
Felix Gu <[email protected]>