Skip to content

Commit 07d0aa9

Browse files
m-kurbanovmiquelraynal
authored andcommitted
mtd: spinand: make spinand_{read,write}_page global
Change these functions from static to global so that to use them later in OTP operations. Since reading OTP pages is no different from reading pages from the main area. Signed-off-by: Martin Kurbanov <[email protected]> Signed-off-by: Miquel Raynal <[email protected]>
1 parent 499a4b1 commit 07d0aa9

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

drivers/mtd/nand/spi/core.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -604,8 +604,16 @@ static int spinand_lock_block(struct spinand_device *spinand, u8 lock)
604604
return spinand_write_reg_op(spinand, REG_BLOCK_LOCK, lock);
605605
}
606606

607-
static int spinand_read_page(struct spinand_device *spinand,
608-
const struct nand_page_io_req *req)
607+
/**
608+
* spinand_read_page() - Read a page
609+
* @spinand: the spinand device
610+
* @req: the I/O request
611+
*
612+
* Return: 0 or a positive number of bitflips corrected on success.
613+
* A negative error code otherwise.
614+
*/
615+
int spinand_read_page(struct spinand_device *spinand,
616+
const struct nand_page_io_req *req)
609617
{
610618
struct nand_device *nand = spinand_to_nand(spinand);
611619
u8 status;
@@ -635,8 +643,16 @@ static int spinand_read_page(struct spinand_device *spinand,
635643
return nand_ecc_finish_io_req(nand, (struct nand_page_io_req *)req);
636644
}
637645

638-
static int spinand_write_page(struct spinand_device *spinand,
639-
const struct nand_page_io_req *req)
646+
/**
647+
* spinand_write_page() - Write a page
648+
* @spinand: the spinand device
649+
* @req: the I/O request
650+
*
651+
* Return: 0 or a positive number of bitflips corrected on success.
652+
* A negative error code otherwise.
653+
*/
654+
int spinand_write_page(struct spinand_device *spinand,
655+
const struct nand_page_io_req *req)
640656
{
641657
struct nand_device *nand = spinand_to_nand(spinand);
642658
u8 status;

include/linux/mtd/spinand.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,4 +588,10 @@ int spinand_upd_cfg(struct spinand_device *spinand, u8 mask, u8 val);
588588
int spinand_write_reg_op(struct spinand_device *spinand, u8 reg, u8 val);
589589
int spinand_select_target(struct spinand_device *spinand, unsigned int target);
590590

591+
int spinand_read_page(struct spinand_device *spinand,
592+
const struct nand_page_io_req *req);
593+
594+
int spinand_write_page(struct spinand_device *spinand,
595+
const struct nand_page_io_req *req);
596+
591597
#endif /* __LINUX_MTD_SPINAND_H */

0 commit comments

Comments
 (0)