Commit 3f4c0ad4 authored by Miquel Raynal's avatar Miquel Raynal

mtd: nand: Rename the NAND IO iteration helper

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: default avatarPratyush Yadav <pratyush@kernel.org>
Link: https://lore.kernel.org/linux-mtd/20240826101412.20644-2-miquel.raynal@bootlin.com
parent b59fdc7f
...@@ -906,19 +906,19 @@ static inline void nanddev_pos_next_page(struct nand_device *nand, ...@@ -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 * @nand: NAND device
* @offs: absolute offset * @offs: absolute offset
* @req: MTD request * @req: MTD request
* @iter: NAND I/O iterator * @iter: NAND I/O iterator
* *
* Initializes a NAND iterator based on the information passed by the MTD * 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, static inline void nanddev_io_page_iter_init(struct nand_device *nand,
enum nand_page_io_req_type reqtype, enum nand_page_io_req_type reqtype,
loff_t offs, struct mtd_oob_ops *req, loff_t offs, struct mtd_oob_ops *req,
struct nand_io_iter *iter) struct nand_io_iter *iter)
{ {
struct mtd_info *mtd = nanddev_to_mtd(nand); struct mtd_info *mtd = nanddev_to_mtd(nand);
...@@ -990,10 +990,10 @@ static inline bool nanddev_io_iter_end(struct nand_device *nand, ...@@ -990,10 +990,10 @@ static inline bool nanddev_io_iter_end(struct nand_device *nand,
* @req: MTD I/O request * @req: MTD I/O request
* @iter: NAND I/O iterator * @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) \ #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_end(nand, iter); \
nanddev_io_iter_next_page(nand, iter)) nanddev_io_iter_next_page(nand, iter))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment