[PATCH V3 3/8] drivers/mtd: transfer NAND notions to MTD core

Sascha Hauer s.hauer at pengutronix.de
Wed Dec 21 06:25:21 EST 2011


On Mon, Dec 19, 2011 at 03:04:04PM +0100, Robert Jarzmik wrote:
> Change NAND_WRITE into MTD_WRITE.
> Change "page_shift" references in the core, which are purely
> NAND, into mtd->writesize which is MTD generic.
> Rename all "info" (struct mtd_info) into "mtd".
> 
> Beware, bisection is broken here as driver name changes from
> /dev/nand<N> into /dev/mtd<N>.

Indeed, this patch should be after the next one.

>  	ops.oobbuf = buf;
>  	ops.datbuf = NULL;
> -	ops.len = info->oobsize;
> -
> -	offset /= info->oobsize;
> -	ret = info->read_oob(info, offset << chip->page_shift, &ops);
> +	ops.len = mtd->oobsize;
> +
> +	offset /= mtd->oobsize;
> +	/*
> +	 * This seems suspicious, shouldn't it be :
> +	 *   offset / mtd->oobsize * mtd->writesize
> +	 */
> +	ret = mtd->read_oob(mtd, offset * mtd->writesize, &ops);

directly before this comment we have 'offset /= mtd->oobsize', so in fact
we really have 'offset / mtd->oobsize * mtd->writesize'.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list