xref: /linux/drivers/mtd/tests/mtd_test.h (revision cc04a46f11ea046ed53e2c832ae29e4790f7e35f)
1 #include <linux/mtd/mtd.h>
2 #include <linux/sched.h>
3 
4 static inline int mtdtest_relax(void)
5 {
6 	cond_resched();
7 	if (signal_pending(current)) {
8 		pr_info("aborting test due to pending signal!\n");
9 		return -EINTR;
10 	}
11 
12 	return 0;
13 }
14 
15 int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum);
16 int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
17 					unsigned int eb, int ebcnt);
18 int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
19 				unsigned int eb, int ebcnt);
20 
21 int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf);
22 int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
23 		const void *buf);
24