Commit f146b40b authored by Hans de Goede's avatar Hans de Goede Committed by Greg Kroah-Hartman

usb: dwc3: Switch to platform_get_irq_byname_optional()

The dwc3 code to get the "peripheral" / "host" / "otg" IRQ first tries
platform_get_irq_byname() and then falls back to the IRQ at index 0 if
the platform_get_irq_byname().

In this case we do not want platform_get_irq_byname() to print an error
on failure, so switch to platform_get_irq_byname_optional() instead which
does not print an error.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=205037Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Acked-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Link: https://lore.kernel.org/r/20191005210449.3926-3-hdegoede@redhat.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f1da567f
...@@ -139,14 +139,14 @@ static int dwc3_otg_get_irq(struct dwc3 *dwc) ...@@ -139,14 +139,14 @@ static int dwc3_otg_get_irq(struct dwc3 *dwc)
struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
int irq; int irq;
irq = platform_get_irq_byname(dwc3_pdev, "otg"); irq = platform_get_irq_byname_optional(dwc3_pdev, "otg");
if (irq > 0) if (irq > 0)
goto out; goto out;
if (irq == -EPROBE_DEFER) if (irq == -EPROBE_DEFER)
goto out; goto out;
irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3"); irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3");
if (irq > 0) if (irq > 0)
goto out; goto out;
......
...@@ -3264,14 +3264,14 @@ static int dwc3_gadget_get_irq(struct dwc3 *dwc) ...@@ -3264,14 +3264,14 @@ static int dwc3_gadget_get_irq(struct dwc3 *dwc)
struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
int irq; int irq;
irq = platform_get_irq_byname(dwc3_pdev, "peripheral"); irq = platform_get_irq_byname_optional(dwc3_pdev, "peripheral");
if (irq > 0) if (irq > 0)
goto out; goto out;
if (irq == -EPROBE_DEFER) if (irq == -EPROBE_DEFER)
goto out; goto out;
irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3"); irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3");
if (irq > 0) if (irq > 0)
goto out; goto out;
......
...@@ -16,14 +16,14 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) ...@@ -16,14 +16,14 @@ static int dwc3_host_get_irq(struct dwc3 *dwc)
struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); struct platform_device *dwc3_pdev = to_platform_device(dwc->dev);
int irq; int irq;
irq = platform_get_irq_byname(dwc3_pdev, "host"); irq = platform_get_irq_byname_optional(dwc3_pdev, "host");
if (irq > 0) if (irq > 0)
goto out; goto out;
if (irq == -EPROBE_DEFER) if (irq == -EPROBE_DEFER)
goto out; goto out;
irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3"); irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3");
if (irq > 0) if (irq > 0)
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment