mirror of
https://github.com/apache/nuttx.git
synced 2026-08-28 12:50:36 +00:00
mtd/parition:MTD partiton check whether the erase interface exist
Since there is a storage device like RRAM that doesn't require erasing, the MTD erase function may not exist. Here, we should first check whether the erase interface exists before performing the erasing operation. Signed-off-by: jingfei <jingfei@xiaomi.com>
This commit is contained in:
parent
e8fbc997fa
commit
3559e97659
1 changed files with 1 additions and 1 deletions
|
|
@ -901,7 +901,7 @@ FAR struct mtd_dev_s *mtd_partition(FAR struct mtd_dev_s *mtd,
|
|||
* nullified by kmm_zalloc).
|
||||
*/
|
||||
|
||||
part->child.erase = part_erase;
|
||||
part->child.erase = mtd->erase ? part_erase : NULL;
|
||||
part->child.bread = part_bread;
|
||||
part->child.bwrite = part_bwrite;
|
||||
part->child.read = mtd->read ? part_read : NULL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue