When the pointer of hcd is NULL, dwc3 driver will probe again. In this
case the notify sync function will issue "Bad mode in Synchronous Abort
handler detected" error if the extcon notify is not unregisted before
next probe. This patch add unregister extcon notify function and
unregister extcon notify when hcd is NULL.
Change-Id: Id55ce4280518e0c7e36a64133e38189bb4a7d29e
Signed-off-by: Meng Dongyang <daniel.meng@rock-chips.com>
if (!hcd) {
dev_err(dev, "fail to get drvdata hcd\n");
ret = -EPROBE_DEFER;
- goto err2;
+ goto err3;
}
if (hcd->state != HC_STATE_HALT) {
usb_remove_hcd(hcd->shared_hcd);
return ret;
+err3:
+ dwc3_rockchip_extcon_unregister(rockchip);
+
err2:
of_platform_depopulate(dev);