From: Wu Liang feng Date: Tue, 13 Sep 2016 01:40:27 +0000 (+0800) Subject: phy: rockchip-inno-usb2: don't cancel chg_work if otg in host mode X-Git-Tag: firefly_0821_release~1541 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3caa76d5fd02af80a88d18ae744eb27b76764f9d;p=firefly-linux-kernel-4.4.55.git phy: rockchip-inno-usb2: don't cancel chg_work if otg in host mode Because chg_work is used for charge detection, so if OTG works in Host mode, we don't need to initialize chg_work, and aslo we don't need to cancel it when phy exit. Change-Id: I19cbede5aeb4c1f7f8faa32f195fffb0fc71eca9 Signed-off-by: Wu Liang feng --- diff --git a/drivers/phy/phy-rockchip-inno-usb2.c b/drivers/phy/phy-rockchip-inno-usb2.c index 011748235b2e..f19bfe9525a6 100644 --- a/drivers/phy/phy-rockchip-inno-usb2.c +++ b/drivers/phy/phy-rockchip-inno-usb2.c @@ -499,9 +499,10 @@ static int rockchip_usb2phy_exit(struct phy *phy) { struct rockchip_usb2phy_port *rport = phy_get_drvdata(phy); - if (rport->port_id == USB2PHY_PORT_OTG) { + if (rport->port_id == USB2PHY_PORT_OTG && + rport->mode != USB_DR_MODE_HOST) cancel_delayed_work_sync(&rport->chg_work); - } else if (rport->port_id == USB2PHY_PORT_HOST) + else if (rport->port_id == USB2PHY_PORT_HOST) cancel_delayed_work_sync(&rport->sm_work); return 0;