Seperate drivers and tags handlers into their own interface structures
[yaffs2.git] / yaffs_checkptrw.c
index d64c43659333369963ace1fec1c217ab2c2a5657..4229196d427651c05622e22faf3d3542069e2f28 100644 (file)
@@ -74,7 +74,7 @@ static int yaffs_checkpt_erase(struct yaffs_dev *dev)
 {
        int i;
 
-       if (!dev->param.drv_erase_fn)
+       if (!dev->drv.drv_erase_fn)
                return 0;
        yaffs_trace(YAFFS_TRACE_CHECKPOINT,
                "checking blocks %d to %d",
@@ -91,14 +91,14 @@ static int yaffs_checkpt_erase(struct yaffs_dev *dev)
 
                        dev->n_erasures++;
 
-                       result = dev->param.drv_erase_fn(dev, offset_i);
+                       result = dev->drv.drv_erase_fn(dev, offset_i);
                        if(result) {
                                bi->block_state = YAFFS_BLOCK_STATE_EMPTY;
                                dev->n_erased_blocks++;
                                dev->n_free_chunks +=
                                    dev->param.chunks_per_block;
                        } else {
-                               dev->param.drv_mark_bad_fn(dev, offset_i);
+                               dev->drv.drv_mark_bad_fn(dev, offset_i);
                                bi->block_state = YAFFS_BLOCK_STATE_DEAD;
                        }
                }
@@ -159,7 +159,7 @@ static void yaffs2_checkpt_find_block(struct yaffs_dev *dev)
                        enum yaffs_block_state state;
                        u32 seq;
 
-                       dev->param.read_chunk_tags_fn(dev,
+                       dev->th.read_chunk_tags_fn(dev,
                                        apply_chunk_offset(dev, chunk),
                                        NULL, &tags);
                        yaffs_trace(YAFFS_TRACE_CHECKPOINT,
@@ -171,7 +171,7 @@ static void yaffs2_checkpt_find_block(struct yaffs_dev *dev)
                        if (tags.seq_number != YAFFS_SEQUENCE_CHECKPOINT_DATA)
                                continue;
 
-                       dev->param.query_block_fn(dev,
+                       dev->th.query_block_fn(dev,
                                                apply_block_offset(dev, i),
                                                &state, &seq);
                        if (state == YAFFS_BLOCK_STATE_DEAD)
@@ -200,10 +200,10 @@ int yaffs2_checkpt_open(struct yaffs_dev *dev, int writing)
        dev->checkpt_open_write = writing;
 
        /* Got the functions we need? */
-       if (!dev->param.write_chunk_tags_fn ||
-           !dev->param.read_chunk_tags_fn ||
-           !dev->param.drv_erase_fn ||
-           !dev->param.drv_mark_bad_fn)
+       if (!dev->th.write_chunk_tags_fn ||
+           !dev->th.read_chunk_tags_fn ||
+           !dev->drv.drv_erase_fn ||
+           !dev->drv.drv_mark_bad_fn)
                return 0;
 
        if (writing && !yaffs2_checkpt_space_ok(dev))
@@ -299,7 +299,7 @@ static int yaffs2_checkpt_flush_buffer(struct yaffs_dev *dev)
 
        dev->n_page_writes++;
 
-       dev->param.write_chunk_tags_fn(dev, offset_chunk,
+       dev->th.write_chunk_tags_fn(dev, offset_chunk,
                                       dev->checkpt_buffer, &tags);
        dev->checkpt_page_seq++;
        dev->checkpt_cur_chunk++;
@@ -383,7 +383,7 @@ int yaffs2_checkpt_rd(struct yaffs_dev *dev, void *data, int n_bytes)
                        dev->n_page_reads++;
 
                        /* read in the next chunk */
-                       dev->param.read_chunk_tags_fn(dev,
+                       dev->th.read_chunk_tags_fn(dev,
                                                offset_chunk,
                                                dev->checkpt_buffer,
                                                &tags);