Commit 3a4250d4 authored by Chaithrika U S's avatar Chaithrika U S Committed by Kevin Hilman

ASoC: DaVinci: fix 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: default avatarChaithrika U S <chaithrika@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 582ad6bc
......@@ -225,7 +225,7 @@ 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 = data;
platform_device_add_data(evm_snd_device, data, sizeof(data));
ret = platform_device_add_resources(evm_snd_device, resources, 1);
if (ret) {
......
......@@ -127,7 +127,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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment