[alsa-devel] [PATCH 1/6] ASoC: Samsung: Remove redundant platform_set_drvdata()
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Sangbeom Kim sbkim73@samsung.com --- sound/soc/samsung/smdk_wm8580pcm.c | 1 - sound/soc/samsung/smdk_wm8994pcm.c | 1 - 2 files changed, 2 deletions(-)
diff --git a/sound/soc/samsung/smdk_wm8580pcm.c b/sound/soc/samsung/smdk_wm8580pcm.c index e43bd42..23a9204 100644 --- a/sound/soc/samsung/smdk_wm8580pcm.c +++ b/sound/soc/samsung/smdk_wm8580pcm.c @@ -176,7 +176,6 @@ static int snd_smdk_probe(struct platform_device *pdev) static int snd_smdk_remove(struct platform_device *pdev) { snd_soc_unregister_card(&smdk_pcm); - platform_set_drvdata(pdev, NULL); return 0; }
diff --git a/sound/soc/samsung/smdk_wm8994pcm.c b/sound/soc/samsung/smdk_wm8994pcm.c index 3688a32..0c84ca0 100644 --- a/sound/soc/samsung/smdk_wm8994pcm.c +++ b/sound/soc/samsung/smdk_wm8994pcm.c @@ -146,7 +146,6 @@ static int snd_smdk_probe(struct platform_device *pdev) static int snd_smdk_remove(struct platform_device *pdev) { snd_soc_unregister_card(&smdk_pcm); - platform_set_drvdata(pdev, NULL); return 0; }
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Jarkko Nikula jarkko.nikula@bitmer.com --- sound/soc/omap/omap-mcbsp.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index eadbfb6..7483efb 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -814,8 +814,6 @@ static int asoc_mcbsp_remove(struct platform_device *pdev)
clk_put(mcbsp->fclk);
- platform_set_drvdata(pdev, NULL); - return 0; }
On Fri, May 03, 2013 at 02:39:20PM +0530, Sachin Kamat wrote:
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Applied, thanks.
Note that there has never been any need to clear drvdata, it's always been a bug for anything to assume anything about the value except a bound driver that set the value itself.
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Vinod Koul vinod.koul@intel.com --- sound/soc/mid-x86/mfld_machine.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/sound/soc/mid-x86/mfld_machine.c b/sound/soc/mid-x86/mfld_machine.c index 4139116..78d5825 100644 --- a/sound/soc/mid-x86/mfld_machine.c +++ b/sound/soc/mid-x86/mfld_machine.c @@ -425,7 +425,6 @@ static int snd_mfld_mc_remove(struct platform_device *pdev) free_irq(platform_get_irq(pdev, 0), mc_drv_ctx); snd_soc_unregister_card(&snd_soc_card_mfld); kfree(mc_drv_ctx); - platform_set_drvdata(pdev, NULL); return 0; }
On Fri, May 03, 2013 at 02:39:21PM +0530, Sachin Kamat wrote:
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Applied, thanks.
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Mika Westerberg mika.westerberg@iki.fi --- sound/soc/cirrus/ep93xx-ac97.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c index 7798fbd..840c9b1 100644 --- a/sound/soc/cirrus/ep93xx-ac97.c +++ b/sound/soc/cirrus/ep93xx-ac97.c @@ -403,7 +403,6 @@ static int ep93xx_ac97_probe(struct platform_device *pdev) return 0;
fail: - platform_set_drvdata(pdev, NULL); ep93xx_ac97_info = NULL; dev_set_drvdata(&pdev->dev, NULL); return ret; @@ -418,7 +417,6 @@ static int ep93xx_ac97_remove(struct platform_device *pdev) /* disable the AC97 controller */ ep93xx_ac97_write_reg(info, AC97GCR, 0);
- platform_set_drvdata(pdev, NULL); ep93xx_ac97_info = NULL; dev_set_drvdata(&pdev->dev, NULL);
On Fri, May 03, 2013 at 02:39:22PM +0530, Sachin Kamat wrote:
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Applied, thanks.
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Haojian Zhuang haojian.zhuang@marvell.com --- sound/soc/codecs/88pm860x-codec.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c index 60159c0..1382f3f 100644 --- a/sound/soc/codecs/88pm860x-codec.c +++ b/sound/soc/codecs/88pm860x-codec.c @@ -1444,7 +1444,7 @@ static int pm860x_codec_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_IRQ, i); if (!res) { dev_err(&pdev->dev, "Failed to get IRQ resources\n"); - goto out; + return -EINVAL; } pm860x->irq[i] = res->start + chip->irq_base; strncpy(pm860x->name[i], res->name, MAX_NAME_LEN); @@ -1454,19 +1454,14 @@ static int pm860x_codec_probe(struct platform_device *pdev) pm860x_dai, ARRAY_SIZE(pm860x_dai)); if (ret) { dev_err(&pdev->dev, "Failed to register codec\n"); - goto out; + return -EINVAL; } return ret; - -out: - platform_set_drvdata(pdev, NULL); - return -EINVAL; }
static int pm860x_codec_remove(struct platform_device *pdev) { snd_soc_unregister_codec(&pdev->dev); - platform_set_drvdata(pdev, NULL); return 0; }
On Fri, May 3, 2013 at 5:09 PM, Sachin Kamat sachin.kamat@linaro.org wrote:
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Haojian Zhuang haojian.zhuang@marvell.com
sound/soc/codecs/88pm860x-codec.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/sound/soc/codecs/88pm860x-codec.c b/sound/soc/codecs/88pm860x-codec.c index 60159c0..1382f3f 100644 --- a/sound/soc/codecs/88pm860x-codec.c +++ b/sound/soc/codecs/88pm860x-codec.c @@ -1444,7 +1444,7 @@ static int pm860x_codec_probe(struct platform_device *pdev) res = platform_get_resource(pdev, IORESOURCE_IRQ, i); if (!res) { dev_err(&pdev->dev, "Failed to get IRQ resources\n");
goto out;
return -EINVAL; } pm860x->irq[i] = res->start + chip->irq_base; strncpy(pm860x->name[i], res->name, MAX_NAME_LEN);
@@ -1454,19 +1454,14 @@ static int pm860x_codec_probe(struct platform_device *pdev) pm860x_dai, ARRAY_SIZE(pm860x_dai)); if (ret) { dev_err(&pdev->dev, "Failed to register codec\n");
goto out;
return -EINVAL; } return ret;
-out:
platform_set_drvdata(pdev, NULL);
return -EINVAL;
}
static int pm860x_codec_remove(struct platform_device *pdev) { snd_soc_unregister_codec(&pdev->dev);
platform_set_drvdata(pdev, NULL); return 0;
}
-- 1.7.9.5
Acked-by: Haojian Zhuang haojian.zhuang@gmail.com
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Lars-Peter Clausen lars@metafoo.de --- sound/soc/codecs/jz4740.c | 2 -- sound/soc/jz4740/jz4740-i2s.c | 1 - 2 files changed, 3 deletions(-)
diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c index 5f607b3..bcebd1a 100644 --- a/sound/soc/codecs/jz4740.c +++ b/sound/soc/codecs/jz4740.c @@ -384,8 +384,6 @@ static int jz4740_codec_remove(struct platform_device *pdev) { snd_soc_unregister_codec(&pdev->dev);
- platform_set_drvdata(pdev, NULL); - return 0; }
diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c index 9a12644..cafc6ed 100644 --- a/sound/soc/jz4740/jz4740-i2s.c +++ b/sound/soc/jz4740/jz4740-i2s.c @@ -509,7 +509,6 @@ static int jz4740_i2s_dev_remove(struct platform_device *pdev) iounmap(i2s->base); release_mem_region(i2s->mem->start, resource_size(i2s->mem));
- platform_set_drvdata(pdev, NULL); kfree(i2s);
return 0;
On 05/03/2013 11:09 AM, Sachin Kamat wrote:
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org Cc: Lars-Peter Clausen lars@metafoo.de
Acked-by: Lars-Peter Clausen lars@metatfoo.de
Thanks
sound/soc/codecs/jz4740.c | 2 -- sound/soc/jz4740/jz4740-i2s.c | 1 - 2 files changed, 3 deletions(-)
diff --git a/sound/soc/codecs/jz4740.c b/sound/soc/codecs/jz4740.c index 5f607b3..bcebd1a 100644 --- a/sound/soc/codecs/jz4740.c +++ b/sound/soc/codecs/jz4740.c @@ -384,8 +384,6 @@ static int jz4740_codec_remove(struct platform_device *pdev) { snd_soc_unregister_codec(&pdev->dev);
- platform_set_drvdata(pdev, NULL);
- return 0;
}
diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c index 9a12644..cafc6ed 100644 --- a/sound/soc/jz4740/jz4740-i2s.c +++ b/sound/soc/jz4740/jz4740-i2s.c @@ -509,7 +509,6 @@ static int jz4740_i2s_dev_remove(struct platform_device *pdev) iounmap(i2s->base); release_mem_region(i2s->mem->start, resource_size(i2s->mem));
platform_set_drvdata(pdev, NULL); kfree(i2s);
return 0;
On Fri, May 03, 2013 at 02:39:24PM +0530, Sachin Kamat wrote:
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Applied, thanks.
On Fri, May 03, 2013 at 02:39:19PM +0530, Sachin Kamat wrote:
Commit 0998d06310 (device-core: Ensure drvdata = NULL when no driver is bound) removes the need to set driver data field to NULL.
Applied, thanks.
participants (4)
-
Haojian Zhuang
-
Lars-Peter Clausen
-
Mark Brown
-
Sachin Kamat