[PATCH 1/3] USB: ehci-hub: let port_power() override the ehci_port_power()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since commit 11a7e5940514 ("usb: ehci: add ehci_port_power interface")
drivers can add a port_power() override callback. Currently the
ChipIdea host driver is the only one using the callback to support gpio
controlled vbus enable/disable. Then commit 6adb9b7b5fb6 ("usb: chipidea:
add a flag for turn on vbus early for host") and commit 659459174188
("usb: chipidea: host: turn on vbus before add hcd if early vbus on is
required") adding a workaround to address the current core behaviour.
Since that the gpio based port-power is broken which was the only
use-case for this callback.

We should let the override callback override the core behaviour to avoid
adding local workarounds needed to address the core behaviour.

Signed-off-by: Marco Felsch <m.felsch@xxxxxxxxxxxxxx>
---
 drivers/usb/host/ehci-hub.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c
index ce0eaf7d7c12..12b8c9055ab3 100644
--- a/drivers/usb/host/ehci-hub.c
+++ b/drivers/usb/host/ehci-hub.c
@@ -1338,13 +1338,13 @@ static int ehci_port_power(struct ehci_hcd *ehci, int portnum, bool enable)
 	u32 __iomem *status_reg = &ehci->regs->port_status[portnum];
 	u32 temp = ehci_readl(ehci, status_reg) & ~PORT_RWC_BITS;
 
+	if (hcd->driver->port_power)
+		return hcd->driver->port_power(hcd, portnum, enable);
+
 	if (enable)
 		ehci_writel(ehci, temp | PORT_POWER, status_reg);
 	else
 		ehci_writel(ehci, temp & ~PORT_POWER, status_reg);
 
-	if (hcd->driver->port_power)
-		hcd->driver->port_power(hcd, portnum, enable);
-
 	return 0;
 }
-- 
2.20.1




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux