mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-21 22:47:56 +00:00
fa4dc86e98
MEMREAD is a new ioctl for MTD character devices that was first included in Linux 6.1. It allows userspace applications to use the Linux kernel's OOB autoplacement mechanism while reading data from NAND devices. The Yafut tool needs this ioctl to do its job. Signed-off-by: Michał Kępień <openwrt@kempniu.pl>
21 lines
645 B
Diff
21 lines
645 B
Diff
--- a/drivers/mtd/nand/spi/core.c
|
|
+++ b/drivers/mtd/nand/spi/core.c
|
|
@@ -724,7 +724,7 @@ static int spinand_mtd_write(struct mtd_
|
|
static bool spinand_isbad(struct nand_device *nand, const struct nand_pos *pos)
|
|
{
|
|
struct spinand_device *spinand = nand_to_spinand(nand);
|
|
- u8 marker[2] = { };
|
|
+ u8 marker[1] = { };
|
|
struct nand_page_io_req req = {
|
|
.pos = *pos,
|
|
.ooblen = sizeof(marker),
|
|
@@ -735,7 +735,7 @@ static bool spinand_isbad(struct nand_de
|
|
|
|
spinand_select_target(spinand, pos->target);
|
|
spinand_read_page(spinand, &req);
|
|
- if (marker[0] != 0xff || marker[1] != 0xff)
|
|
+ if (marker[0] != 0xff)
|
|
return true;
|
|
|
|
return false;
|