Skip to content

Commit

Permalink
ASoC: rk817: remove redundant assignment to pointer node, add missing…
Browse files Browse the repository at this point in the history
… 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: 0d6a04d ("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>
  • Loading branch information
Colin Ian King authored and Mark Brown committed Jun 7, 2021
1 parent 54f6731 commit d50b86b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sound/soc/codecs/rk817_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)
Expand Down

0 comments on commit d50b86b

Please sign in to comment.