Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ASoC: simple-card: Drop unnecessary "dai-tdm-slot-width-map" property presence check

It doesn't matter whether "dai-tdm-slot-width-map" is not present or
there is some other issue parsing it in of_property_count_elems_of_size()
causing an error. Drop the presence check and rely on
of_property_count_elems_of_size() error return if not present.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/20250109182202.3971965-2-robh@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Rob Herring (Arm) and committed by
Mark Brown
abea0cbf 84eac6d4

+2 -3
+2 -3
sound/soc/generic/simple-card-utils.c
··· 139 139 int n, i, ret; 140 140 u32 *p; 141 141 142 - if (!of_property_read_bool(np, "dai-tdm-slot-width-map")) 143 - return 0; 144 - 145 142 n = of_property_count_elems_of_size(np, "dai-tdm-slot-width-map", sizeof(u32)); 143 + if (n <= 0) 144 + return 0; 146 145 if (n % 3) { 147 146 dev_err(dev, "Invalid number of cells for dai-tdm-slot-width-map\n"); 148 147 return -EINVAL;