提交 df101c53 编写于 作者: P Peter Chen 提交者: Greg Kroah-Hartman

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: NPeter Chen <peter.chen@freescale.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 e55f7cd2
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册