]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mtd: nand: Rename the NAND IO iteration helper
authorMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 26 Aug 2024 10:14:04 +0000 (12:14 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Fri, 6 Sep 2024 15:00:00 +0000 (17:00 +0200)
Soon a helper for iterating over blocks will be needed (for continuous
read purposes). In order to clarify the intend of this helper, let's
rename it with the "page" wording inside.

While at it, improve the doc and fix a typo.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Pratyush Yadav <pratyush@kernel.org>
Link: https://lore.kernel.org/linux-mtd/20240826101412.20644-2-miquel.raynal@bootlin.com
include/linux/mtd/nand.h

index b2996dc987ff80b3d7eaa0d24d3f26c106fbec13..92e06ac33815908a376d1ae2ffa06d03ba753e78 100644 (file)
@@ -906,19 +906,19 @@ static inline void nanddev_pos_next_page(struct nand_device *nand,
 }
 
 /**
- * nand_io_iter_init - Initialize a NAND I/O iterator
+ * nand_io_page_iter_init - Initialize a NAND I/O iterator
  * @nand: NAND device
  * @offs: absolute offset
  * @req: MTD request
  * @iter: NAND I/O iterator
  *
  * Initializes a NAND iterator based on the information passed by the MTD
- * layer.
+ * layer for page jumps.
  */
-static inline void nanddev_io_iter_init(struct nand_device *nand,
-                                       enum nand_page_io_req_type reqtype,
-                                       loff_t offs, struct mtd_oob_ops *req,
-                                       struct nand_io_iter *iter)
+static inline void nanddev_io_page_iter_init(struct nand_device *nand,
+                                            enum nand_page_io_req_type reqtype,
+                                            loff_t offs, struct mtd_oob_ops *req,
+                                            struct nand_io_iter *iter)
 {
        struct mtd_info *mtd = nanddev_to_mtd(nand);
 
@@ -990,10 +990,10 @@ static inline bool nanddev_io_iter_end(struct nand_device *nand,
  * @req: MTD I/O request
  * @iter: NAND I/O iterator
  *
- * Should be used for iterate over pages that are contained in an MTD request.
+ * Should be used for iterating over pages that are contained in an MTD request.
  */
 #define nanddev_io_for_each_page(nand, type, start, req, iter)         \
-       for (nanddev_io_iter_init(nand, type, start, req, iter);        \
+       for (nanddev_io_page_iter_init(nand, type, start, req, iter);   \
             !nanddev_io_iter_end(nand, iter);                          \
             nanddev_io_iter_next_page(nand, iter))