[RFC/PATCH 1/3] NAND multiple plane feature

Jörn Engel joern at logfs.org
Tue Jun 3 13:25:56 EDT 2008


On Wed, 28 May 2008 13:41:46 +0100, Alexey Korolev wrote:
> diff -Nurp linux-2.6.24.3/drivers/mtd/nand/nand_base.c linux-2.6.24.3-dp/drivers/mtd/nand/nand_base.c
> --- linux-2.6.24.3/drivers/mtd/nand/nand_base.c	2008-02-26 03:20:20.000000000 +0300
> +++ linux-2.6.24.3-dp/drivers/mtd/nand/nand_base.c	2008-05-28 02:06:01.000000000 +0400
> @@ -2259,10 +2367,15 @@ static struct nand_flash_dev *nand_get_f
>  	/* Newer devices have all the information in additional id bytes */
>  	if (!type->pagesize) {
>  		int extid;
> +		int planeid;
>  		/* The 3rd id byte holds MLC / multichip data */
>  		chip->cellinfo = chip->read_byte(mtd);
>  		/* The 4th id byte is the important one */
>  		extid = chip->read_byte(mtd);
> +		/* The 5th id byte contains number of planes */
> +		planeid = chip->read_byte(mtd);
> +		/* Number of planes*/

This comment seems redundant.  And it fooled me for a few seconds.
Remove it?

> +		chip->numplanes = 1 << ((planeid >> 2) & 0x03);
>  		/* Calc pagesize */
>  		mtd->writesize = 1024 << (extid & 0x3);
>  		extid >>= 2;

Jörn

-- 
Fools ignore complexity.  Pragmatists suffer it.
Some can avoid it.  Geniuses remove it.
-- Perlis's Programming Proverb #58, SIGPLAN Notices, Sept.  1982



More information about the linux-mtd mailing list