From: Wolfgang Denk Date: Mon, 20 Aug 2007 01:29:36 +0200 Subject: [U-Boot-Users] FIX: dataflash.c In-Reply-To: Your message of "Sun, 19 Aug 2007 23:37:16 +0200." <1defaf580708191437p19e70b02t43f5bcb5dc986e5c@mail.gmail.com> Message-ID: <20070819232936.C81BF24050@gemini.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 In message <1defaf580708191437p19e70b02t43f5bcb5dc986e5c@mail.gmail.com> you wrote: > On 8/19/07, Wolfgang Denk wrote: > > In message <20070818231206.GA4040@gandalf.sssup.it> you wrote: > > > --- drivers/dataflash.c.orig 2007-08-18 17:36:08.000000000 +0200 > > > +++ drivers/dataflash.c 2007-08-18 17:37:05.000000000 +0200 > > > @@ -27,16 +27,16 @@ AT91S_DATAFLASH_INFO dataflash_info[CFG_ > > > static AT91S_DataFlash DataFlashInst; > > > > > > #ifdef CONFIG_AT91SAM9260EK > > > -int cs[][CFG_MAX_DATAFLASH_BANKS] = { > > > +int cs[][2] = { > > > {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */ > > > {CFG_DATAFLASH_LOGIC_ADDR_CS1, 1} > > > }; > > > #elif defined(CONFIG_AT91SAM9263EK) > > > -int cs[][CFG_MAX_DATAFLASH_BANKS] = { > > > +int cs[][2] = { > > > {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0} /* Logical adress, CS */ > > > }; > > > #else > > > -int cs[][CFG_MAX_DATAFLASH_BANKS] = { > > > +int cs[][2] = { > > > {CFG_DATAFLASH_LOGIC_ADDR_CS0, 0}, /* Logical adress, CS */ > > > {CFG_DATAFLASH_LOGIC_ADDR_CS3, 3} > > > }; > > Why not call it dataflash_cs[] and move it into the board code? It > already pollutes the namespace, is already board-dependent (hence the > #ifdefs) and is apparently buggy? Excellent idea. > Then the board code is responsible for defining a > CFG_MAX_DATAFLASH_BANKS symbol which corresponds with the actual > number of entries in the array. Of course, it can still be buggy, but > at least it's contained within the board code. I agree completely. Who will provide such a patch? Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Der Horizont vieler Menschen ist ein Kreis mit Radius Null -- und das nennen sie ihren Standpunkt.