]> git.itanic.dy.fi Git - linux-stable/commit
usb: chipidea: properly handle host or gadget initialization failure
authorJisheng Zhang <jszhang@marvell.com>
Wed, 26 Apr 2017 08:59:34 +0000 (16:59 +0800)
committerPeter Chen <peter.chen@nxp.com>
Thu, 18 May 2017 00:55:22 +0000 (08:55 +0800)
commitc4a0bbbdb7f6e3c37fa6deb3ef28c5ed99da6175
tree1830586f3287e1a393115c05211103ee986185f5
parent2ea659a9ef488125eb46da6eb571de5eae5c43f6
usb: chipidea: properly handle host or gadget initialization failure

If ci_hdrc_host_init() or ci_hdrc_gadget_init() returns error and the
error != -ENXIO, as Peter pointed out, "it stands for initialization
for host or gadget has failed", so we'd better return failure rather
continue.

And before destroying the otg, i.e ci_hdrc_otg_destroy(ci), we should
also check ci->roles[CI_ROLE_GADGET].

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/chipidea/core.c