[alsa-devel] [PATCH 1/3] ASoC: fsl_ssi: Remove unnecessary dev_set_drvdata()
Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/fsl/fsl_ssi.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 0c072ff..6f4a4c5 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -909,7 +909,6 @@ error_dai: snd_soc_unregister_component(&pdev->dev);
error_dev: - dev_set_drvdata(&pdev->dev, NULL); device_remove_file(&pdev->dev, dev_attr);
error_clk: @@ -935,7 +934,6 @@ static int fsl_ssi_remove(struct platform_device *pdev) snd_soc_unregister_component(&pdev->dev); device_remove_file(&pdev->dev, &ssi_private->dev_attr); irq_dispose_mapping(ssi_private->irq); - dev_set_drvdata(&pdev->dev, NULL);
return 0; }
Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/cirrus/ep93xx-i2s.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-i2s.c b/sound/soc/cirrus/ep93xx-i2s.c index f23f331..a57643d 100644 --- a/sound/soc/cirrus/ep93xx-i2s.c +++ b/sound/soc/cirrus/ep93xx-i2s.c @@ -408,7 +408,6 @@ static int ep93xx_i2s_probe(struct platform_device *pdev) return 0;
fail_put_lrclk: - dev_set_drvdata(&pdev->dev, NULL); clk_put(info->lrclk); fail_put_sclk: clk_put(info->sclk); @@ -423,7 +422,6 @@ static int ep93xx_i2s_remove(struct platform_device *pdev) struct ep93xx_i2s_info *info = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); - dev_set_drvdata(&pdev->dev, NULL); clk_put(info->lrclk); clk_put(info->sclk); clk_put(info->mclk);
On Mon, Aug 26, 2013 at 09:25:14AM -0300, Fabio Estevam wrote:
Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here.
Applied, thanks. The actual thing here is a bit deeper - if anything ever relies on the driver data being set after remove() it's buggy anyway, setting it to NULL at all is pretty much ornamental.
Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here.
Signed-off-by: Fabio Estevam fabio.estevam@freescale.com --- sound/soc/dwc/designware_i2s.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/sound/soc/dwc/designware_i2s.c b/sound/soc/dwc/designware_i2s.c index 70eb37a..25c31f1 100644 --- a/sound/soc/dwc/designware_i2s.c +++ b/sound/soc/dwc/designware_i2s.c @@ -421,13 +421,11 @@ static int dw_i2s_probe(struct platform_device *pdev) dw_i2s_dai, 1); if (ret != 0) { dev_err(&pdev->dev, "not able to register dai\n"); - goto err_set_drvdata; + goto err_clk_disable; }
return 0;
-err_set_drvdata: - dev_set_drvdata(&pdev->dev, NULL); err_clk_disable: clk_disable(dev->clk); err_clk_put: @@ -440,7 +438,6 @@ static int dw_i2s_remove(struct platform_device *pdev) struct dw_i2s_dev *dev = dev_get_drvdata(&pdev->dev);
snd_soc_unregister_component(&pdev->dev); - dev_set_drvdata(&pdev->dev, NULL);
clk_put(dev->clk);
On Mon, Aug 26, 2013 at 09:25:15AM -0300, Fabio Estevam wrote:
Driver core clears the driver data to NULL after device_release or on probe failure, so just remove it from here.
Applied, thanks.
participants (2)
-
Fabio Estevam
-
Mark Brown