From 3caa76d5fd02af80a88d18ae744eb27b76764f9d Mon Sep 17 00:00:00 2001 From: Wu Liang feng Date: Tue, 13 Sep 2016 09:40:27 +0800 Subject: [PATCH] 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 --- drivers/phy/phy-rockchip-inno-usb2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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; -- 2.34.1