usb: host: fix tegra_ehci_remove() warnings
Venu Byravarasu [Wed, 8 Aug 2012 11:59:36 +0000 (16:59 +0530)]
usb_put_hcd calls hcd_release which frees up memory allocated
for hcd. As iounmap is called after usb_put_hcd and it is trying
to access hcd->regs, getting warning messages during unload of
USB. Hence fixing it.

bug 1023362

Change-Id: Ic339395edad9a76a9eeae290eff3517d2c714477
Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-on: http://git-master/r/122088
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Tested-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
(cherry picked from commit 7b3a327acb3a63fddc14f2b3ecd19a7ea8f41b3e)
Reviewed-on: http://git-master/r/123489
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

drivers/usb/host/ehci-tegra.c

index e04e824..af6fa87 100644 (file)
@@ -551,10 +551,10 @@ static int tegra_ehci_remove(struct platform_device *pdev)
                tegra_usb_phy_power_on(tegra->phy);
 
        usb_remove_hcd(hcd);
-       usb_put_hcd(hcd);
        tegra_usb_phy_power_off(tegra->phy);
        tegra_usb_phy_close(tegra->phy);
        iounmap(hcd->regs);
+       usb_put_hcd(hcd);
 
        return 0;
 }