Skip to content

Commit abea0cb

Browse files
robherringbroonie
authored andcommitted
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) <[email protected]> Acked-by: Kuninori Morimoto <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 84eac6d commit abea0cb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sound/soc/generic/simple-card-utils.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,9 @@ int simple_util_parse_tdm_width_map(struct device *dev, struct device_node *np,
139139
int n, i, ret;
140140
u32 *p;
141141

142-
if (!of_property_read_bool(np, "dai-tdm-slot-width-map"))
143-
return 0;
144-
145142
n = of_property_count_elems_of_size(np, "dai-tdm-slot-width-map", sizeof(u32));
143+
if (n <= 0)
144+
return 0;
146145
if (n % 3) {
147146
dev_err(dev, "Invalid number of cells for dai-tdm-slot-width-map\n");
148147
return -EINVAL;

0 commit comments

Comments
 (0)