usb: xhci: tegra: Propagate errors from optional IRQ lookup
Subsystems (3)
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.
Signed-off-by bui duc phuc <[email protected]>
---
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
@@ -1571,8 +1571,11 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xustruct 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