summaryrefslogtreecommitdiff
path: root/sound/soc/generic/simple-card.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-28 13:30:55 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-28 13:30:55 +0100
commit70395a96bd882d8dba669f99b5cec0008690accd (patch)
tree37f3a4c2cf35828f153f3ce59c3daa4f39241c32 /sound/soc/generic/simple-card.c
parentf97a0944a72b26a2bece72516294e112a890f98a (diff)
parent3146089d235b304e665dc551472ae9cb9ab58572 (diff)
Merge tag 'asoc-v5.1-2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: More changes for v5.1 Another batch of changes for ASoC, no big core changes - it's mainly small fixes and improvements for individual drivers. - A big refresh and cleanup of the Samsung drivers, fixing a number of issues which allow the driver to be used with a wider range of userspaces. - Fixes for the Intel drivers to make them more standard so less likely to get bitten by core issues. - New driver for Cirrus Logic CS35L26.
Diffstat (limited to 'sound/soc/generic/simple-card.c')
-rw-r--r--sound/soc/generic/simple-card.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 08df261024cf..7147bba45a2a 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -421,6 +421,7 @@ static int simple_dai_link_of(struct simple_priv *priv,
asoc_simple_card_canonicalize_platform(dai_link);
dai_link_of_err:
+ of_node_put(plat);
of_node_put(node);
return ret;
@@ -441,11 +442,12 @@ static int simple_for_each_link(struct simple_priv *priv,
struct device_node *top = dev->of_node;
struct device_node *node;
bool is_top = 0;
+ int ret = 0;
/* Check if it has dai-link */
node = of_get_child_by_name(top, PREFIX "dai-link");
if (!node) {
- node = top;
+ node = of_node_get(top);
is_top = 1;
}
@@ -455,13 +457,14 @@ static int simple_for_each_link(struct simple_priv *priv,
struct device_node *codec;
struct device_node *np;
int num = of_get_child_count(node);
- int ret;
/* get codec */
codec = of_get_child_by_name(node, is_top ?
PREFIX "codec" : "codec");
- if (!codec)
- return -ENODEV;
+ if (!codec) {
+ ret = -ENODEV;
+ goto error;
+ }
of_node_put(codec);
@@ -484,14 +487,18 @@ static int simple_for_each_link(struct simple_priv *priv,
else
ret = func_noml(priv, np, codec, li, is_top);
- if (ret < 0)
- return ret;
+ if (ret < 0) {
+ of_node_put(np);
+ goto error;
+ }
}
node = of_get_next_child(top, node);
} while (!is_top && node);
- return 0;
+ error:
+ of_node_put(node);
+ return ret;
}
static int simple_parse_aux_devs(struct device_node *node,