Re: [PATCH] ASoC: soc-core: Stop using of_property_read_bool() for non-boolean properties

From: Kuninori Morimoto
Date: Thu Jan 23 2025 - 17:54:29 EST



Hi Geert, Mark

> > ret = of_property_read_u32(np, "dai-tdm-slot-num", &val);
> > - if (ret && ret != -EINVAL)
> > - return ret;
> > if (!ret && slots)
> > *slots = val;
(snip)
> That would be a change in behavior. Probably it would be fine for
> existing users, though, as no existing DTS should cause these errors,
> else sound wouldn't work. For a new DTS, it would silently ignore errors.
> You are in a better position to make that decision, though.

Thanks
I will post that patch if Gerrt's patch was applied.

> BTW, is there any specific reason the code always checks for the
> presence of "dai-tdm-slot-num", even if slots is NULL, and the result
> sn't used? I.e. would
>
> if (slots) {
> ret = of_property_read_u32(np, "dai-tdm-slot-num", &val);
> if (!ret)
> *slots = val;
> else if (ret != -EINVAL)
> return ret;
> }

I'm not 100% sure, but -num is used by the driver which can select the
number of TDM. Some driver uses default / fixed number. And -width too.
So I think these can be independent.


Thank you for your help !!

Best regards
---
Kuninori Morimoto