From: Wolfgang Denk Date: Thu, 07 Feb 2013 17:58:19 +0100 Subject: [U-Boot] [PATCH] env: Allow accessing non-mtd devices In-Reply-To: <1360244552.29426.9.camel@hobbes> References: <1359589584-19846-1-git-send-email-lkundrak@v3.sk> <20130131064855.D072E20059E@gemini.denx.de> <1359630144.16475.6.camel@hobbes> <20130131141021.58DE520059E@gemini.denx.de> <1360191866.3594.10.camel@unicorn> <20130206232121.2D31B200564@gemini.denx.de> <1360244552.29426.9.camel@hobbes> Message-ID: <20130207165819.700DE200565@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 Dear Lubomir, In message <1360244552.29426.9.camel@hobbes> you wrote: > > > You should define something like MTD_NO_FLASH or so, and use that. > > I found it a bit more abusive to use a MTD_* macro in mtd_type variable > for something what is not actually a type of a MTD device, specially > when a change in MTD ABI would be needed. But that's exactly what you are doing here, just in a way that it is not even visible. By assigning a mtd_type value of 0, you are setting it to MTD_ABSENT - but you don't write MTD_ABSENT. This is even more dangerous. > Maybe passing a NULL mtd_info_user pointer to flash_{read,write}_buf() > instead of zero type (which happens to be MTD_ABSENT, and, as you > pointed out, a misuse) would make more sense for a non-MTD file? I don't have any real problems with using MTD_ABSENT - it even makes kind of sense. 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 "Beware of programmers carrying screwdrivers." - Chip Salzenberg