diff options
author | Venu Byravarasu <vbyravarasu@nvidia.com> | 2013-01-24 15:57:03 +0530 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-01-28 11:42:11 -0700 |
commit | ab137d04db5a4b32250ce5ef1b288ce6cf06adf6 (patch) | |
tree | e11f30d35f28c701b9c58508e06a92c81ec02c51 /drivers/usb/phy | |
parent | 40e8b3a690ec0ef574c458a991eb647e56683b7d (diff) |
usb: host: tegra: make use of PHY pointer of HCD
As pointer to PHY structure can be stored in struct usb_hcd
making use of it, to call Tegra PHY APIs.
Call to usb_phy_shutdown() is moved up in tegra_ehci_remove(),
so that to avoid dereferencing of hcd after its freed up.
Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Acked-by: Felipe Balbi <balbi@ti.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'drivers/usb/phy')
-rw-r--r-- | drivers/usb/phy/tegra_usb_phy.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/usb/phy/tegra_usb_phy.c b/drivers/usb/phy/tegra_usb_phy.c index d4657045b8b..5487d38481a 100644 --- a/drivers/usb/phy/tegra_usb_phy.c +++ b/drivers/usb/phy/tegra_usb_phy.c @@ -759,30 +759,38 @@ err0: } EXPORT_SYMBOL_GPL(tegra_usb_phy_open); -void tegra_usb_phy_preresume(struct tegra_usb_phy *phy) +void tegra_usb_phy_preresume(struct usb_phy *x) { + struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); + if (!phy->is_ulpi_phy) utmi_phy_preresume(phy); } EXPORT_SYMBOL_GPL(tegra_usb_phy_preresume); -void tegra_usb_phy_postresume(struct tegra_usb_phy *phy) +void tegra_usb_phy_postresume(struct usb_phy *x) { + struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); + if (!phy->is_ulpi_phy) utmi_phy_postresume(phy); } EXPORT_SYMBOL_GPL(tegra_usb_phy_postresume); -void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, +void tegra_ehci_phy_restore_start(struct usb_phy *x, enum tegra_usb_phy_port_speed port_speed) { + struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); + if (!phy->is_ulpi_phy) utmi_phy_restore_start(phy, port_speed); } EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_start); -void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy) +void tegra_ehci_phy_restore_end(struct usb_phy *x) { + struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); + if (!phy->is_ulpi_phy) utmi_phy_restore_end(phy); } |