Message ID | 20191005210449.3926-3-hdegoede@redhat.com (mailing list archive) |
---|---|
State | Mainlined |
Commit | f146b40ba1f0f689ca3cbd594a78b2424c459ddc |
Headers | show |
Series | Add platform_get_irq_byname_optional() and use it in the dwc3 driver | expand |
Hi, Hans de Goede <hdegoede@redhat.com> writes: > 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=205037 > Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Quoting Hans de Goede (2019-10-05 14:04:48) > 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=205037 > Signed-off-by: Hans de Goede <hdegoede@redhat.com> > --- Reviewed-by: Stephen Boyd <swboyd@chromium.org>
diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c index 726100d1ac0d..b1f76628b313 100644 --- a/drivers/usb/dwc3/drd.c +++ b/drivers/usb/dwc3/drd.c @@ -139,14 +139,14 @@ static int dwc3_otg_get_irq(struct dwc3 *dwc) struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); int irq; - irq = platform_get_irq_byname(dwc3_pdev, "otg"); + irq = platform_get_irq_byname_optional(dwc3_pdev, "otg"); if (irq > 0) goto out; if (irq == -EPROBE_DEFER) goto out; - irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3"); + irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3"); if (irq > 0) goto out; diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c index 8adb59f8e4f1..13c97ff21dba 100644 --- a/drivers/usb/dwc3/gadget.c +++ b/drivers/usb/dwc3/gadget.c @@ -3264,14 +3264,14 @@ static int dwc3_gadget_get_irq(struct dwc3 *dwc) struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); int irq; - irq = platform_get_irq_byname(dwc3_pdev, "peripheral"); + irq = platform_get_irq_byname_optional(dwc3_pdev, "peripheral"); if (irq > 0) goto out; if (irq == -EPROBE_DEFER) goto out; - irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3"); + irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3"); if (irq > 0) goto out; diff --git a/drivers/usb/dwc3/host.c b/drivers/usb/dwc3/host.c index 8deea8c91e03..534a49609779 100644 --- a/drivers/usb/dwc3/host.c +++ b/drivers/usb/dwc3/host.c @@ -16,14 +16,14 @@ static int dwc3_host_get_irq(struct dwc3 *dwc) struct platform_device *dwc3_pdev = to_platform_device(dwc->dev); int irq; - irq = platform_get_irq_byname(dwc3_pdev, "host"); + irq = platform_get_irq_byname_optional(dwc3_pdev, "host"); if (irq > 0) goto out; if (irq == -EPROBE_DEFER) goto out; - irq = platform_get_irq_byname(dwc3_pdev, "dwc_usb3"); + irq = platform_get_irq_byname_optional(dwc3_pdev, "dwc_usb3"); if (irq > 0) goto out;
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=205037 Signed-off-by: Hans de Goede <hdegoede@redhat.com> --- drivers/usb/dwc3/drd.c | 4 ++-- drivers/usb/dwc3/gadget.c | 4 ++-- drivers/usb/dwc3/host.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)