apanic: fix rknand erase
author黄涛 <huangtao@rock-chips.com>
Mon, 21 Feb 2011 03:28:12 +0000 (11:28 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Feb 2011 03:28:12 +0000 (11:28 +0800)
drivers/misc/apanic.c

index 0eb7ed6be672617a4315fd4167c2ce81a3019175..4a9f48ac74802447b5d2397a7e819fe36ef36676 100644 (file)
@@ -216,8 +216,8 @@ static void mtd_panic_erase(void)
        struct apanic_data *ctx = &drv_ctx;
 #ifdef CONFIG_MTD_RKNAND
        size_t wlen;
-       memset(ctx->bounce, 0, sizeof(struct panic_header));
-       ctx->mtd->write(ctx->mtd, 0, sizeof(struct panic_header), &wlen, ctx->bounce);
+       memset(ctx->bounce, 0, ctx->mtd->writesize);
+       ctx->mtd->write(ctx->mtd, 0, ctx->mtd->writesize, &wlen, ctx->bounce);
 #else
        struct erase_info erase;
        DECLARE_WAITQUEUE(wait, current);