blob: 5a6e3bbe0474e95d3307af6d2828bd2f85b8f303 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Akinobu Mita084db4b2013-08-03 18:52:07 +09002#include <linux/mtd/mtd.h>
Ingo Molnar174cd4b2017-02-02 19:15:33 +01003#include <linux/sched/signal.h>
Richard Weinberger2a6a28e72015-03-29 21:52:06 +02004
5static 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}
Akinobu Mita084db4b2013-08-03 18:52:07 +090015
16int mtdtest_erase_eraseblock(struct mtd_info *mtd, unsigned int ebnum);
17int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
18 unsigned int eb, int ebcnt);
19int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt,
20 unsigned int eb, int ebcnt);
21
22int mtdtest_read(struct mtd_info *mtd, loff_t addr, size_t size, void *buf);
23int mtdtest_write(struct mtd_info *mtd, loff_t addr, size_t size,
24 const void *buf);