How to count NAND bad block from user space?

Ricard Wanderlof ricard.wanderlof at axis.com
Fri Nov 9 07:36:05 EST 2007


On Fri, 9 Nov 2007, navigator.atreides at gmail.com wrote:

> I want to count number of the bad blocks on the nand device, so being
> inspired by ~/mtd/util/flash_eraseall.c I used follow call
>
> int ret = ioctl(fd, MEMGETBADBLOCK, &offset);
>
> as badness measure for block ( if (ret > 0) ).
>
> Could you please point me out if I'm on the right way?
> ...

Without having tried the code, looks good to me.

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list