diff options
author | Tuomas Tynkkynen <ttynkkynen@nvidia.com> | 2014-07-03 21:09:39 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-09 19:25:46 -0400 |
commit | 3e346d41bfcdf803284b06ef6e4bf13fa2b86277 (patch) | |
tree | 6b3fb6c037dfd6a4e66ff651b3ea80e33c231630 /drivers/usb/phy/phy-tegra-usb.c | |
parent | a47cc24cd1e5a55ef0b240180ce7ec6a9afc939d (diff) |
USB: PHY: tegra: Call tegra_usb_phy_close only on device removal
tegra_usb_phy_close() is supposed to undo the effects of
tegra_usb_phy_init(). It is also currently added as the USB PHY shutdown
callback, which is wrong, since tegra_usb_phy_init() is only called
during probing wheras the shutdown callback can get called multiple
times. This then leads to warnings about unbalanced regulator_disable if
the EHCI driver is unbound and bound again at runtime.
Signed-off-by: Tuomas Tynkkynen <ttynkkynen@nvidia.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/phy/phy-tegra-usb.c')
-rw-r--r-- | drivers/usb/phy/phy-tegra-usb.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/usb/phy/phy-tegra-usb.c b/drivers/usb/phy/phy-tegra-usb.c index 467a5e152afa..50dc69e1666f 100644 --- a/drivers/usb/phy/phy-tegra-usb.c +++ b/drivers/usb/phy/phy-tegra-usb.c | |||
@@ -685,10 +685,8 @@ static int ulpi_phy_power_off(struct tegra_usb_phy *phy) | |||
685 | return gpio_direction_output(phy->reset_gpio, 0); | 685 | return gpio_direction_output(phy->reset_gpio, 0); |
686 | } | 686 | } |
687 | 687 | ||
688 | static void tegra_usb_phy_close(struct usb_phy *x) | 688 | static void tegra_usb_phy_close(struct tegra_usb_phy *phy) |
689 | { | 689 | { |
690 | struct tegra_usb_phy *phy = container_of(x, struct tegra_usb_phy, u_phy); | ||
691 | |||
692 | if (!IS_ERR(phy->vbus)) | 690 | if (!IS_ERR(phy->vbus)) |
693 | regulator_disable(phy->vbus); | 691 | regulator_disable(phy->vbus); |
694 | 692 | ||
@@ -1060,14 +1058,13 @@ static int tegra_usb_phy_probe(struct platform_device *pdev) | |||
1060 | if (err < 0) | 1058 | if (err < 0) |
1061 | return err; | 1059 | return err; |
1062 | 1060 | ||
1063 | tegra_phy->u_phy.shutdown = tegra_usb_phy_close; | ||
1064 | tegra_phy->u_phy.set_suspend = tegra_usb_phy_suspend; | 1061 | tegra_phy->u_phy.set_suspend = tegra_usb_phy_suspend; |
1065 | 1062 | ||
1066 | platform_set_drvdata(pdev, tegra_phy); | 1063 | platform_set_drvdata(pdev, tegra_phy); |
1067 | 1064 | ||
1068 | err = usb_add_phy_dev(&tegra_phy->u_phy); | 1065 | err = usb_add_phy_dev(&tegra_phy->u_phy); |
1069 | if (err < 0) { | 1066 | if (err < 0) { |
1070 | tegra_usb_phy_close(&tegra_phy->u_phy); | 1067 | tegra_usb_phy_close(tegra_phy); |
1071 | return err; | 1068 | return err; |
1072 | } | 1069 | } |
1073 | 1070 | ||
@@ -1079,6 +1076,7 @@ static int tegra_usb_phy_remove(struct platform_device *pdev) | |||
1079 | struct tegra_usb_phy *tegra_phy = platform_get_drvdata(pdev); | 1076 | struct tegra_usb_phy *tegra_phy = platform_get_drvdata(pdev); |
1080 | 1077 | ||
1081 | usb_remove_phy(&tegra_phy->u_phy); | 1078 | usb_remove_phy(&tegra_phy->u_phy); |
1079 | tegra_usb_phy_close(tegra_phy); | ||
1082 | 1080 | ||
1083 | return 0; | 1081 | return 0; |
1084 | } | 1082 | } |