diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2018-07-18 16:33:02 -0400 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-07-19 17:12:09 -0400 |
commit | d70420bcd447e5400a0116b20b9b6088bb32448e (patch) | |
tree | 03f5a66c9f4def5dae5431874f9814f76a6322c1 | |
parent | a8222a84cefa9d3595a14cf076bc8c09287bf16c (diff) |
mtd: adapt misleading comment in mtd_oob_ops structure
A comment in the kernel doc of the mtd_oob_ops structure tells that it
is not possible to write more than one page with OOB. This is actually
true for only a few MTD devices like 'onenand' but it is definitely not
a general limitation. While this would benefit to be handled elsewhere
either by the MTD layer or by the limited drivers, let's update this
comment to reflect the reality.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
-rw-r--r-- | include/linux/mtd/mtd.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index a86c4fa93115..cd0be91bdefa 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -67,9 +67,11 @@ struct mtd_erase_region_info { | |||
67 | * @datbuf: data buffer - if NULL only oob data are read/written | 67 | * @datbuf: data buffer - if NULL only oob data are read/written |
68 | * @oobbuf: oob data buffer | 68 | * @oobbuf: oob data buffer |
69 | * | 69 | * |
70 | * Note, it is allowed to read more than one OOB area at one go, but not write. | 70 | * Note, some MTD drivers do not allow you to write more than one OOB area at |
71 | * The interface assumes that the OOB write requests program only one page's | 71 | * one go. If you try to do that on such an MTD device, -EINVAL will be |
72 | * OOB area. | 72 | * returned. If you want to make your implementation portable on all kind of MTD |
73 | * devices you should split the write request into several sub-requests when the | ||
74 | * request crosses a page boundary. | ||
73 | */ | 75 | */ |
74 | struct mtd_oob_ops { | 76 | struct mtd_oob_ops { |
75 | unsigned int mode; | 77 | unsigned int mode; |