[PATCH 8/8] phy: phy-rockchip-inno-usb2.c: Fix crash if phyclk isn't found

David Jander david at protonic.nl
Sun Aug 10 23:40:26 PDT 2025


in rockchip_usb2phy_clk480m_register() rphy->clk is checked for NULL, but
clk_get() will return an error instead of NULL if the clk isn't found.

Signed-off-by: David Jander <david at protonic.nl>
---
 drivers/phy/rockchip/phy-rockchip-inno-usb2.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
index 1ed3fb0bf1..9805537c34 100644
--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -471,6 +471,8 @@ static int rockchip_usb2phy_probe(struct device *dev)
 	dev->priv = rphy;
 
 	rphy->clk = clk_get(dev, "phyclk");
+	if (IS_ERR(rphy->clk))
+		rphy->clk = NULL;
 	rockchip_usb2phy_clk480m_register(rphy);
 
 	rphy->provider = of_phy_provider_register(dev, rockchip_usb2phy_of_xlate);
-- 
2.47.2




More information about the barebox mailing list