[alsa-devel] [PATCH 1/4] ASoC: mc13783: 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 fabio.estevam@freescale.com --- sound/soc/codecs/mc13783.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/codecs/mc13783.c b/sound/soc/codecs/mc13783.c index 2c1f1b0..388f90a 100644 --- a/sound/soc/codecs/mc13783.c +++ b/sound/soc/codecs/mc13783.c @@ -784,8 +784,7 @@ static int __init mc13783_codec_probe(struct platform_device *pdev) mc13783_dai_async, ARRAY_SIZE(mc13783_dai_async));
out: - if (np) - of_node_put(np); + of_node_put(np); return ret; }
of_node_put() supports NULL as its argument, so the initial test is not necessary.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/fsl/imx-spdif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/fsl/imx-spdif.c b/sound/soc/fsl/imx-spdif.c index e1dc401..0c9068e 100644 --- a/sound/soc/fsl/imx-spdif.c +++ b/sound/soc/fsl/imx-spdif.c @@ -74,8 +74,7 @@ static int imx_spdif_audio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, data);
end: - if (spdif_np) - of_node_put(spdif_np); + of_node_put(spdif_np);
return ret; }
On Tue, Oct 07, 2014 at 03:29:56PM -0300, Fabio Estevam wrote:
of_node_put() supports NULL as its argument, so the initial test is not necessary.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com
Acked for two fsl ones.
Thank you again Nicolin
sound/soc/fsl/imx-spdif.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/fsl/imx-spdif.c b/sound/soc/fsl/imx-spdif.c index e1dc401..0c9068e 100644 --- a/sound/soc/fsl/imx-spdif.c +++ b/sound/soc/fsl/imx-spdif.c @@ -74,8 +74,7 @@ static int imx_spdif_audio_probe(struct platform_device *pdev) platform_set_drvdata(pdev, data);
end:
- if (spdif_np)
of_node_put(spdif_np);
of_node_put(spdif_np);
return ret;
}
1.9.1
of_node_put() supports NULL as its argument, so the initial test is not necessary.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/fsl/eukrea-tlv320.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/fsl/eukrea-tlv320.c b/sound/soc/fsl/eukrea-tlv320.c index eb093d5..dd931fa 100644 --- a/sound/soc/fsl/eukrea-tlv320.c +++ b/sound/soc/fsl/eukrea-tlv320.c @@ -217,8 +217,7 @@ static int eukrea_tlv320_probe(struct platform_device *pdev) err: if (ret) dev_err(&pdev->dev, "snd_soc_register_card failed (%d)\n", ret); - if (np) - of_node_put(ssi_np); + of_node_put(ssi_np);
return ret; }
of_node_put() supports NULL as its argument, so the initial test is not necessary.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/generic/simple-card.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c index fcb431f..ecba061 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; }
On Tue, Oct 07, 2014 at 03:29:58PM -0300, Fabio Estevam wrote:
of_node_put() supports NULL as its argument, so the initial test is not necessary.
Applied, thanks, but please CC people who typically work on the code.
participants (3)
-
Fabio Estevam
-
Mark Brown
-
Nicolin Chen