Skip to contentSkip to conversation

phy: rockchip: handle clock without enable function

PATCH In review John Keeping 2 participants 2 messages Dec 6, 2022 – Dec 18, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 phy: rockchip: handle clock without enable function

If a clock doesn't supply the enable hook, clk_enable() will return -ENOSYS. In this case the clock is always enabled so there is no error and the phy initialisation should continue.

---
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/rockchip/phy-rockchip-inno-usb2.c +1 -1
index 62b8ba3a4a..b32a498ea7 100644
@@ -119,7 +119,7 @@ static int rockchip_usb2phy_init(struct phy *phy)
 	int ret;
 
 	ret = clk_enable(&priv->phyclk);
-	if (ret) {
+	if (ret && ret != -ENOSYS) {
 		dev_err(phy->dev, "failed to enable phyclk (ret=%d)\n", ret);
 		return ret;
 	}
Signature · 1 line
2.38.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · John Keeping

If a clock doesn't supply the enable hook, clk_enable() will return -ENOSYS. In this case the clock is always enabled so there is no error and the phy initialisation should continue.

Thanks,
- Kever

Quoted 17 lines
---
  drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/rockchip/phy-rockchip-inno-usb2.c +1 -1
index 62b8ba3a4a..b32a498ea7 100644
@@ -119,7 +119,7 @@ static int rockchip_usb2phy_init(struct phy *phy)
  	int ret;
 
  	ret = clk_enable(&priv->phyclk);
-	if (ret) {
+	if (ret && ret != -ENOSYS) {
  		dev_err(phy->dev, "failed to enable phyclk (ret=%d)\n", ret);
  		return ret;
  	}