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:

committed by
Greg Kroah-Hartman

parent
bb31b35251
commit
03d8bfc130
@@ -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:
|
||||
|
Reference in New Issue
Block a user