From ad23b5c8bd46d9b4ce049e8c6fcec4834940f25b Mon Sep 17 00:00:00 2001 From: Meng Dongyang Date: Sun, 25 Sep 2016 15:48:29 +0800 Subject: [PATCH] usb: dwc3: unregister extcon notify if probe fail 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 --- drivers/usb/dwc3/dwc3-rockchip.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/dwc3-rockchip.c b/drivers/usb/dwc3/dwc3-rockchip.c index 6f549b58b209..656a00c72ab1 100644 --- a/drivers/usb/dwc3/dwc3-rockchip.c +++ b/drivers/usb/dwc3/dwc3-rockchip.c @@ -335,7 +335,7 @@ static int dwc3_rockchip_probe(struct platform_device *pdev) 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); @@ -354,6 +354,9 @@ static int dwc3_rockchip_probe(struct platform_device *pdev) return ret; +err3: + dwc3_rockchip_extcon_unregister(rockchip); + err2: of_platform_depopulate(dev); -- 2.34.1