diff options
author | Mark Brown <broonie@kernel.org> | 2019-01-07 12:18:14 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-01-07 12:18:14 +0000 |
commit | aa07e38b0ae9338e34cf2b8df2259ff6ff6e843f (patch) | |
tree | c8de6e63527eb567f223392e0620c96ad737fb51 /sound/soc/generic/simple-card-utils.c | |
parent | bfeffd155283772bbe78c6a05dec7c0128ee500c (diff) | |
parent | 540f1ba7b3a5596827a3bfeaae9c5e754347c933 (diff) |
Merge branch 'asoc-4.22' into asoc-5.0
Diffstat (limited to 'sound/soc/generic/simple-card-utils.c')
-rw-r--r-- | sound/soc/generic/simple-card-utils.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c index b807a47515eb..336895f7fd1e 100644 --- a/sound/soc/generic/simple-card-utils.c +++ b/sound/soc/generic/simple-card-utils.c @@ -283,12 +283,20 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep) /* use endpoint/port reg if exist */ ret = of_graph_parse_endpoint(ep, &info); if (ret == 0) { - if (info.id) + /* + * Because it will count port/endpoint if it doesn't have "reg". + * But, we can't judge whether it has "no reg", or "reg = <0>" + * only of_graph_parse_endpoint(). + * We need to check "reg" property + */ + if (of_get_property(ep, "reg", NULL)) return info.id; - if (info.port) + + node = of_get_parent(ep); + of_node_put(node); + if (of_get_property(node, "reg", NULL)) return info.port; } - node = of_graph_get_port_parent(ep); /* |