Commit c4a0bbb
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>1 parent 2ea659a commit c4a0bbb
1 file changed
+21
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
821 | | - | |
| 821 | + | |
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| |||
977 | 977 | | |
978 | 978 | | |
979 | 979 | | |
980 | | - | |
981 | | - | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
982 | 986 | | |
983 | 987 | | |
984 | 988 | | |
985 | 989 | | |
986 | | - | |
987 | | - | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
988 | 996 | | |
989 | 997 | | |
990 | 998 | | |
991 | 999 | | |
992 | 1000 | | |
993 | | - | |
| 1001 | + | |
994 | 1002 | | |
995 | 1003 | | |
996 | 1004 | | |
997 | 1005 | | |
998 | 1006 | | |
999 | 1007 | | |
1000 | | - | |
| 1008 | + | |
1001 | 1009 | | |
1002 | 1010 | | |
1003 | 1011 | | |
| |||
1067 | 1075 | | |
1068 | 1076 | | |
1069 | 1077 | | |
1070 | | - | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
1071 | 1084 | | |
1072 | 1085 | | |
1073 | 1086 | | |
| |||
0 commit comments