Message ID | 87o6zf3gg0.wl-kuninori.morimoto.gx@renesas.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | ASoC: soc-core: remove verbose check from snd_soc_of_parse_tdm_slot() | expand |
On Thu, Feb 06, 2025 at 03:22:39AM +0000, Kuninori Morimoto wrote: > The reason of of_property_read_u32() returns error are > > (A) -EINVAL: if the property does not exist > (B) -ENODATA: if property does not have a value > (C) -EOVERFLOW: if the property data isn't large enough > > Property does not exist (A) is not error in this function. > So, current code returns error if (B) or (C) case. > > But these are handled by "DT checker". We don't need to check it in the > code. Let's remove it We're assuming that people actually run the validation tools, which the reports that Rob sends out from his bot seem to indicate doesn't happen reliably and I'd expect would be even less relaible with out of tree DTs.
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index af75e59dec377..1db86438abf04 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -3117,14 +3117,10 @@ int snd_soc_of_parse_tdm_slot(struct device_node *np, snd_soc_of_get_slot_mask(np, "dai-tdm-slot-rx-mask", rx_mask); ret = of_property_read_u32(np, "dai-tdm-slot-num", &val); - if (ret && ret != -EINVAL) - return ret; if (!ret && slots) *slots = val; ret = of_property_read_u32(np, "dai-tdm-slot-width", &val); - if (ret && ret != -EINVAL) - return ret; if (!ret && slot_width) *slot_width = val;
The reason of of_property_read_u32() returns error are (A) -EINVAL: if the property does not exist (B) -ENODATA: if property does not have a value (C) -EOVERFLOW: if the property data isn't large enough Property does not exist (A) is not error in this function. So, current code returns error if (B) or (C) case. But these are handled by "DT checker". We don't need to check it in the code. Let's remove it Cc: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> --- sound/soc/soc-core.c | 4 ---- 1 file changed, 4 deletions(-)