From: Fabio Estevam Date: Tue, 7 Oct 2014 18:29:58 +0000 (-0300) Subject: ASoC: simple-card: Delete unneeded test before of_node_put X-Git-Tag: v3.19-rc1~11^2~38^2~11^4~4 X-Git-Url: http://git.cascardo.info/?a=commitdiff_plain;h=84d4cbe9a60a1fdd35b4dd69951f31c518b467d8;p=cascardo%2Flinux.git ASoC: simple-card: Delete unneeded test before of_node_put of_node_put() supports NULL as its argument, so the initial test is not necessary. Signed-off-by: Fabio Estevam Signed-off-by: Mark Brown --- diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index d1b7293c133e..4f192ee3cb16 100644 --- a/sound/soc/generic/simple-card.c +++ b/sound/soc/generic/simple-card.c @@ -368,12 +368,9 @@ static int asoc_simple_card_dai_link_of(struct device_node *node, dai_link->cpu_dai_name = NULL; dai_link_of_err: - if (np) - of_node_put(np); - if (bitclkmaster) - of_node_put(bitclkmaster); - if (framemaster) - of_node_put(framemaster); + of_node_put(np); + of_node_put(bitclkmaster); + of_node_put(framemaster); return ret; } @@ -464,11 +461,9 @@ static int asoc_simple_card_unref(struct platform_device *pdev) num_links < card->num_links; num_links++, dai_link++) { np = (struct device_node *) dai_link->cpu_of_node; - if (np) - of_node_put(np); + of_node_put(np); np = (struct device_node *) dai_link->codec_of_node; - if (np) - of_node_put(np); + of_node_put(np); } return 0; }