diff options
author | Venu Byravarasu <vbyravarasu@nvidia.com> | 2013-01-24 05:27:03 -0500 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2013-01-28 13:42:11 -0500 |
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 d4657045b8b1..5487d38481af 100644 --- a/drivers/usb/phy/tegra_usb_phy.c +++ b/drivers/usb/phy/tegra_usb_phy.c | |||
@@ -759,30 +759,38 @@ err0: | |||
759 | } | 759 | } |
760 | EXPORT_SYMBOL_GPL(tegra_usb_phy_open); | 760 | EXPORT_SYMBOL_GPL(tegra_usb_phy_open); |
761 | 761 | ||
762 | void tegra_usb_phy_preresume(struct tegra_usb_phy *phy) | 762 | void tegra_usb_phy_preresume(struct usb_phy *x) |
763 | { | 763 | { |
764 | struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); | ||
765 | |||
764 | if (!phy->is_ulpi_phy) | 766 | if (!phy->is_ulpi_phy) |
765 | utmi_phy_preresume(phy); | 767 | utmi_phy_preresume(phy); |
766 | } | 768 | } |
767 | EXPORT_SYMBOL_GPL(tegra_usb_phy_preresume); | 769 | EXPORT_SYMBOL_GPL(tegra_usb_phy_preresume); |
768 | 770 | ||
769 | void tegra_usb_phy_postresume(struct tegra_usb_phy *phy) | 771 | void tegra_usb_phy_postresume(struct usb_phy *x) |
770 | { | 772 | { |
773 | struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); | ||
774 | |||
771 | if (!phy->is_ulpi_phy) | 775 | if (!phy->is_ulpi_phy) |
772 | utmi_phy_postresume(phy); | 776 | utmi_phy_postresume(phy); |
773 | } | 777 | } |
774 | EXPORT_SYMBOL_GPL(tegra_usb_phy_postresume); | 778 | EXPORT_SYMBOL_GPL(tegra_usb_phy_postresume); |
775 | 779 | ||
776 | void tegra_ehci_phy_restore_start(struct tegra_usb_phy *phy, | 780 | void tegra_ehci_phy_restore_start(struct usb_phy *x, |
777 | enum tegra_usb_phy_port_speed port_speed) | 781 | enum tegra_usb_phy_port_speed port_speed) |
778 | { | 782 | { |
783 | struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); | ||
784 | |||
779 | if (!phy->is_ulpi_phy) | 785 | if (!phy->is_ulpi_phy) |
780 | utmi_phy_restore_start(phy, port_speed); | 786 | utmi_phy_restore_start(phy, port_speed); |
781 | } | 787 | } |
782 | EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_start); | 788 | EXPORT_SYMBOL_GPL(tegra_ehci_phy_restore_start); |
783 | 789 | ||
784 | void tegra_ehci_phy_restore_end(struct tegra_usb_phy *phy) | 790 | void tegra_ehci_phy_restore_end(struct usb_phy *x) |
785 | { | 791 | { |
792 | struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); | ||
793 | |||
786 | if (!phy->is_ulpi_phy) | 794 | if (!phy->is_ulpi_phy) |
787 | utmi_phy_restore_end(phy); | 795 | utmi_phy_restore_end(phy); |
788 | } | 796 | } |