Merge tag 'nand/for-4.17' of git://git.infradead.org/linux-mtd into mtd/next
[muen/linux.git] / drivers / mtd / sm_ftl.c
index fa176f5937bb91d841103f54df521eb25d070fe5..79636349df965a4c67c1db5feeb2ac3f159bbdeb 100644 (file)
@@ -460,11 +460,8 @@ static int sm_erase_block(struct sm_ftl *ftl, int zone_num, uint16_t block,
        struct mtd_info *mtd = ftl->trans->mtd;
        struct erase_info erase;
 
-       erase.mtd = mtd;
-       erase.callback = sm_erase_callback;
        erase.addr = sm_mkoffset(ftl, zone_num, block, 0);
        erase.len = ftl->block_size;
-       erase.priv = (u_long)ftl;
 
        if (ftl->unstable)
                return -EIO;
@@ -482,15 +479,6 @@ static int sm_erase_block(struct sm_ftl *ftl, int zone_num, uint16_t block,
                goto error;
        }
 
-       if (erase.state == MTD_ERASE_PENDING)
-               wait_for_completion(&ftl->erase_completion);
-
-       if (erase.state != MTD_ERASE_DONE) {
-               sm_printk("erase of block %d in zone %d failed after wait",
-                       block, zone_num);
-               goto error;
-       }
-
        if (put_free)
                kfifo_in(&zone->free_sectors,
                        (const unsigned char *)&block, sizeof(block));
@@ -501,12 +489,6 @@ error:
        return -EIO;
 }
 
-static void sm_erase_callback(struct erase_info *self)
-{
-       struct sm_ftl *ftl = (struct sm_ftl *)self->priv;
-       complete(&ftl->erase_completion);
-}
-
 /* Thoroughly test that block is valid. */
 static int sm_check_block(struct sm_ftl *ftl, int zone, int block)
 {
@@ -1141,7 +1123,6 @@ static void sm_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
        mutex_init(&ftl->mutex);
        timer_setup(&ftl->timer, sm_cache_flush_timer, 0);
        INIT_WORK(&ftl->flush_work, sm_cache_flush_work);
-       init_completion(&ftl->erase_completion);
 
        /* Read media information */
        if (sm_get_media_info(ftl, mtd)) {