summaryrefslogtreecommitdiff
path: root/drivers/mtd/ubi/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/ubi/debug.h')
-rw-r--r--drivers/mtd/ubi/debug.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/mtd/ubi/debug.h b/drivers/mtd/ubi/debug.h
index f2f499feff49..8cdd25eee013 100644
--- a/drivers/mtd/ubi/debug.h
+++ b/drivers/mtd/ubi/debug.h
@@ -92,10 +92,12 @@ static inline int ubi_dbg_erase_failure(const struct ubi_device *ubi)
/* Emulate bit-flips */
#define MASK_BITFLIPS (1 << 2)
/* Emulates -EIO during write/erase */
-#define MASK_IO_FAILURE (1 << 3)
+#define MASK_WRITE_FAILURE (1 << 3)
+#define MASK_ERASE_FAILURE (1 << 4)
extern bool should_fail_bitflips(void);
-extern bool should_fail_io_failures(void);
+extern bool should_fail_write_failure(void);
+extern bool should_fail_erase_failure(void);
extern bool should_fail_power_cut(void);
static inline bool ubi_dbg_fail_bitflip(const struct ubi_device *ubi)
@@ -107,15 +109,15 @@ static inline bool ubi_dbg_fail_bitflip(const struct ubi_device *ubi)
static inline bool ubi_dbg_fail_write(const struct ubi_device *ubi)
{
- if (ubi->dbg.emulate_failures & MASK_IO_FAILURE)
- return should_fail_io_failures();
+ if (ubi->dbg.emulate_failures & MASK_WRITE_FAILURE)
+ return should_fail_write_failure();
return false;
}
static inline bool ubi_dbg_fail_erase(const struct ubi_device *ubi)
{
- if (ubi->dbg.emulate_failures & MASK_IO_FAILURE)
- return should_fail_io_failures();
+ if (ubi->dbg.emulate_failures & MASK_ERASE_FAILURE)
+ return should_fail_erase_failure();
return false;
}