mirror of https://gitee.com/openkylin/linux.git
MTD changes:
* Kill a VLA in sa1100 SPI NOR changes: * Make sure ->addr_width is restored when SFDP parsing fails * Propate errors happening in cqspi_direct_read_execute() NAND changes: * Fix kernel-doc mismatch * Fix nanddev_neraseblocks() to return the correct value * Avoid selection of BCH_CONST_PARAMS when some users require dynamic BCH settings -----BEGIN PGP SIGNATURE----- iQJQBAABCgA6FiEEKmCqpbOU668PNA69Ze02AX4ItwAFAlvkDewcHGJvcmlzLmJy ZXppbGxvbkBib290bGluLmNvbQAKCRBl7TYBfgi3ACLTD/9DyyWKnH5xJAc/bjj0 o2cka+L5xW/jUiUMUhNJqwcOCD11PiuXAxsHlJY6HhGXldl4hm8T6rFagmo0B897 HaK2rn0guTERzJUk6EUKiX8wwenwuv6lpAfEGfcUPJe7EMEm5L7e5ETtwGUVEWBt rcRakt5m3VTIW7g7BzExxAalcNuAs80u8RVflsvS2TRLuFo63SnyI4JCo/7k/11a 3itq3x4PNQJcsuKZzX0b7rWO3crB/McCtRStSF11ZCDD5X7KmHKrULBEhaDMfezS 2SzRYe9l8ZtEE3INZny+73H6s6aIhPdTR5UMj9vIyZLDe58nsrzwBBs0jUwttogD QZkzRylGSkNKBfN/FIFkL3NcTY5ub5caVIT04JCdSc28k/HdprHfQC7VMj9o9iLU FcNsCMU6lmrL3WxudzSng4mZ89JCzoZyjOI5i5i9lM4Hxj+hTehKyIZllc9aT7PR l1H9zr+djscNXfQSHEljJbzcFuHVbViILobO3ASbOIsaUiv6RTTZ4kiyEeXoke0C Tg2TNCo3az5xZGhHrY9qvJXYFlNJrilU3K926gKAG3s0LVOCXK43D+N1Nm2q6ISu Bzzg6ND6Lzey2l4zhFGGqpLyA81bbhgyKs6xi5NCSU7NDAdAo2+fwgbkE95/SXP/ w7oJq1FSia9PDgaBUeTPFdT7EA== =uVyq -----END PGP SIGNATURE----- Merge tag 'mtd/fixes-for-4.20-rc2' of git://git.infradead.org/linux-mtd Pull MTD fixes from Boris Brezillon: "MTD changes: - Kill a VLA in sa1100 SPI NOR changes: - Make sure ->addr_width is restored when SFDP parsing fails - Propate errors happening in cqspi_direct_read_execute() NAND changes: - Fix kernel-doc mismatch - Fix nanddev_neraseblocks() to return the correct value - Avoid selection of BCH_CONST_PARAMS when some users require dynamic BCH settings" * tag 'mtd/fixes-for-4.20-rc2' of git://git.infradead.org/linux-mtd: mtd: nand: Fix nanddev_pos_next_page() kernel-doc header mtd: sa1100: avoid VLA in sa1100_setup_mtd mtd: spi-nor: Reset nor->addr_width when SFDP parsing failed mtd: spi-nor: cadence-quadspi: Return error code in cqspi_direct_read_execute() mtd: nand: Fix nanddev_neraseblocks() mtd: nand: drop kernel-doc notation for a deleted function parameter mtd: docg3: don't set conflicting BCH_CONST_PARAMS option
This commit is contained in:
commit
d50ffc585d
|
@ -207,7 +207,7 @@ comment "Disk-On-Chip Device Drivers"
|
|||
config MTD_DOCG3
|
||||
tristate "M-Systems Disk-On-Chip G3"
|
||||
select BCH
|
||||
select BCH_CONST_PARAMS
|
||||
select BCH_CONST_PARAMS if !MTD_NAND_BCH
|
||||
select BITREVERSE
|
||||
help
|
||||
This provides an MTD device driver for the M-Systems DiskOnChip
|
||||
|
|
|
@ -221,7 +221,14 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
|
|||
info->mtd = info->subdev[0].mtd;
|
||||
ret = 0;
|
||||
} else if (info->num_subdev > 1) {
|
||||
struct mtd_info *cdev[nr];
|
||||
struct mtd_info **cdev;
|
||||
|
||||
cdev = kmalloc_array(nr, sizeof(*cdev), GFP_KERNEL);
|
||||
if (!cdev) {
|
||||
ret = -ENOMEM;
|
||||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* We detected multiple devices. Concatenate them together.
|
||||
*/
|
||||
|
@ -230,6 +237,7 @@ static struct sa_info *sa1100_setup_mtd(struct platform_device *pdev,
|
|||
|
||||
info->mtd = mtd_concat_create(cdev, info->num_subdev,
|
||||
plat->name);
|
||||
kfree(cdev);
|
||||
if (info->mtd == NULL) {
|
||||
ret = -ENXIO;
|
||||
goto err;
|
||||
|
|
|
@ -590,7 +590,6 @@ nand_get_device(struct mtd_info *mtd, int new_state)
|
|||
|
||||
/**
|
||||
* panic_nand_wait - [GENERIC] wait until the command is done
|
||||
* @mtd: MTD device structure
|
||||
* @chip: NAND chip structure
|
||||
* @timeo: timeout
|
||||
*
|
||||
|
|
|
@ -996,7 +996,7 @@ static int cqspi_direct_read_execute(struct spi_nor *nor, u_char *buf,
|
|||
err_unmap:
|
||||
dma_unmap_single(nor->dev, dma_dst, len, DMA_FROM_DEVICE);
|
||||
|
||||
return 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t cqspi_read(struct spi_nor *nor, loff_t from,
|
||||
|
|
|
@ -3250,13 +3250,15 @@ static int spi_nor_init_params(struct spi_nor *nor,
|
|||
memcpy(&sfdp_params, params, sizeof(sfdp_params));
|
||||
memcpy(&prev_map, &nor->erase_map, sizeof(prev_map));
|
||||
|
||||
if (spi_nor_parse_sfdp(nor, &sfdp_params))
|
||||
if (spi_nor_parse_sfdp(nor, &sfdp_params)) {
|
||||
nor->addr_width = 0;
|
||||
/* restore previous erase map */
|
||||
memcpy(&nor->erase_map, &prev_map,
|
||||
sizeof(nor->erase_map));
|
||||
else
|
||||
} else {
|
||||
memcpy(params, &sfdp_params, sizeof(*params));
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -324,9 +324,8 @@ static inline unsigned int nanddev_ntargets(const struct nand_device *nand)
|
|||
*/
|
||||
static inline unsigned int nanddev_neraseblocks(const struct nand_device *nand)
|
||||
{
|
||||
return (u64)nand->memorg.luns_per_target *
|
||||
nand->memorg.eraseblocks_per_lun *
|
||||
nand->memorg.pages_per_eraseblock;
|
||||
return nand->memorg.ntargets * nand->memorg.luns_per_target *
|
||||
nand->memorg.eraseblocks_per_lun;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -569,7 +568,7 @@ static inline void nanddev_pos_next_eraseblock(struct nand_device *nand,
|
|||
}
|
||||
|
||||
/**
|
||||
* nanddev_pos_next_eraseblock() - Move a position to the next page
|
||||
* nanddev_pos_next_page() - Move a position to the next page
|
||||
* @nand: NAND device
|
||||
* @pos: the position to update
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue