[PATCH 16/17] mach-sa1100: retire custom LED code

Arnd Bergmann arnd at arndb.de
Tue Jul 12 08:52:14 EDT 2011


On Tuesday 12 July 2011, Russell King - ARM Linux wrote:
> On Tue, Jul 12, 2011 at 08:31:28AM +0800, Bryan Wu wrote:
> > I think this is a great idea. what about moving it to include/asm-generic/

I wouldn't want to encourage new architectures to actually use this method
until they grow to need it. For most simple architectures, it's probably
better to have a different method of doing machine specific work.

> Except, instead of:
> 
> 		if (machine_is(mach)) return fn(); \
> 
> we'd need:
> 
> 		if (machine_is_##mach()) return fn(); \

Right. Maybe we can start simple and just do a single definition at fs_initcall level:

#define machine_initcall(mach,level,fn) \
        static int __init __machine_initcall_##mach##_##fn(void) { \
                if (machine_is ## mach()) return fn(); \
                return 0; \
        } \
        fs_initcall(,__machine_initcall_##mach##_##fn);


	Arnd



More information about the linux-arm-kernel mailing list