From: Paul Mackerras Date: Sun, 23 Apr 2006 00:42:04 +0000 (+1000) Subject: powerpc: Fix define_machine so machine_is() works from modules X-Git-Tag: v2.6.17-rc3~31^2 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0e15bed84db7a9b0ea85d2ad9707b5e6d2e38da;p=linux-2.6 powerpc: Fix define_machine so machine_is() works from modules machine_is() was always returning 0 when used in a module, because we weren't exporting the machine definitions. This was why sound wasn't working on powermacs when CONFIG_SND_POWERMAC=m. Original fix from Ben Herrenschmidt, further fixed by me. Signed-off-by: Paul Mackerras --- diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h index 5ed8476807..0f9254c189 100644 --- a/include/asm-powerpc/machdep.h +++ b/include/asm-powerpc/machdep.h @@ -253,7 +253,11 @@ extern struct machdep_calls *machine_id; #define __machine_desc __attribute__ ((__section__ (".machine.desc"))) -#define define_machine(name) struct machdep_calls mach_##name __machine_desc = +#define define_machine(name) \ + extern struct machdep_calls mach_##name; \ + EXPORT_SYMBOL(mach_##name); \ + struct machdep_calls mach_##name __machine_desc = + #define machine_is(name) \ ({ \ extern struct machdep_calls mach_##name \