ASoC: Fix DaVinci module unload error

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 12:07 pm

Gitweb:     http://git.kernel.org/linus/bf3dbe5c8c4b85f98c36d35432efa6573b75e6d3
Commit:     bf3dbe5c8c4b85f98c36d35432efa6573b75e6d3
Parent:     f1464ede550b8fda75086cb9bacf8d60fc9f6780
Author:     Kevin Hilman <khilman@deeprootsystems.com>
AuthorDate: Fri Feb 13 11:36:37 2009 -0800
Committer:  Mark Brown <broonie@opensource.wolfsonmicro.com>
CommitDate: Fri Feb 13 20:21:30 2009 +0000

    ASoC: Fix DaVinci module unload error
    
    Fix for the error when the audio module is unloaded.  On unregistering
    the platform_device, platform_device_release will free the platform
    data.If platform data is static the kernel panics when it is freed.
    Instead use the platform device helper function to add data.
    
    This change has been tested on DM644x EVM, DM644x SFFSDR and DM355 EVM.
    
    Signed-off-by: Chaithrika U S <chaithrika@ti.com>
    Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
---
 sound/soc/davinci/davinci-evm.c    |    3 ++-
 sound/soc/davinci/davinci-sffsdr.c |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c
index 54851f3..9b90b34 100644
--- a/sound/soc/davinci/davinci-evm.c
+++ b/sound/soc/davinci/davinci-evm.c
@@ -186,7 +186,8 @@ static int __init evm_init(void)
 
 	platform_set_drvdata(evm_snd_device, &evm_snd_devdata);
 	evm_snd_devdata.dev = &evm_snd_device->dev;
-	evm_snd_device->dev.platform_data = &evm_snd_data;
+	platform_device_add_data(evm_snd_device, &evm_snd_data,
+				 sizeof(evm_snd_data));
 
 	ret = platform_device_add_resources(evm_snd_device, evm_snd_resources,
 					    ARRAY_SIZE(evm_snd_resources));
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
index 50baef1..0bf81ab 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -141,7 +141,8 @@ static int __init sffsdr_init(void)
 
 	platform_set_drvdata(sffsdr_snd_device, &sffsdr_snd_devdata);
 	sffsdr_snd_devdata.dev = &sffsdr_snd_device->dev;
-	sffsdr_snd_device->dev.platform_data = &sffsdr_snd_data;
+	platform_device_add_data(sffsdr_snd_device, &sffsdr_snd_data,
+				 sizeof(sffsdr_snd_data));
 
 	ret = platform_device_add_resources(sffsdr_snd_device,
 					    sffsdr_snd_resources,
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ASoC: Fix DaVinci module unload error, Linux Kernel Mailing ..., (Thu Mar 26, 12:07 pm)