[alsa-devel] [PATCH] wm1133-ev1: fix init for multimachine kernel

Eric Bénard eric at eukrea.com
Thu Oct 21 23:35:15 CEST 2010

when running a kernel built using mx3_defconfig, I get an error message
because wm1133-ev1 tries to alloc soc-audio even if not running on an
iMX31ads :
sysfs: cannot create duplicate filename '/devices/platform/soc-audio'
kobject_add_internal failed for soc-audio with -EEXIST, don't try to register things with the same name in the same directory.

This patch fix this problem.

Signed-off-by: Eric Bénard <eric at eukrea.com>
Cc: Liam Girdwood <lrg at slimlogic.co.uk>
Cc: Mark Brown <broonie at opensource.wolfsonmicro.com>
 sound/soc/imx/wm1133-ev1.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/sound/soc/imx/wm1133-ev1.c b/sound/soc/imx/wm1133-ev1.c
index a6e7d94..ef37440 100644
--- a/sound/soc/imx/wm1133-ev1.c
+++ b/sound/soc/imx/wm1133-ev1.c
@@ -20,6 +20,7 @@
 #include <sound/pcm_params.h>
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
+#include <asm/mach-types.h>
 #include <mach/audmux.h>
@@ -269,6 +270,10 @@ static int __init wm1133_ev1_audio_init(void)
 	int ret;
 	unsigned int ptcr, pdcr;
+	if (!machine_is_mx31ads())
+		/* return happy. We might run on a totally different machine */
+		return 0;
 	/* SSI0 mastered by port 5 */

More information about the Alsa-devel mailing list