Skip to contentSkip to conversation

ASoC: fsl_spdif: Remove unnecessary dev_set_drvdata()

PATCH Applied Fabio Estevam 3 participants 7 messages Aug 23, 2013 – Aug 27, 2013

Subsystems (3)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v2 1/2 ASoC: fsl_spdif: Remove unnecessary dev_set_drvdata()

From: Fabio Estevam <[email protected]>

Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here.

---
Changes since v1:
- Also remove dev_set_drvdata from the remove function

 sound/soc/fsl/fsl_spdif.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/fsl/fsl_spdif.c +1 -4
index 42a4382..a8ef46a 100644
@@ -1184,7 +1184,7 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 					 &spdif_priv->cpu_dai_drv, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register DAI: %d\n", ret);
-		goto error_dev;
+		return ret;
 	}
 
 	ret = imx_pcm_dma_init(pdev);
@@ -1197,8 +1197,6 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 
 error_component:
 	snd_soc_unregister_component(&pdev->dev);
-error_dev:
-	dev_set_drvdata(&pdev->dev, NULL);
 
 	return ret;
 }
@@ -1207,7 +1205,6 @@ static int fsl_spdif_remove(struct platform_device *pdev)
 {
 	imx_pcm_dma_exit(pdev);
 	snd_soc_unregister_component(&pdev->dev);
-	dev_set_drvdata(&pdev->dev, NULL);
 
 	return 0;
 }
Signature · 1 line
1.8.1.2
author reviewer
#1 lore raw

PATCH v2 2/2 ASoC: fsl_spdif: Reduce the noise on comments

From: Fabio Estevam <[email protected]>

Remove the "====" pattern to let the comments cleaner and more uniform.

Also, do not use multi-line style for a single line comment.

---
Changes since v1:
- None

 sound/soc/fsl/fsl_spdif.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
sound/soc/fsl/fsl_spdif.c +1 -7
index bf58086..34b531b 100644
@@ -555,7 +555,6 @@ struct snd_soc_dai_ops fsl_spdif_dai_ops = {
 
 
 /*
- * ============================================
  * FSL SPDIF IEC958 controller(mixer) functions
  *
  *	Channel status get/put control
@@ -563,7 +562,6 @@ struct snd_soc_dai_ops fsl_spdif_dai_ops = {
  *	Valid bit value get control
  *	DPLL lock status get control
  *	User bit sync mode selection control
- * ============================================
  */
 
 static int fsl_spdif_info(struct snd_kcontrol *kcontrol,
@@ -942,11 +940,7 @@ static const struct snd_soc_component_driver fsl_spdif_component = {
 	.name		= "fsl-spdif",
 };
 
-/*
- * ================
- * FSL SPDIF REGMAP
- * ================
- */
+/* FSL SPDIF REGMAP */
 
 static bool fsl_spdif_readable_reg(struct device *dev, unsigned int reg)
 {
Signature · 1 line
1.8.1.2
Acked-by on v2 2/2
#2 lore raw

Re: [PATCH v2 2/2] ASoC: fsl_spdif: Reduce the noise on comments

Quoted 7 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Remove the "====" pattern to let the comments cleaner and more uniform.

Also, do not use multi-line style for a single line comment.

Well, I just wanted to make it distinct.

But I'm fairly okay with this patch.

Thank you.

Best regards,
Nicolin Chen

Quoted 43 lines

---
Changes since v1:
- None

 sound/soc/fsl/fsl_spdif.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
sound/soc/fsl/fsl_spdif.c +1 -7
index bf58086..34b531b 100644
@@ -555,7 +555,6 @@ struct snd_soc_dai_ops fsl_spdif_dai_ops = {
 
 
 /*
- * ============================================
  * FSL SPDIF IEC958 controller(mixer) functions
  *
  *	Channel status get/put control
@@ -563,7 +562,6 @@ struct snd_soc_dai_ops fsl_spdif_dai_ops = {
  *	Valid bit value get control
  *	DPLL lock status get control
  *	User bit sync mode selection control
- * ============================================
  */
 
 static int fsl_spdif_info(struct snd_kcontrol *kcontrol,
@@ -942,11 +940,7 @@ static const struct snd_soc_component_driver fsl_spdif_component = {
 	.name		= "fsl-spdif",
 };
 
-/*
- * ================
- * FSL SPDIF REGMAP
- * ================
- */
+/* FSL SPDIF REGMAP */
 
 static bool fsl_spdif_readable_reg(struct device *dev, unsigned int reg)
 {
Signature · 1 line
1.8.1.2
Acked-by on v2 1/2
#3 lore raw
In reply to Fabio Estevam

Good to know this. Thank you :)

(
I'm not sure if I can use 'Acked-by'.
If not, pls replace it to 'Reviewed-by'
Thanks a lot.
)

Quoted 47 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here.

---
Changes since v1:
- Also remove dev_set_drvdata from the remove function

 sound/soc/fsl/fsl_spdif.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
sound/soc/fsl/fsl_spdif.c +1 -4
index 42a4382..a8ef46a 100644
@@ -1184,7 +1184,7 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 					 &spdif_priv->cpu_dai_drv, 1);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to register DAI: %d\n", ret);
-		goto error_dev;
+		return ret;
 	}
 
 	ret = imx_pcm_dma_init(pdev);
@@ -1197,8 +1197,6 @@ static int fsl_spdif_probe(struct platform_device *pdev)
 
 error_component:
 	snd_soc_unregister_component(&pdev->dev);
-error_dev:
-	dev_set_drvdata(&pdev->dev, NULL);
 
 	return ret;
 }
@@ -1207,7 +1205,6 @@ static int fsl_spdif_remove(struct platform_device *pdev)
 {
 	imx_pcm_dma_exit(pdev);
 	snd_soc_unregister_component(&pdev->dev);
-	dev_set_drvdata(&pdev->dev, NULL);
 
 	return 0;
 }
Signature · 1 line
1.8.1.2
maintainer
#4 lore raw
Quoted 7 lines · Nicolin Chen

Good to know this. Thank you :)

(
I'm not sure if I can use 'Acked-by'.
If not, pls replace it to 'Reviewed-by'
Thanks a lot.

Reviwed-by: is actually better - acked just means that you don't mind the patch while reviewed means that you actaully did a proper review and so on.

#5 lore raw
Quoted 9 lines · Mark Brown
Quoted 7 lines · Nicolin Chen

Good to know this. Thank you :)

(
I'm not sure if I can use 'Acked-by'.
If not, pls replace it to 'Reviewed-by'
Thanks a lot.

Quoted 3 lines

Reviwed-by: is actually better - acked just means that you don't mind the patch while reviewed means that you actaully did a proper review and so on.

Thank you for the explain :)

Nicolin