]> err.no Git - linux-2.6/blobdiff - drivers/mtd/devices/mtd_dataflash.c
Pull esi-support into release branch
[linux-2.6] / drivers / mtd / devices / mtd_dataflash.c
index 155737e7483f666d9ac11bfd44a298b311ad578f..5db71604592789492a5718150d9659d1d0455b77 100644 (file)
@@ -9,7 +9,6 @@
  * as published by the Free Software Foundation; either version
  * 2 of the License, or (at your option) any later version.
 */
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
@@ -178,7 +177,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr)
                 * we're at a block boundary and need to erase the whole block.
                 */
                pageaddr = instr->addr / priv->page_size;
-               do_block = (pageaddr & 0x7) == 0 && instr->len <= blocksize;
+               do_block = (pageaddr & 0x7) == 0 && instr->len >= blocksize;
                pageaddr = pageaddr << priv->page_offset;
 
                command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE;
@@ -478,6 +477,7 @@ add_dataflash(struct spi_device *spi, char *name,
        device->name = (pdata && pdata->name) ? pdata->name : priv->name;
        device->size = nr_pages * pagesize;
        device->erasesize = pagesize;
+       device->writesize = pagesize;
        device->owner = THIS_MODULE;
        device->type = MTD_DATAFLASH;
        device->flags = MTD_CAP_NORFLASH;