[PATCH] clk: fixed_rate: Avoid calling dev_read_*() if CONFIG_OF_PLATDATA=y

Tom Rini trini at konsulko.com
Fri Nov 21 20:27:53 CET 2025


On Fri, Nov 21, 2025 at 12:09:31PM -0700, Simon Glass wrote:
> Hi Marek,
> 
> On Fri, 21 Nov 2025 at 10:53, Marek Vasut <marek.vasut at mailbox.org> wrote:
> >
> > On 11/21/25 6:35 PM, Simon Glass wrote:
> >
> > Hello Simon,
> >
> > >> To be made to clk_fixed_rate_ofdata_to_plat_(...) in
> > >> drivers/clk/clk_fixed_rate.c as it does not currently call
> > >> dev_has_ofnode(dev).
> > >
> > > Ah OK. So the call stack is something like:
> > >
> > > dev_read_u32_default()
> > > dev_ofnode() - returns ofnode_null
> > > ofnode_read_u32_default()
> > > ofnode_read_u32_index
> > > fdt_getprop(NULL, -1, ...)   // guess
> > >
> > > And I see that I put assert() in some of the ofnode_read..() functions
> > > because I don't have tests for passing an invalid ofnode.
> > >
> > > So perhaps fdt_offset_ptr_() should check for NULL and return? I
> > > haven't traced it though.
> >
> > In previous patch
> >
> > [PATCH 3/3] libfdt: Check fdt_offset_ptr() return value unconditionally
> >
> > that approach seems to have been rejected, and these dev_read_*() fixes
> > were implemented as a replacement.
> 
> I don't think it was rejected...but I think the commit message should
> better explain the problem, e.g. using some of the info above.
> 
> The only choice is whether to add the check unconditionally (which I
> think is fine for now) or to add a new type of assumption.

Your feedback here does not seem to match up with your feedback in the
patch in question:
https://lore.kernel.org/all/CAFLszTg6dF1dmJJDh8-2ZjUf6i9+ZOFvWNSxNRS_PBQ3CDNtHw@mail.gmail.com/#t

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20251121/519b79b4/attachment.sig>


More information about the U-Boot mailing list