mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-20 14:13:16 +00:00
d7f21940bc
This patch backports the upstream patch that adds the 4B_OPCODES flag to w25q256 under 5.4 kernel. This is needed for ipq40xx and ramips. Signed-off-by: Robert Marko <robimarko@gmail.com>
23 lines
647 B
Diff
23 lines
647 B
Diff
From: Felix Fietkau <nbd@nbd.name>
|
|
Date: Thu, 22 Feb 2018 11:11:57 +0100
|
|
Subject: [PATCH] mtd: spi-nor: allow NOR driver to write fewer bytes than
|
|
requested
|
|
|
|
The write size can be constrained by the maximum message/transfer size
|
|
of the SPI controller. Only check for ret = 0 to avoid an infinite loop.
|
|
|
|
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
|
---
|
|
|
|
--- a/drivers/mtd/spi-nor/spi-nor.c
|
|
+++ b/drivers/mtd/spi-nor/spi-nor.c
|
|
@@ -2706,7 +2706,7 @@ static int spi_nor_write(struct mtd_info
|
|
|
|
write_enable(nor);
|
|
ret = spi_nor_write_data(nor, addr, page_remain, buf + i);
|
|
- if (ret < 0)
|
|
+ if (ret <= 0)
|
|
goto write_err;
|
|
written = ret;
|
|
|