diff mbox

ASoC: qcom: apq8096: set card as device drvdata

Message ID 1528275324-4878-1-git-send-email-rohitkr@codeaurora.org (mailing list archive)
State Accepted
Commit d5c4e972d512ae0b59108ca92b9b35bc5cf5c14e
Headers show

Commit Message

Rohit Kumar June 6, 2018, 8:55 a.m. UTC
snd_soc_card is retrieved as device drvdata during unbind().
Set it as drvdata during bind() to avoid memory corruption during
unbind().

Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
---
 sound/soc/qcom/apq8096.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Srinivas Kandagatla June 6, 2018, 9:16 a.m. UTC | #1
On 06/06/18 09:55, Rohit kumar wrote:
> snd_soc_card is retrieved as device drvdata during unbind().
> Set it as drvdata during bind() to avoid memory corruption during
> unbind().
> 
> Signed-off-by: Rohit kumar <rohitkr@codeaurora.org>
Thanks for the patch,

Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


> ---
>   sound/soc/qcom/apq8096.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c
> index 561cd42..239b8cb 100644
> --- a/sound/soc/qcom/apq8096.c
> +++ b/sound/soc/qcom/apq8096.c
> @@ -140,6 +140,7 @@ static int apq8096_bind(struct device *dev)
>   
>   	component_bind_all(dev, card);
>   	card->dev = dev;
> +	dev_set_drvdata(dev, card);
>   	ret = apq8096_sbc_parse_of(card);
>   	if (ret) {
>   		dev_err(dev, "Error parsing OF data\n");
>
diff mbox

Patch

diff --git a/sound/soc/qcom/apq8096.c b/sound/soc/qcom/apq8096.c
index 561cd42..239b8cb 100644
--- a/sound/soc/qcom/apq8096.c
+++ b/sound/soc/qcom/apq8096.c
@@ -140,6 +140,7 @@  static int apq8096_bind(struct device *dev)
 
 	component_bind_all(dev, card);
 	card->dev = dev;
+	dev_set_drvdata(dev, card);
 	ret = apq8096_sbc_parse_of(card);
 	if (ret) {
 		dev_err(dev, "Error parsing OF data\n");