Subject: Re: [PATCH v3 phy-next 10/24] drm/rockchip: dw_hdmi: avoid direct dereference of phy->dev.of_node

From: Heiko Stuebner <[email-masked]>
Date: Tue, 10 Mar 2026 09:24:43 +0100

Am Montag, 9. März 2026, 20:08:28 Mitteleuropäische Normalzeit schrieb Vladimir Oltean:
> The dw_hdmi-rockchip driver validates pixel clock rates against the
> HDMI PHY's internal clock provider on certain SoCs like RK3328.
> This is currently achieved by dereferencing hdmi->phy->dev.of_node
> to obtain the provider node, which violates the Generic PHY API's
> encapsulation (the goal is for struct phy to be an opaque pointer).
> 
> Refactor dw_hdmi_rockchip_bind() to perform a manual phandle lookup
> on the "hdmi" PHY index within the controller's DT node. This provides
> a parallel path to the clock provider's OF node without relying on the
> internal structure of the struct phy handle.
> 
> Signed-off-by: Vladimir Oltean <[email-masked]>
> ---
> Cc: Sandy Huang <[email-masked]>
> Cc: "Heiko Stübner" <[email-masked]>
> Cc: Andy Yan <[email-masked]>
> Cc: Maarten Lankhorst <[email-masked]>
> Cc: Maxime Ripard <[email-masked]>
> Cc: Thomas Zimmermann <[email-masked]>
> Cc: David Airlie <[email-masked]>
> Cc: Simona Vetter <[email-masked]>
> 
> v1->v3: none
> ---

[...]

> @@ -588,13 +589,17 @@ static int dw_hdmi_rockchip_bind(struct device *dev, struct device *master,
>  		return dev_err_probe(hdmi->dev, ret, "failed to get phy\n");
>  	}
>  
> -	if (hdmi->phy) {

nit: a comment would be nice here. I.e. hdmi->phy being an opaque pointer
so checking hdmi->phy != NULL is not possible.

With that being a "goal", I assume that information is not widely spread
so this would prevent the next developer trying to change it back to
"if (hdmi->phy)" while that handling change trickles down.

apart from that:

Reviewed-by: Heiko Stueber <[email-masked]>