|To:||Ralf Baechle <email@example.com>|
|Subject:||Re: [PATCH] IDE: Fix platform device registration in Swarm IDE driver|
|From:||Sergei Shtylyov <firstname.lastname@example.org>|
|Date:||Sun, 28 Sep 2008 16:51:08 +0400|
|Cc:||email@example.com, firstname.lastname@example.org, "Maciej W. Rozycki" <email@example.com>, firstname.lastname@example.org|
|Organization:||MontaVista Software Inc.|
|References:||<20080922122853.GA15210@linux-mips.org> <48DA1F9D.email@example.com> <20080928114711.GB9207@linux-mips.org>|
|User-agent:||Mozilla/5.0 (X11; U; Linux i686; rv:1.7.2) Gecko/20040803|
Hello. Ralf Baechle wrote:
+ pdev = platform_device_register_simple(DEV_NAME, -1, + swarm_ide_resource, ARRAY_SIZE(swarm_ide_resource));
If you have the resources as static array anyway, why not have the device in the static variable too and use platform_device_register()?
It saves a few lines of code.
And wastes few words of static data since platform_device_register_simple() will kmalloc() the resources and do a copy from these resources after which they are not needed -- so, it's worth making swarm_ide_resource __initdata at least. If you were using platform_device_register() with static platform device, no memory allocation would have happened, and no data would have been wasted.
|<Prev in Thread]||Current Thread||[Next in Thread>|
|Previous by Date:||Re: [PATCH] IDE: Fix platform device registration in Swarm IDE driver, Ralf Baechle|
|Next by Date:||Re: [PATCH] IDE: Fix platform device registration in Swarm IDE driver, Sergei Shtylyov|
|Previous by Thread:||Re: [PATCH] IDE: Fix platform device registration in Swarm IDE driver, Ralf Baechle|
|Next by Thread:||Re: [PATCH] IDE: Fix platform device registration in Swarm IDE driver, Geert Uytterhoeven|
|Indexes:||[Date] [Thread] [Top] [All Lists]|