2017-08-20 05:44:03

by Donglin Peng

[permalink] [raw]
Subject: [PATCH 08/12] ASoC: qcom: Remove useless function call

The function platform_set_drvdata(pdev, data) copies the value of
the variable data to pdev->dev.driver_data,but when calling
snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
will override it, so i think that the former copy operation is
useless and can be removed.

Signed-off-by: Peng Donglin <[email protected]>
---
sound/soc/qcom/apq8016_sbc.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
index d084d74..5292591 100644
--- a/sound/soc/qcom/apq8016_sbc.c
+++ b/sound/soc/qcom/apq8016_sbc.c
@@ -191,7 +191,6 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev)
if (IS_ERR(data->spkr_iomux))
return PTR_ERR(data->spkr_iomux);

- platform_set_drvdata(pdev, data);
snd_soc_card_set_drvdata(card, data);

return devm_snd_soc_register_card(&pdev->dev, card);
--
1.9.1


2017-08-21 08:08:30

by Banajit Goswami

[permalink] [raw]
Subject: Re: [alsa-devel] [PATCH 08/12] ASoC: qcom: Remove useless function call

On Sun, Aug 20, 2017 at 01:43:57PM +0800, Peng Donglin wrote:
> The function platform_set_drvdata(pdev, data) copies the value of
> the variable data to pdev->dev.driver_data,but when calling
> snd_soc_register_card,the function dev_set_drvdata(card->dev, card)
> will override it, so i think that the former copy operation is
> useless and can be removed.
>
> Signed-off-by: Peng Donglin <[email protected]>

Acked-by: Banajit Goswami <[email protected]>

> ---
> sound/soc/qcom/apq8016_sbc.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/sound/soc/qcom/apq8016_sbc.c b/sound/soc/qcom/apq8016_sbc.c
> index d084d74..5292591 100644
> --- a/sound/soc/qcom/apq8016_sbc.c
> +++ b/sound/soc/qcom/apq8016_sbc.c
> @@ -191,7 +191,6 @@ static int apq8016_sbc_platform_probe(struct platform_device *pdev)
> if (IS_ERR(data->spkr_iomux))
> return PTR_ERR(data->spkr_iomux);
>
> - platform_set_drvdata(pdev, data);
> snd_soc_card_set_drvdata(card, data);
>
> return devm_snd_soc_register_card(&pdev->dev, card);
> --
> 1.9.1
>
> _______________________________________________
> Alsa-devel mailing list
> [email protected]
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel