From: Meng Dongyang Date: Sun, 25 Sep 2016 07:48:29 +0000 (+0800) Subject: usb: dwc3: unregister extcon notify if probe fail X-Git-Tag: firefly_0821_release~1482 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ad23b5c8bd46d9b4ce049e8c6fcec4834940f25b;hp=63e8d019d458d6922b39003f4f09124d237cc83f;p=firefly-linux-kernel-4.4.55.git 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 --- 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);