38 lines
1.5 KiB
Diff
38 lines
1.5 KiB
Diff
From git@z Thu Jan 1 00:00:00 1970
|
|
Subject: [PATCH v13 5/35] phy: rockchip: usbdp: Handle missing clock-names
|
|
DT property gracefully
|
|
From: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
Date: Tue, 14 Jul 2026 21:26:06 +0200
|
|
Message-Id: <20260714-rockchip-usbdp-cleanup-v13-5-6cb3e769d4c5@collabora.com>
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset="utf-8"
|
|
Content-Transfer-Encoding: 7bit
|
|
|
|
The rk_udphy_clk_init() function would currently try to do a strncmp for
|
|
a NULL pointer, if DT specifies 'clocks' property, but no 'clock-names'
|
|
property. Fix this by making sure the clock has an id string set.
|
|
|
|
Note that DT binding requires setting clock-names, so this is only a
|
|
problem when booting a non-compliant device tree.
|
|
|
|
Fixes: 2f70bbddeb45 ("phy: rockchip: add usbdp combo phy driver")
|
|
Reported-by: Sashiko <sashiko-bot@kernel.org>
|
|
Closes: https://sashiko.dev/#/message/20260619154349.071321F000E9%40smtp.kernel.org
|
|
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
|
|
---
|
|
drivers/phy/rockchip/phy-rockchip-usbdp.c | 3 +++
|
|
1 file changed, 3 insertions(+)
|
|
|
|
--- a/drivers/phy/rockchip/phy-rockchip-usbdp.c
|
|
+++ b/drivers/phy/rockchip/phy-rockchip-usbdp.c
|
|
@@ -432,6 +432,9 @@ static int rk_udphy_clk_init(struct rk_u
|
|
|
|
/* used for configure phy reference clock frequency */
|
|
for (i = 0; i < udphy->num_clks; i++) {
|
|
+ if (!udphy->clks[i].id)
|
|
+ continue;
|
|
+
|
|
if (!strncmp(udphy->clks[i].id, "refclk", 6)) {
|
|
udphy->refclk = udphy->clks[i].clk;
|
|
break;
|