mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: David Jander <david@protonic.nl>
To: barebox@lists.infradead.org
Cc: David Jander <david@protonic.nl>
Subject: [PATCH 8/8] phy: phy-rockchip-inno-usb2.c: Fix crash if phyclk isn't found
Date: Mon, 11 Aug 2025 08:40:26 +0200	[thread overview]
Message-ID: <20250811064026.753776-9-david@protonic.nl> (raw)
In-Reply-To: <20250811064026.753776-1-david@protonic.nl>

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@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




  parent reply	other threads:[~2025-08-11  6:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-11  6:40 [PATCH 0/8] Add Rockchip RK3576 support David Jander
2025-08-11  6:40 ` [PATCH 1/8] clk: rockchip: clk-pll.c: Fix macro name confusion David Jander
2025-08-11  6:40 ` [PATCH 2/8] clk: rockchip: Introduce rockchip_grf_type enum from kernel driver David Jander
2025-08-11  6:40 ` [PATCH 3/8] ARM: Initial support for Rockchip RK3576 David Jander
2025-08-11  6:40 ` [PATCH 4/8] arm: dts: Add barebox specific RK3576.dtsi David Jander
2025-08-11  6:40 ` [PATCH 5/8] aiodev: rockchip_saradc.c: Add support for RK3576 David Jander
2025-08-11  6:40 ` [PATCH 6/8] gpio: gpio-rockchip.c: Add support for GPIO_TYPE_V2_2 David Jander
2025-08-11  6:40 ` [PATCH 7/8] arm: dts: rk3576.dtsi: Add gpio aliases David Jander
2025-08-11  6:40 ` David Jander [this message]
2025-08-13  5:28 ` [PATCH 0/8] Add Rockchip RK3576 support Sascha Hauer
2025-08-13  5:32 ` Sascha Hauer
2025-08-13  6:51   ` David Jander

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250811064026.753776-9-david@protonic.nl \
    --to=david@protonic.nl \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox