From 7db8d2939bf9833587fcff84f040a8e4f9410e6f Mon Sep 17 00:00:00 2001 From: "rogerz.zhang@gmail.com" Date: Sat, 29 Dec 2012 11:40:06 +0000 Subject: [PATCH] fix bug that uffs may crash because of uninitialized device ops git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2553 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/simulator/drivers/nanddrv_file.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bsp/simulator/drivers/nanddrv_file.c b/bsp/simulator/drivers/nanddrv_file.c index 8d6c5b750..1a21a316a 100644 --- a/bsp/simulator/drivers/nanddrv_file.c +++ b/bsp/simulator/drivers/nanddrv_file.c @@ -323,13 +323,20 @@ static rt_err_t nanddrv_file_erase_block(struct rt_mtd_nand_device *device, rt_u return RT_EOK; } +static rt_err_t nanddrv_file_no_op(struct rt_mtd_nand_device *device, rt_uint32_t block) +{ + return RT_EOK; +} + const static struct rt_mtd_nand_driver_ops _ops = { nanddrv_file_read_id, nanddrv_file_read_page, nanddrv_file_write_page, nanddrv_file_move_page, - nanddrv_file_erase_block + nanddrv_file_erase_block, + nanddrv_file_no_op, /* check block */ + nanddrv_file_no_op /* mark bad block */ }; void nand_eraseall(void); -- GitLab