usb: mtu3: check return value of devm_extcon_register_notifier()

Check the return value of devm_extcon_register_notifier() and
add error handling.

Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Chunfeng Yun
2019-03-21 10:53:39 +08:00
committed by Greg Kroah-Hartman
parent bb31b35251
commit 03d8bfc130
2 changed files with 16 additions and 5 deletions

View File

@@ -401,7 +401,11 @@ static int mtu3_probe(struct platform_device *pdev)
goto gadget_exit;
}
ssusb_otg_switch_init(ssusb);
ret = ssusb_otg_switch_init(ssusb);
if (ret) {
dev_err(dev, "failed to initialize switch\n");
goto host_exit;
}
break;
default:
dev_err(dev, "unsupported mode: %d\n", ssusb->dr_mode);
@@ -411,6 +415,8 @@ static int mtu3_probe(struct platform_device *pdev)
return 0;
host_exit:
ssusb_host_exit(ssusb);
gadget_exit:
ssusb_gadget_exit(ssusb);
comm_exit: