From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Gortmaker Subject: Re: [PATCH v18 6/6] ARM: socfpga: fpga bridge driver support Date: Tue, 9 Aug 2016 12:00:39 -0400 Message-ID: <20160809160039.GX29630@windriver.com> References: <20160712193645.9098-1-atull@opensource.altera.com> <20160712193645.9098-7-atull@opensource.altera.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Moritz Fischer Cc: atull , Rob Herring , Mark Rutland , Greg Kroah-Hartman , Ian Campbell , Dinh Nguyen , Devicetree List , "linux-arm-kernel@lists.infradead.org" , LKML , Alan Tull , Matthew Gerlach List-Id: devicetree@vger.kernel.org [Re: [PATCH v18 6/6] ARM: socfpga: fpga bridge driver support] On 08/08/2016 (Mon 13:44) Moritz Fischer wrote: > Hi Alan, > > On Mon, Aug 8, 2016 at 12:18 PM, atull wrote: > > >> Please don't use module.h in drivers controlled by a bool > >> Kconfig setting. > >> > >> THanks, > >> Paul. > >> > > > > Thanks for the feedback. Can you provide an example of what you > > would consider to be proper usage in the kernel? > > > I think Paul is suggesting to use > > static int __init alt_fpga_bridge_init(void) > { > platform_driver_register(&alt_fpga_bridge_driver); > } > > device_initcall(alt_fpga_bridge_init); > > or better: > > builtin_platform_driver(&alt_fpga_bridge_driver); > > Like for example in: drivers/cpuidle/cpuidle-mvebu-v7.c Yes, pretty much that -- if you have a bool Kconfig, you should be using builtin registration functions, and have no need for module.h or anything MODULE_ or any module_init/module_exit calls. An empty file containing nothing but #include will cause cpp to emit about 750k of goop, so we really should only be using it for drivers that are genuinely modular; i.e. tristate Kconfig. Thanks, Paul. -- > > Cheers, > > Moritz