diff options
author | Colin Ian King <colin.king@canonical.com> | 2021-06-03 13:36:59 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-06-07 17:20:03 +0200 |
commit | d50b86b3f6abc4ff8a35f706a6b8251a2d4cf58f (patch) | |
tree | 323e31b4461d6b17aa8c264057a80996879507d9 /sound/soc/codecs/rk817_codec.c | |
parent | ASoC: rk817: Remove unneeded semicolon (diff) | |
download | linux-d50b86b3f6abc4ff8a35f706a6b8251a2d4cf58f.tar.xz linux-d50b86b3f6abc4ff8a35f706a6b8251a2d4cf58f.zip |
ASoC: rk817: remove redundant assignment to pointer node, add missing of_node_put
The pointer node is being initialized with a value that is never read and
it is being updated later with a new value. The initialization is
redundant and can be removed.
The function is missing a of_node_put on node, fix this by adding the call
before returning.
Addresses-Coverity: ("Unused value")
Fixes: 0d6a04da9b25 ("ASoC: Add Rockchip rk817 audio CODEC support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Tested-by: Chris Morgan <macromorgan@hotmail.com>
Link: https://lore.kernel.org/r/20210603113659.82031-1-colin.king@canonical.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/rk817_codec.c')
-rw-r--r-- | sound/soc/codecs/rk817_codec.c | 4 |
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) |