From ead5e8f022f7bf05f33f08f600f3986392c09290 Mon Sep 17 00:00:00 2001 From: Zhang Yubing Date: Wed, 1 Dec 2021 21:37:02 +0800 Subject: [PATCH] phy: rockchip: usbdp: avoid repeat run power off When phy status is none, it mean that the power off process is already be run. if the phy power off function is called again before power on, ignore it. Signed-off-by: Zhang Yubing Change-Id: I34c3f2b92076f7c27a1537d3c78000781de61179 --- drivers/phy/rockchip/phy-rockchip-usbdp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/phy/rockchip/phy-rockchip-usbdp.c b/drivers/phy/rockchip/phy-rockchip-usbdp.c index 8bd8423cd82c..8ef1d15a4415 100644 --- a/drivers/phy/rockchip/phy-rockchip-usbdp.c +++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c @@ -724,6 +724,9 @@ static int udphy_power_off(struct rockchip_udphy *udphy, u8 mode) return 0; } + if (!udphy->status) + return 0; + udphy->status &= ~mode; if (udphy->status == UDPHY_MODE_NONE) {