32 lines
950 B
Diff
32 lines
950 B
Diff
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
|
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
|
|
@@ -1124,7 +1124,7 @@
|
|
struct rockchip_usb2phy_port *rport,
|
|
struct device_node *child_np)
|
|
{
|
|
- int ret;
|
|
+ int ret, id;
|
|
|
|
rport->port_id = USB2PHY_PORT_OTG;
|
|
rport->port_cfg = &rphy->phy_cfg->port_cfgs[USB2PHY_PORT_OTG];
|
|
@@ -1162,13 +1162,15 @@
|
|
|
|
ret = devm_extcon_register_notifier(rphy->dev, rphy->edev,
|
|
EXTCON_USB_HOST, &rport->event_nb);
|
|
- if (ret)
|
|
+ if (ret) {
|
|
dev_err(rphy->dev, "register USB HOST notifier failed\n");
|
|
+ goto out;
|
|
+ }
|
|
|
|
if (!of_property_read_bool(rphy->dev->of_node, "extcon")) {
|
|
/* do initial sync of usb state */
|
|
- ret = property_enabled(rphy->grf, &rport->port_cfg->utmi_id);
|
|
- extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !ret);
|
|
+ id = property_enabled(rphy->grf, &rport->port_cfg->utmi_id);
|
|
+ extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !id);
|
|
}
|
|
}
|
|
|
|
|