Am Dienstag, 10. März 2026, 09:37:52 Mitteleuropäische Normalzeit schrieb 
Vladimir Oltean:
> On Tue, Mar 10, 2026 at 09:24:43AM +0100, Heiko Stuebner wrote:
> > 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 protected]>
> > > ---
> > > Cc: Sandy Huang <[email protected]>
> > > Cc: "Heiko Stübner" <[email protected]>
> > > Cc: Andy Yan <[email protected]>
> > > Cc: Maarten Lankhorst <[email protected]>
> > > Cc: Maxime Ripard <[email protected]>
> > > Cc: Thomas Zimmermann <[email protected]>
> > > Cc: David Airlie <[email protected]>
> > > Cc: Simona Vetter <[email protected]>
> > > 
> > > 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.
> 
> Testing the NULL quality of "struct phy *phy" is still possible and legal.
> It means that you called an "optional" variant of phy_get(), and there
> was no PHY.

ok, I'll keep that in mind :-)


Heiko


Reply via email to