Skip to content

Commit b4991c0

Browse files
committed
Merge tag 'mtd/fixes-for-6.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux
Pull mtd fixes from Miquel Raynal: "Two important fixes: the build of the SPI NAND layer with old GCC versions as well as the fix of the Qpic Makefile which was wrong in the first place. There are also two smaller fixes about a missing error and status check" * tag 'mtd/fixes-for-6.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux: mtd: spinand: Fix build with gcc < 7.5 mtd: rawnand: Add status chack in r852_ready() mtd: inftlcore: Add error check for inftl_read_oob() mtd: nand: Drop explicit test for built-in CONFIG_SPI_QPIC_SNAND
2 parents 3b07108 + 1c1fd37 commit b4991c0

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

drivers/mtd/inftlcore.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,10 +482,11 @@ static inline u16 INFTL_findwriteunit(struct INFTLrecord *inftl, unsigned block)
482482
silly = MAX_LOOPS;
483483

484484
while (thisEUN <= inftl->lastEUN) {
485-
inftl_read_oob(mtd, (thisEUN * inftl->EraseSize) +
486-
blockofs, 8, &retlen, (char *)&bci);
487-
488-
status = bci.Status | bci.Status1;
485+
if (inftl_read_oob(mtd, (thisEUN * inftl->EraseSize) +
486+
blockofs, 8, &retlen, (char *)&bci) < 0)
487+
status = SECTOR_IGNORE;
488+
else
489+
status = bci.Status | bci.Status1;
489490
pr_debug("INFTL: status of block %d in EUN %d is %x\n",
490491
block , writeEUN, status);
491492

drivers/mtd/nand/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@
33
nandcore-objs := core.o bbt.o
44
obj-$(CONFIG_MTD_NAND_CORE) += nandcore.o
55
obj-$(CONFIG_MTD_NAND_ECC_MEDIATEK) += ecc-mtk.o
6-
ifeq ($(CONFIG_SPI_QPIC_SNAND),y)
76
obj-$(CONFIG_SPI_QPIC_SNAND) += qpic_common.o
8-
else
97
obj-$(CONFIG_MTD_NAND_QCOM) += qpic_common.o
10-
endif
118
obj-y += onenand/
129
obj-y += raw/
1310
obj-y += spi/

drivers/mtd/nand/raw/r852.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ static int r852_wait(struct nand_chip *chip)
387387
static int r852_ready(struct nand_chip *chip)
388388
{
389389
struct r852_device *dev = r852_get_dev(nand_to_mtd(chip));
390+
if (dev->card_unstable)
391+
return 0;
392+
390393
return !(r852_read_reg(dev, R852_CARD_STA) & R852_CARD_STA_BUSY);
391394
}
392395

include/linux/mtd/spinand.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
SPI_MEM_OP_ADDR(2, addr, 1), \
6868
SPI_MEM_OP_DUMMY(ndummy, 1), \
6969
SPI_MEM_OP_DATA_IN(len, buf, 1), \
70-
__VA_OPT__(SPI_MEM_OP_MAX_FREQ(__VA_ARGS__)))
70+
SPI_MEM_OP_MAX_FREQ(__VA_ARGS__ + 0))
7171

7272
#define SPINAND_PAGE_READ_FROM_CACHE_FAST_OP(addr, ndummy, buf, len) \
7373
SPI_MEM_OP(SPI_MEM_OP_CMD(0x0b, 1), \

0 commit comments

Comments
 (0)