Skip to contentSkip to conversation

ASoC: fsl: imx-wm8962: Delete unneeded test before of_node_put

PATCH Applied Fabio Estevam 3 participants 4 messages Oct 7, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ASoC: fsl: imx-wm8962: Delete unneeded test before of_node_put

of_node_put() supports NULL as its argument, so the initial test is not necessary.

---
 sound/soc/fsl/imx-wm8962.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
sound/soc/fsl/imx-wm8962.c +2 -4
index 3a3d17c..48179ff 100644
@@ -281,10 +281,8 @@ static int imx_wm8962_probe(struct platform_device *pdev)
 clk_fail:
 	clk_disable_unprepare(data->codec_clk);
 fail:
-	if (ssi_np)
-		of_node_put(ssi_np);
-	if (codec_np)
-		of_node_put(codec_np);
+	of_node_put(ssi_np);
+	of_node_put(codec_np);
 
 	return ret;
 }
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 ASoC: fsl: imx-sgtl5000: Delete unneeded test before of_node_put

of_node_put() supports NULL as its argument, so the initial test is not necessary.

---
 sound/soc/fsl/imx-sgtl5000.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
sound/soc/fsl/imx-sgtl5000.c +2 -4
index 1cb22dd..1dab963 100644
@@ -175,10 +175,8 @@ static int imx_sgtl5000_probe(struct platform_device *pdev)
 fail:
 	if (data && !IS_ERR(data->codec_clk))
 		clk_put(data->codec_clk);
-	if (ssi_np)
-		of_node_put(ssi_np);
-	if (codec_np)
-		of_node_put(codec_np);
+	of_node_put(ssi_np);
+	of_node_put(codec_np);
 
 	return ret;
 }
Signature · 1 line
1.9.1
maintainer Applied
#2 lore raw
In reply to Fabio Estevam
Quoted 2 lines · Fabio Estevam

of_node_put() supports NULL as its argument, so the initial test is not necessary.

Applied both, thanks.

reviewer Acked-by on v1 1/2
#3 lore raw
In reply to Fabio Estevam
Quoted 4 lines · Fabio Estevam

of_node_put() supports NULL as its argument, so the initial test is not necessary.

For both two patches:

Thank you
Nic

Quoted 24 lines
---
 sound/soc/fsl/imx-wm8962.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
sound/soc/fsl/imx-wm8962.c +2 -4
index 3a3d17c..48179ff 100644
@@ -281,10 +281,8 @@ static int imx_wm8962_probe(struct platform_device *pdev)
 clk_fail:
 	clk_disable_unprepare(data->codec_clk);
 fail:
-	if (ssi_np)
-		of_node_put(ssi_np);
-	if (codec_np)
-		of_node_put(codec_np);
+	of_node_put(ssi_np);
+	of_node_put(codec_np);
 
 	return ret;
 }
Signature · 1 line
1.9.1