Skip to content

Commit

Permalink
ASoC: Fix DaVinci module unload error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Kevin Hilman authored and Mark Brown committed Feb 13, 2009
1 parent f1464ed commit bf3dbe5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion sound/soc/davinci/davinci-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
3 changes: 2 additions & 1 deletion sound/soc/davinci/davinci-sffsdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bf3dbe5

Please sign in to comment.