]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
usb: udc: dwc3: Fold dwc3_uboot_handle_interrupt into dm_usb_gadget_handle_interrupts
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 17 Mar 2024 04:42:53 +0000 (05:42 +0100)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Tue, 2 Apr 2024 07:08:07 +0000 (09:08 +0200)
The only call site of dwc3_uboot_handle_interrupt() is the
dm_usb_gadget_handle_interrupts(), fold the former into the
later. This makes dwc3_uboot_handle_interrupt() unavailable
to be called from board code as well.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Tested-by: Mattijs Korpershoek <mkorpershoek@baylibre.com> # vim3
Link: https://lore.kernel.org/r/20240317044357.547037-2-marek.vasut+renesas@mailbox.org
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/usb/dwc3/core.c
include/dwc3-uboot.h

index 09737be9a9c18d4776768f7b519ca40a8f07f4f0..96e850b7170f346051f46e30462551bbe7c11a36 100644 (file)
@@ -988,18 +988,27 @@ MODULE_AUTHOR("Felipe Balbi <balbi@ti.com>");
 MODULE_LICENSE("GPL v2");
 MODULE_DESCRIPTION("DesignWare USB3 DRD Controller Driver");
 
+#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
+__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
+{
+       return 1;
+}
+
 /**
- * dwc3_uboot_handle_interrupt - handle dwc3 core interrupt
+ * dm_usb_gadget_handle_interrupts - handle dwc3 core interrupt
  * @dev: device of this controller
  *
  * Invokes dwc3 gadget interrupts.
  *
  * Generally called from board file.
  */
-void dwc3_uboot_handle_interrupt(struct udevice *dev)
+int dm_usb_gadget_handle_interrupts(struct udevice *dev)
 {
        struct dwc3 *dwc = NULL;
 
+       if (!dwc3_uboot_interrupt_status(dev))
+               return 0;
+
        list_for_each_entry(dwc, &dwc3_list, list) {
                if (dwc->dev != dev)
                        continue;
@@ -1007,20 +1016,6 @@ void dwc3_uboot_handle_interrupt(struct udevice *dev)
                dwc3_gadget_uboot_handle_interrupt(dwc);
                break;
        }
-}
-
-#if !CONFIG_IS_ENABLED(DM_USB_GADGET)
-__weak int dwc3_uboot_interrupt_status(struct udevice *dev)
-{
-       return 1;
-}
-
-int dm_usb_gadget_handle_interrupts(struct udevice *dev)
-{
-       if (!dwc3_uboot_interrupt_status(dev))
-               return 0;
-
-       dwc3_uboot_handle_interrupt(dev);
 
        return 0;
 }
index 5f13f5bcf40fc7ad326791f34cc0e4c3caba630e..3689d60ae7f0f33ab77d56e2cfb6050c12ad481a 100644 (file)
@@ -45,7 +45,6 @@ struct dwc3_device {
 int dwc3_uboot_init(struct dwc3_device *dev);
 void dwc3_uboot_exit(int index);
 int dwc3_uboot_interrupt_status(struct udevice *dev);
-void dwc3_uboot_handle_interrupt(struct udevice *dev);
 
 struct phy;
 #if CONFIG_IS_ENABLED(PHY) && CONFIG_IS_ENABLED(DM_USB)