From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Tue, 11 Oct 2011 19:30:24 +0200 Subject: [U-Boot] [PATCH V3 05/13] i2c: Create common default i2c_set_bus_num() function In-Reply-To: <201110101351.31460.vapier@gentoo.org> References: <1318091769-30979-1-git-send-email-sbabic@denx.de> <201110101119.48636.vapier@gentoo.org> <4E930FDB.2000202@denx.de> <201110101351.31460.vapier@gentoo.org> Message-ID: <4E947D30.4020904@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/10/2011 07:51 PM, Mike Frysinger wrote: Hi Mike, > i believe we have two standards. Well, two standards means we have no standard...;-) > i'm not sure which gets used more, or if > it's just a wash. i think it makes sense to have an accessible default func > if it does something useful, but not if it's just a stub. > > in the __def/weak style above, unless people use --gc-sections when linking (i > think we've got many people doing this now, but not all), you end up with dead > code in the binary. in the code i proposed, the func gets discarded both when > using --gc-sections and when not. You are right, but probably it makes no difference. I checked and it seems that only a few architectute (m68k, sparc and microblaze) do not set --gc-sections. After the Heiko's post and our discussion, I think that this patch is another work-around waiting for the Heiko's patches to go to mainline. And it becomes a second work-around, because there is already the I2C_SET_BUS() for boards supporting only one bus. Two work-around are too much... I drop this patch and I will make use of I2C_SET_BUS() in pmic. This is coherent with the actual u-boot code. Regards, Stefano -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de =====================================================================