From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Warren Date: Wed, 26 Mar 2008 10:15:20 -0400 Subject: [U-Boot-Users] [RFC][PATCH 1/1] Add board_eth_init() function In-Reply-To: <20080326134131.6f13fec0@hskinnemo-gx620.norway.atmel.com> References: <47E472FD.7010907@gmail.com> <47E49320.1080504@ruby.dti.ne.jp> <47E52BEB.90600@comsys.ro> <47E5F68B.503@ruby.dti.ne.jp> <20080326110012.78be5034@hskinnemo-gx620.norway.atmel.com> <47EA35EE.40804@ruby.dti.ne.jp> <20080326134131.6f13fec0@hskinnemo-gx620.norway.atmel.com> Message-ID: <47EA5A78.1000804@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Haavard Skinnemoen wrote: > On Wed, 26 Mar 2008 20:39:26 +0900 > Shinya Kuribayashi wrote: > > >> I just thought that, a header file full of driver-specific declarations, >> is somewhat ugly. >> > > The functions must be declared somewhere, but declaring them at the > callsite is not only ugly, but error-prone as well. > > One alternative might be to add one header file per driver and put the > declarations there. Maybe we should add a include/netdev directory for > network driver-specific header files? > > Haavard > > No, I like the way I did it with a single header file for all interfaces. It's not ugly - externs in every board file or a directory of tiny header files or the existing #ifdef mess is ugly. One header file means one-stop-shopping for finding a controller's interface. The only thing that might be better is to #include netdev.h in common.h, getting rid of the requirement to include it in each board file. OTOH, cascading header files is itself an ugly practice. In an entirely biased way, I think the way I've implemented this is a big improvement over the status quo and should make things easier going forward. regards, Ben