return 0;
 }
 
-static void mtdoops_inc_counter(struct mtdoops_context *cxt)
-{
-       cxt->nextpage++;
-       if (cxt->nextpage >= cxt->oops_pages)
-               cxt->nextpage = 0;
-       cxt->nextcount++;
-       if (cxt->nextcount == 0xffffffff)
-               cxt->nextcount = 0;
-
-       if (page_is_used(cxt, cxt->nextpage)) {
-               schedule_work(&cxt->work_erase);
-               return;
-       }
-
-       pr_debug("ready %d, %d (no erase)\n",
-                cxt->nextpage, cxt->nextcount);
-}
-
-/* Scheduled work - when we can't proceed without erasing a block */
-static void mtdoops_workfunc_erase(struct work_struct *work)
+static void mtdoops_erase(struct mtdoops_context *cxt)
 {
-       struct mtdoops_context *cxt =
-                       container_of(work, struct mtdoops_context, work_erase);
        struct mtd_info *mtd = cxt->mtd;
        int i = 0, j, ret, mod;
 
        goto badblock;
 }
 
+/* Scheduled work - when we can't proceed without erasing a block */
+static void mtdoops_workfunc_erase(struct work_struct *work)
+{
+       struct mtdoops_context *cxt =
+                       container_of(work, struct mtdoops_context, work_erase);
+       mtdoops_erase(cxt);
+}
+
+static void mtdoops_inc_counter(struct mtdoops_context *cxt)
+{
+       cxt->nextpage++;
+       if (cxt->nextpage >= cxt->oops_pages)
+               cxt->nextpage = 0;
+       cxt->nextcount++;
+       if (cxt->nextcount == 0xffffffff)
+               cxt->nextcount = 0;
+
+       if (page_is_used(cxt, cxt->nextpage)) {
+               schedule_work(&cxt->work_erase);
+               return;
+       }
+
+       pr_debug("ready %d, %d (no erase)\n",
+                cxt->nextpage, cxt->nextcount);
+}
+
 static void mtdoops_write(struct mtdoops_context *cxt, int panic)
 {
        struct mtd_info *mtd = cxt->mtd;