summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorPeter Chen2013-10-22 05:13:41 +0200
committerGreg Kroah-Hartman2013-10-30 00:43:37 +0100
commitdf101c531eb737915349a1c4b677da7db55eaf69 (patch)
tree161bd055f3adda1449e7e01de6df4dbe82a127c7 /drivers/usb
parentusb: ohci: remove ep93xx bus glue platform driver (diff)
downloadkernel-qcow2-linux-df101c531eb737915349a1c4b677da7db55eaf69.tar.gz
kernel-qcow2-linux-df101c531eb737915349a1c4b677da7db55eaf69.tar.xz
kernel-qcow2-linux-df101c531eb737915349a1c4b677da7db55eaf69.zip
usb: chipidea: host: more enhancement when ci->hcd is NULL
Like http://marc.info/?l=linux-usb&m=138200449428874&w=2 said: two more things are needed to be done: - If host_start fails, the host_stop should not be called, so we add check that ci->hcd is not NULL. - if the host_start fails at the beginning, we need to consider regulator mismatch issue. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/chipidea/host.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index 64d7a6d9a1ad..59e6020ea753 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -103,15 +103,15 @@ static void host_stop(struct ci_hdrc *ci)
if (hcd) {
usb_remove_hcd(hcd);
usb_put_hcd(hcd);
+ if (ci->platdata->reg_vbus)
+ regulator_disable(ci->platdata->reg_vbus);
}
- if (ci->platdata->reg_vbus)
- regulator_disable(ci->platdata->reg_vbus);
}
void ci_hdrc_host_destroy(struct ci_hdrc *ci)
{
- if (ci->role == CI_ROLE_HOST)
+ if (ci->role == CI_ROLE_HOST && ci->hcd)
host_stop(ci);
}