Skip to content

Commit d50b86b

Browse files
Colin Ian Kingbroonie
authored andcommitted
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: 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>
1 parent 54f6731 commit d50b86b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sound/soc/codecs/rk817_codec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ static const struct snd_soc_component_driver soc_codec_dev_rk817 = {
457457
static void rk817_codec_parse_dt_property(struct device *dev,
458458
struct rk817_codec_priv *rk817)
459459
{
460-
struct device_node *node = dev->parent->of_node;
460+
struct device_node *node;
461461

462462
node = of_get_child_by_name(dev->parent->of_node, "codec");
463463
if (!node) {
@@ -467,6 +467,8 @@ static void rk817_codec_parse_dt_property(struct device *dev,
467467

468468
rk817->mic_in_differential =
469469
of_property_read_bool(node, "rockchip,mic-in-differential");
470+
471+
of_node_put(node);
470472
}
471473

472474
static int rk817_platform_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)