diff options
author | Peter Chen <peter.chen@freescale.com> | 2013-10-21 23:13:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-29 19:43:37 -0400 |
commit | df101c531eb737915349a1c4b677da7db55eaf69 (patch) | |
tree | 161bd055f3adda1449e7e01de6df4dbe82a127c7 | |
parent | e55f7cd2467631980f749fb0aef197c06ce38d6a (diff) |
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>
-rw-r--r-- | drivers/usb/chipidea/host.c | 6 |
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) | |||
103 | if (hcd) { | 103 | if (hcd) { |
104 | usb_remove_hcd(hcd); | 104 | usb_remove_hcd(hcd); |
105 | usb_put_hcd(hcd); | 105 | usb_put_hcd(hcd); |
106 | if (ci->platdata->reg_vbus) | ||
107 | regulator_disable(ci->platdata->reg_vbus); | ||
106 | } | 108 | } |
107 | if (ci->platdata->reg_vbus) | ||
108 | regulator_disable(ci->platdata->reg_vbus); | ||
109 | } | 109 | } |
110 | 110 | ||
111 | 111 | ||
112 | void ci_hdrc_host_destroy(struct ci_hdrc *ci) | 112 | void ci_hdrc_host_destroy(struct ci_hdrc *ci) |
113 | { | 113 | { |
114 | if (ci->role == CI_ROLE_HOST) | 114 | if (ci->role == CI_ROLE_HOST && ci->hcd) |
115 | host_stop(ci); | 115 | host_stop(ci); |
116 | } | 116 | } |
117 | 117 | ||