spi-nand: Fix out-of-band operations

The SPI NAND driver was taking dev->oob_per_page to hold the number
of OOB bytes to be read.

This usage was based from the ipq_nand.c. However, in SPI NAND the
there's only a single OOB size to be read, which is stored in
mtd->oobsize and there's no need for a separate dev->oob_per_page field.

Also, dev->oob_per_page is not initialized, which results in out-of-bands
operations being currently broken.

This commit replaces each usage of dev->oob_per_page with mtd->oobsize,
fixing out-of-band operations (e.g. block_is_bad).

BUG=chrome-os-partner:35348
TEST=Added some code to scan bad blocks by testing each eraseblock.
The result with Pistachio BuB is:
  Opening a stream offset=0 size=20000000
  scanning 2048 blocks
  bad block 1536
  bad block 1537
BRANCH=none

Change-Id: I81ec8a702d81cfd9d678663a4c0a9ce68fced413
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
Reviewed-on: https://chromium-review.googlesource.com/248690
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
Reviewed-by: Daniel Ehrenberg <dehrenberg@chromium.org>
Tested-by: Daniel Ehrenberg <dehrenberg@chromium.org>
1 file changed