[alsa-devel] [PATCH 1/1] ALSA: ASoC: DaVinci: Fix SFFSDR init bug.
Removed call to machine_is_sffsdr() in module init function because it always returns zero and causes GCC to optimise and remove all functions of the module.
Signed-off-by: Hugo Villeneuve hugo@hugovil.com --- sound/soc/davinci/davinci-sffsdr.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 1bbde3e..3e8e6cd 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -115,9 +115,6 @@ static int __init sffsdr_init(void) { int ret;
- if (!machine_is_sffsdr()) - return -EINVAL; - sffsdr_snd_device = platform_device_alloc("soc-audio", 0); if (!sffsdr_snd_device) { printk(KERN_ERR "platform device allocation failed\n");
On Thu, Jan 15, 2009 at 03:39:52PM -0500, Hugo Villeneuve wrote:
Removed call to machine_is_sffsdr() in module init function because it always returns zero and causes GCC to optimise and remove all functions of the module.
Signed-off-by: Hugo Villeneuve hugo@hugovil.com
This should be replaced with the appropriate machine_is_() call for the system.
On Thu, 15 Jan 2009 20:57:53 +0000 Mark Brown broonie@sirena.org.uk wrote:
On Thu, Jan 15, 2009 at 03:39:52PM -0500, Hugo Villeneuve wrote:
Removed call to machine_is_sffsdr() in module init function because it always returns zero and causes GCC to optimise and remove all functions of the module.
Signed-off-by: Hugo Villeneuve hugo@hugovil.com
This should be replaced with the appropriate machine_is_() call for the system.
It is the appropriate call, but at compile time it always return false.
Hugo.
--------------- Hugo Villeneuve www.hugovil.com ---------------
On Thu, Jan 15, 2009 at 04:02:57PM -0500, Hugo Villeneuve wrote:
On Thu, 15 Jan 2009 20:57:53 +0000 Mark Brown broonie@sirena.org.uk wrote:
This should be replaced with the appropriate machine_is_() call for the system.
It is the appropriate call, but at compile time it always return false.
Sounds like that should be fixed instead, then?
On Thu, 15 Jan 2009 21:09:12 +0000 Mark Brown broonie@sirena.org.uk wrote:
On Thu, Jan 15, 2009 at 04:02:57PM -0500, Hugo Villeneuve wrote:
On Thu, 15 Jan 2009 20:57:53 +0000 Mark Brown broonie@sirena.org.uk wrote:
This should be replaced with the appropriate machine_is_() call for the system.
It is the appropriate call, but at compile time it always return false.
Sounds like that should be fixed instead, then?
If someone wants to fix it, fine. I tried but couldnĀ“t find what is wrong. Maybe the person who added that piece of code (not me) should fix it...
Ciao, Hugo.
--------------- Hugo Villeneuve www.hugovil.com ---------------
On Thu, Jan 15, 2009 at 04:17:00PM -0500, Hugo Villeneuve wrote:
Mark Brown broonie@sirena.org.uk wrote:
Sounds like that should be fixed instead, then?
If someone wants to fix it, fine. I tried but couldn?t find what is wrong. Maybe the person who added that piece of code (not me) should fix it...
It was added by David Brownell to prevent the module being used on the wrong hardware, which is perfectly reasonable. The machine_is_foo() tests are a very standard part of the ARM infrastructure and are widely used - if they're not working that's where the fix is. Are you sure that your .config has MACH_SFFSDR set? There appears to be no mainline support for the core machine so you'd have to have patched that in...
On Thu, 15 Jan 2009 21:40:41 +0000 Mark Brown broonie@sirena.org.uk wrote:
On Thu, Jan 15, 2009 at 04:17:00PM -0500, Hugo Villeneuve wrote:
Mark Brown broonie@sirena.org.uk wrote:
Sounds like that should be fixed instead, then?
If someone wants to fix it, fine. I tried but couldn?t find what is wrong. Maybe the person who added that piece of code (not me) should fix it...
It was added by David Brownell to prevent the module being used on the wrong hardware, which is perfectly reasonable. The machine_is_foo() tests are a very standard part of the ARM infrastructure and are widely used - if they're not working that's where the fix is. Are you sure that your .config has MACH_SFFSDR set? There appears to be no mainline support for the core machine so you'd have to have patched that in...
I just found the cause. I created the SFFSDR machine on the ARM website, and this automatically defined the macro CONFIG_MACH_SFFSDR, and not CONFIG_MACH_DAVINCI_SFFSDR like it is currently in the Kconfig.
I will submit a patch to rename CONFIG_MACH_DAVINCI_SFFSDR to CONFIG_MACH_SFFSDR in the Kconfig file.
Thank-you everyone for your help.
Hugo.
--------------- Hugo Villeneuve www.hugovil.com ---------------
On Thu, 2009-01-15 at 16:17 -0500, Hugo Villeneuve wrote:
On Thu, 15 Jan 2009 21:09:12 +0000 Mark Brown broonie@sirena.org.uk wrote:
On Thu, Jan 15, 2009 at 04:02:57PM -0500, Hugo Villeneuve wrote:
On Thu, 15 Jan 2009 20:57:53 +0000 Mark Brown broonie@sirena.org.uk wrote:
This should be replaced with the appropriate machine_is_() call for the system.
It is the appropriate call, but at compile time it always return false.
Sounds like that should be fixed instead, then?
If someone wants to fix it, fine. I tried but couldnĀ“t find what is wrong. Maybe the person who added that piece of code (not me) should fix it...
Just to verify the obvious, the u-boot is supplying the correct machine type to the kernel right?
Ciao, Hugo.
Hugo Villeneuve www.hugovil.com
Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
On Thursday 15 January 2009, Hugo Villeneuve wrote:
Removed call to machine_is_sffsdr() in module init function because it always returns zero and causes GCC to optimise and remove all functions of the module.
Signed-off-by: Hugo Villeneuve hugo@hugovil.com
NAK. Enable the SFF board in Kconfig, and it won't be returning false. If you don't enable it, you can't possibly be running on an SFF board, and so there's no reason to include any of these function...
sound/soc/davinci/davinci-sffsdr.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c index 1bbde3e..3e8e6cd 100644 --- a/sound/soc/davinci/davinci-sffsdr.c +++ b/sound/soc/davinci/davinci-sffsdr.c @@ -115,9 +115,6 @@ static int __init sffsdr_init(void) { int ret;
- if (!machine_is_sffsdr())
return -EINVAL;
- sffsdr_snd_device = platform_device_alloc("soc-audio", 0); if (!sffsdr_snd_device) { printk(KERN_ERR "platform device allocation failed\n");
-- 1.5.4.5
Davinci-linux-open-source mailing list Davinci-linux-open-source@linux.davincidsp.com http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
participants (4)
-
David Brownell
-
Hugo Villeneuve
-
Mark Brown
-
Steve Chen