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