usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs
Subsystems (3)
PATCH 1/1 usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs
From: Wayne Chang <[email protected]>
When some wake IRQs are disabled in the device tree, the corresponding interrupt entries are removed from DT. In such cases, the driver currently calls platform_get_irq(), which returns -ENXIO and logs an error like:
tegra-xusb 3610000.usb: error -ENXIO: IRQ index 2 not found
However, not all wake IRQs are mandatory. The hardware can operate normally even if some wake sources are not defined in DT. To avoid this false alarm and allow missing wake IRQs gracefully, use platform_get_irq_optional() instead of platform_get_irq().
--- drivers/usb/host/xhci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-tegra.c +1 -1
@@ -1563,7 +1563,7 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xufor (i =0 ; i < tegra->soc->max_num_wakes; i++) {struct irq_data *data; - tegra->wake_irqs[i] =platform_get_irq (pdev, i +WAKE_IRQ_START_INDEX ); + tegra->wake_irqs[i] =platform_get_irq_optional (pdev, i +WAKE_IRQ_START_INDEX );if (tegra->wake_irqs[i] <0 )break ;
Signature · 1 line
2.43.0
Quoted 26 lines · Wei-Cheng Chen
From: Wayne Chang <[email protected]>
When some wake IRQs are disabled in the device tree, the corresponding interrupt entries are removed from DT. In such cases, the driver currently calls
platform_get_irq(), which returns-ENXIOand logs an error like:tegra-xusb 3610000.usb: error
-ENXIO: IRQ index 2 not foundHowever, not all wake IRQs are mandatory. The hardware can operate normally even if some wake sources are not defined in DT. To avoid this false alarm and allow missing wake IRQs gracefully, use
platform_get_irq_optional()instead ofplatform_get_irq().Fixes 5df186e2ef11 ("usb: xhci: tegra: Support USB wakeup function for Tegra234")Signed-off-by Wayne Chang <[email protected]>Signed-off-by Wei-Cheng Chen <[email protected]>--- drivers/usb/host/xhci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/usb/host/xhci-tegra.c +0
-0
drivers/usb/host/xhci-tegra.c static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xu · line 1569
Quoted 8 lines
drivers/usb/host/xhci-tegra.c +1
-1@@ -1563,7 +1563,7 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xufor (i =0 ; i < tegra->soc->max_num_wakes; i++) {struct irq_data *data; - tegra->wake_irqs[i] =platform_get_irq (pdev, i +WAKE_IRQ_START_INDEX ); + tegra->wake_irqs[i] =platform_get_irq_optional (pdev, i +WAKE_IRQ_START_INDEX );if (tegra->wake_irqs[i] <0 )break ;
Thanks!
Jon
Signature · 1 line
nvpublic
PATCH v2 1/1 usb: host: xhci-tegra: Use platform_get_irq_optional() for wake IRQs
In reply to Wei-Cheng ChenFrom: Wayne Chang <[email protected]>
When some wake IRQs are disabled in the device tree, the corresponding interrupt entries are removed from DT. In such cases, the driver currently calls platform_get_irq(), which returns -ENXIO and logs an error like:
tegra-xusb 3610000.usb: error -ENXIO: IRQ index 2 not found
However, not all wake IRQs are mandatory. The hardware can operate normally even if some wake sources are not defined in DT. To avoid this false alarm and allow missing wake IRQs gracefully, use platform_get_irq_optional() instead of platform_get_irq().
---
V1 -> V2:
- Added Reviewed-by and Tested-by tags from Jon Hunter.
- Added Cc: [email protected] tag to ensure backporting.
--- drivers/usb/host/xhci-tegra.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-tegra.c +1 -1
@@ -1563,7 +1563,7 @@ static int tegra_xusb_setup_wakeup(struct platform_device *pdev, struct tegra_xufor (i =0 ; i < tegra->soc->max_num_wakes; i++) {struct irq_data *data; - tegra->wake_irqs[i] =platform_get_irq (pdev, i +WAKE_IRQ_START_INDEX ); + tegra->wake_irqs[i] =platform_get_irq_optional (pdev, i +WAKE_IRQ_START_INDEX );if (tegra->wake_irqs[i] <0 )break ;
Signature · 1 line
2.43.0