[alsa-devel] [PATCH 1/2] ASoC: SPEAr spdif_in: Use devm_snd_soc_register_component
devm_snd_soc_register_component makes code simpler.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/spear/spdif_in.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/sound/soc/spear/spdif_in.c b/sound/soc/spear/spdif_in.c index 63acfeb..21a8c95 100644 --- a/sound/soc/spear/spdif_in.c +++ b/sound/soc/spear/spdif_in.c @@ -257,20 +257,12 @@ static int spdif_in_probe(struct platform_device *pdev) return ret; }
- return snd_soc_register_component(&pdev->dev, &spdif_in_component, - &spdif_in_dai, 1); -} - -static int spdif_in_remove(struct platform_device *pdev) -{ - snd_soc_unregister_component(&pdev->dev); - - return 0; + return devm_snd_soc_register_component(&pdev->dev, &spdif_in_component, + &spdif_in_dai, 1); }
static struct platform_driver spdif_in_driver = { .probe = spdif_in_probe, - .remove = spdif_in_remove, .driver = { .name = "spdif-in", .owner = THIS_MODULE,
devm_snd_soc_register_component makes code simpler.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- sound/soc/spear/spdif_out.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 2fdf68c..70fc4d6 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -307,18 +307,11 @@ static int spdif_out_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, host);
- ret = snd_soc_register_component(&pdev->dev, &spdif_out_component, - &spdif_out_dai, 1); + ret = devm_snd_soc_register_component(&pdev->dev, &spdif_out_component, + &spdif_out_dai, 1); return ret; }
-static int spdif_out_remove(struct platform_device *pdev) -{ - snd_soc_unregister_component(&pdev->dev); - - return 0; -} - #ifdef CONFIG_PM static int spdif_out_suspend(struct device *dev) { @@ -357,7 +350,6 @@ static SIMPLE_DEV_PM_OPS(spdif_out_dev_pm_ops, spdif_out_suspend, \
static struct platform_driver spdif_out_driver = { .probe = spdif_out_probe, - .remove = spdif_out_remove, .driver = { .name = "spdif-out", .owner = THIS_MODULE,
On Tue, Sep 17, 2013 at 10:41 AM, Sachin Kamat sachin.kamat@linaro.org wrote:
devm_snd_soc_register_component makes code simpler.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org
sound/soc/spear/spdif_out.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/sound/soc/spear/spdif_out.c b/sound/soc/spear/spdif_out.c index 2fdf68c..70fc4d6 100644 --- a/sound/soc/spear/spdif_out.c +++ b/sound/soc/spear/spdif_out.c @@ -307,18 +307,11 @@ static int spdif_out_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, host);
ret = snd_soc_register_component(&pdev->dev, &spdif_out_component,
&spdif_out_dai, 1);
ret = devm_snd_soc_register_component(&pdev->dev, &spdif_out_component,
&spdif_out_dai, 1); return ret;
}
What about doing return devm_snd_soc_register_component(***) here? And same for the other patch?
Acked-by: Viresh Kumar viresh.kumar@linaro.org
On 17 September 2013 11:04, Viresh Kumar viresh.kumar@linaro.org wrote:
On Tue, Sep 17, 2013 at 10:41 AM, Sachin Kamat sachin.kamat@linaro.org wrote:
devm_snd_soc_register_component makes code simpler.
ret = devm_snd_soc_register_component(&pdev->dev, &spdif_out_component,
&spdif_out_dai, 1); return ret;
}
What about doing return devm_snd_soc_register_component(***) here? And same for the other patch?
The other patch already has it. I will do this as part of follow-on cleanup patch as it makes 'ret' unused after that.
Acked-by: Viresh Kumar viresh.kumar@linaro.org
Thanks.
On Tue, Sep 17, 2013 at 10:41 AM, Sachin Kamat sachin.kamat@linaro.org wrote:
devm_snd_soc_register_component makes code simpler.
Signed-off-by: Sachin Kamat sachin.kamat@linaro.org
sound/soc/spear/spdif_in.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
Acked-by: Viresh Kumar viresh.kumar@linaro.org
participants (3)
-
Mark Brown
-
Sachin Kamat
-
Viresh Kumar