summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/soc/codecs/rk817_codec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sound/soc/codecs/rk817_codec.c b/sound/soc/codecs/rk817_codec.c
index f771184c7301..d3a19fc9b5d0 100644
--- a/sound/soc/codecs/rk817_codec.c
+++ b/sound/soc/codecs/rk817_codec.c
@@ -457,7 +457,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rk817 = {
static void rk817_codec_parse_dt_property(struct device *dev,
struct rk817_codec_priv *rk817)
{
- struct device_node *node = dev->parent->of_node;
+ struct device_node *node;
node = of_get_child_by_name(dev->parent->of_node, "codec");
if (!node) {
@@ -467,6 +467,8 @@ static void rk817_codec_parse_dt_property(struct device *dev,
rk817->mic_in_differential =
of_property_read_bool(node, "rockchip,mic-in-differential");
+
+ of_node_put(node);
}
static int rk817_platform_probe(struct platform_device *pdev)