summaryrefslogtreecommitdiffstats
path: root/include/linux/mtd/mtd-abi.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mtd/mtd-abi.h')
-rw-r--r--include/linux/mtd/mtd-abi.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd-abi.h b/include/linux/mtd/mtd-abi.h
index 11d51e2744..c1ba55bd2d 100644
--- a/include/linux/mtd/mtd-abi.h
+++ b/include/linux/mtd/mtd-abi.h
@@ -9,6 +9,8 @@
#ifndef DOXYGEN_SHOULD_SKIP_THIS
+#include <asm-generic/div64.h>
+
struct erase_info_user {
uint32_t start;
uint32_t length;
@@ -73,7 +75,7 @@ enum {
struct mtd_info_user {
uint8_t type;
uint32_t flags;
- uint32_t size; // Total size of the MTD
+ uint64_t size; /* Total size of the MTD */
uint32_t erasesize;
uint32_t writesize;
uint32_t oobsize; // Amount of OOB data per block (e.g. 16)
@@ -173,6 +175,14 @@ enum mtd_file_modes {
MTD_MODE_RAW,
};
+
+static inline uint32_t mtd_user_div_by_eb(uint64_t sz,
+ struct mtd_info_user *mtd_user)
+{
+ do_div(sz, mtd_user->erasesize);
+ return sz;
+}
+
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
#endif /* __MTD_ABI_H__ */