Skip to content

Commit 4bf2285

Browse files
laeyraudgregkh
authored andcommitted
ASoC: mediatek: mt6359: Fix DT parse error due to wrong child node name
commit 79c080c upstream. A recent dtbs_check error fix in mt6359.dtsi file changed a node name (from "mt6359codec" to "audio-codec") without modifying the mt6539 codec code that uses it. It leads to a probe failure after devicetree parsing returns in error: ``` [ 1.354025] mt6359-sound mt6359-sound: mt6359_platform_driver_probe() failed to parse dts [ 1.355066] mt6359-sound mt6359-sound: probe with driver mt6359-sound failed with error -22 ``` So, add the child node retrieval with the new name and if not found, try with the older one for backward compatibility. Fixes: 76b35f5 ("arm64: dts: mediatek: mt6359: fix dtbs_check error for audio-codec") Signed-off-by: Louis-Alexis Eyraud <[email protected]> Reviewed-by: Nícolas F. R. A. Prado <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent ab48e74 commit 4bf2285

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

sound/soc/codecs/mt6359.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,9 +2867,12 @@ static int mt6359_parse_dt(struct mt6359_priv *priv)
28672867
struct device *dev = priv->dev;
28682868
struct device_node *np;
28692869

2870-
np = of_get_child_by_name(dev->parent->of_node, "mt6359codec");
2871-
if (!np)
2872-
return -EINVAL;
2870+
np = of_get_child_by_name(dev->parent->of_node, "audio-codec");
2871+
if (!np) {
2872+
np = of_get_child_by_name(dev->parent->of_node, "mt6359codec");
2873+
if (!np)
2874+
return -EINVAL;
2875+
}
28732876

28742877
ret = of_property_read_u32(np, "mediatek,dmic-mode",
28752878
&priv->dmic_one_wire_mode);

0 commit comments

Comments
 (0)