summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-02-25 12:12:09 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2016-03-04 08:23:06 +0100
commit568e345d5acb380bdd25012f751d7c6eeef27699 (patch)
treecc20f23cc3694fc079254984c99ccf5cd2fa386c /include/linux
parent53eff047f96a7d1a8eb899619ce659945ab4a7d2 (diff)
downloadbarebox-568e345d5acb380bdd25012f751d7c6eeef27699.tar.gz
barebox-568e345d5acb380bdd25012f751d7c6eeef27699.tar.xz
mtd: mtd_[read|write|erase]: check for valid input data
mtd_[read|write|erase] are input functions to the mtd subsystem, so check for valid input data here rather than relying on the drivers doing this. The checks are copied from the Kernel as of 4.5-rc5 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/mtd.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index e430217097..421a941aad 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -26,6 +26,8 @@
#define MTD_ERASE_DONE 0x08
#define MTD_ERASE_FAILED 0x10
+#define MTD_FAIL_ADDR_UNKNOWN -1LL
+
/* If the erase fails, fail_addr might indicate exactly which block failed. If
fail_addr = 0xffffffff, the failure was not at the device level or was not
specific to any particular block. */