diff options
author | Tom Rini | 2021-10-23 10:49:28 -0400 |
---|---|---|
committer | Tom Rini | 2021-10-23 10:49:28 -0400 |
commit | 355d1e24f6143c4839be3c015c191421c4e9449c (patch) | |
tree | ff68e868d404d117f3f9599740f83fd73c99c306 /include | |
parent | f055f2e5a2038002519e5b9affbf259345f4ade9 (diff) | |
parent | b9cfd8b0911209e2ebec887e497510ee42f9e788 (diff) |
Merge https://source.denx.de/u-boot/custodians/u-boot-spi
- Fix mtd erase with mtdpart (Marek BehĂșn)
- NXP fspi driver fixes (Kuldeep Singh)
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/mtd.h | 11 | ||||
-rw-r--r-- | include/nand.h | 1 | ||||
-rw-r--r-- | include/spi_flash.h | 9 |
3 files changed, 9 insertions, 12 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 3b302fb8c31..74554009815 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -51,7 +51,6 @@ struct erase_info { u_long retries; unsigned dev; unsigned cell; - void (*callback) (struct erase_info *self); u_long priv; u_char state; struct erase_info *next; @@ -535,16 +534,6 @@ extern int unregister_mtd_user (struct mtd_notifier *old); #endif void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size); -#ifdef CONFIG_MTD_PARTITIONS -void mtd_erase_callback(struct erase_info *instr); -#else -static inline void mtd_erase_callback(struct erase_info *instr) -{ - if (instr->callback) - instr->callback(instr); -} -#endif - static inline int mtd_is_bitflip(int err) { return err == -EUCLEAN; } diff --git a/include/nand.h b/include/nand.h index 75c605193ab..09dbda4e81b 100644 --- a/include/nand.h +++ b/include/nand.h @@ -69,7 +69,6 @@ static inline int nand_erase(struct mtd_info *info, loff_t off, size_t size) instr.mtd = info; instr.addr = off; instr.len = size; - instr.callback = 0; return mtd_erase(info, &instr); } diff --git a/include/spi_flash.h b/include/spi_flash.h index 3d747c925b9..4d4ae89c192 100644 --- a/include/spi_flash.h +++ b/include/spi_flash.h @@ -165,6 +165,9 @@ static inline int spi_flash_read(struct spi_flash *flash, u32 offset, struct mtd_info *mtd = &flash->mtd; size_t retlen; + if (!len) + return 0; + return mtd->_read(mtd, offset, len, &retlen, buf); } @@ -174,6 +177,9 @@ static inline int spi_flash_write(struct spi_flash *flash, u32 offset, struct mtd_info *mtd = &flash->mtd; size_t retlen; + if (!len) + return 0; + return mtd->_write(mtd, offset, len, &retlen, buf); } @@ -188,6 +194,9 @@ static inline int spi_flash_erase(struct spi_flash *flash, u32 offset, return -EINVAL; } + if (!len) + return 0; + memset(&instr, 0, sizeof(instr)); instr.addr = offset; instr.len = len; |