Skip to content

Commit d70420b

Browse files
miquelraynalBoris Brezillon
authored andcommitted
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>
1 parent a8222a8 commit d70420b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎include/linux/mtd/mtd.h‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ struct mtd_erase_region_info {
6767
* @datbuf: data buffer - if NULL only oob data are read/written
6868
* @oobbuf: oob data buffer
6969
*
70-
* Note, it is allowed to read more than one OOB area at one go, but not write.
71-
* The interface assumes that the OOB write requests program only one page's
72-
* OOB area.
70+
* Note, some MTD drivers do not allow you to write more than one OOB area at
71+
* one go. If you try to do that on such an MTD device, -EINVAL will be
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.
7375
*/
7476
struct mtd_oob_ops {
7577
unsigned int mode;

0 commit comments

Comments
 (0)