Skip to contentSkip to conversation

usb: xhci: tegra: Propagate errors from optional IRQ lookup

PATCH New [email protected] 1 participant 1 message Aug 7

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 usb: xhci: tegra: Propagate errors from optional IRQ lookup

From: bui duc phuc <[email protected]>

platform_get_irq_optional() returns a positive IRQ number on success or a negative error code on failure. For an optional IRQ, -ENXIO indicates that no IRQ is available, while other errors should be propagated.

Propagate errors such as -EPROBE_DEFER and -EINVAL instead of continuing probe without the IRQ.

---

Links v1:
https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Update the commit message and error handling.
- Propagate all errors from platform_get_irq_optional() except -ENXIO, instead of only handling -EPROBE_DEFER.

 drivers/usb/host/xhci-tegra.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-tegra.c +4 -1
index e7e6d569f1db..d7ae279acdf0 100644
@@ -1571,8 +1571,11 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xu
 		struct irq_data *data;
 
 		tegra->wake_irqs[i] = platform_get_irq_optional(pdev, i + WAKE_IRQ_START_INDEX);
-		if (tegra->wake_irqs[i] < 0)
+		if (tegra->wake_irqs[i] < 0) {
+			if (tegra->wake_irqs[i] != -ENXIO)
+				return tegra->wake_irqs[i];
 			break;
+		}
 
 		data = irq_get_irq_data(tegra->wake_irqs[i]);
 		if (!data) {
Signature · 1 line
2.43.0