Re: [PATCH] drm/bridge: tda998x: Use __be32 for audio port OF property pointer

From: Kory Maincent

Date: Fri Apr 17 2026 - 12:40:30 EST


On Fri, 17 Apr 2026 18:19:03 +0200
"Luca Ceresoli" <luca.ceresoli@xxxxxxxxxxx> wrote:

> On Fri Apr 17, 2026 at 5:55 PM CEST, Kory Maincent wrote:
> > From: "Kory Maincent (TI)" <kory.maincent@xxxxxxxxxxx>
> >
> > of_get_property() returns a pointer to big-endian (__be32) data, but
>
> Where is this stated? of_get_property() is declared as:
>
> | extern const void *of_get_property(const struct device_node *node,
> | const char *name,
> | int *lenp);
> (https://elixir.bootlin.com/linux/v7.0/source/include/linux/of.h#L365-L367)
>
> I don't see __be32 mentioned there.

It is not stated in the declaration as we don't know the property type but OF
value are always in Big Endian.
And the value is converted later to u8 here:
https://elixir.bootlin.com/linux/v7.0/source/drivers/gpu/drm/bridge/tda998x_drv.c#L1719

Maybe my commit message is a bit inaccurate on this. I can rephrase it if
needed.

> > port_data in tda998x_get_audio_ports() was declared as const u32 *,
> > causing a sparse endianness type mismatch warning. Fix the declaration
> > to use const __be32 *.
> >
> > Fixes: 7e567624dc5a4 ("drm/i2c: tda998x: Register ASoC hdmi-codec and add
> > audio DT binding") Reported-by: kernel test robot <lkp@xxxxxxxxx>
> > Closes:
> > https://lore.kernel.org/oe-kbuild-all/202604172257.Imo6GOH9-lkp@xxxxxxxxx/
>
> Wrong link?

No, it's just that I fixed the second sparse warnings reported by the kernel
test robot, but maybe quoting this link is wrong.

Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com