Re: [PATCH 1/2] mtd: mtdconcat: Judge callback function existence getting from master for each partition

From: Zhihao Cheng
Date: Fri Aug 06 2021 - 22:16:01 EST


在 2021/8/7 3:28, Miquel Raynal 写道:
Hi Miquel,
Hi Zhihao,

Zhihao Cheng <chengzhihao1@xxxxxxxxxx> wrote on Sat, 31 Jul 2021
10:32:42 +0800:
@@ -721,14 +724,15 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
subdev[i]->flags & MTD_WRITEABLE;
}
+ subdev_master = mtd_get_master(subdev[i]);
concat->mtd.size += subdev[i]->size;
concat->mtd.ecc_stats.badblocks +=
subdev[i]->ecc_stats.badblocks;
if (concat->mtd.writesize != subdev[i]->writesize ||
concat->mtd.subpage_sft != subdev[i]->subpage_sft ||
concat->mtd.oobsize != subdev[i]->oobsize ||
- !concat->mtd._read_oob != !subdev[i]->_read_oob ||
- !concat->mtd._write_oob != !subdev[i]->_write_oob) {
+ !concat->mtd._read_oob != !subdev_master->_read_oob ||
+ !concat->mtd._write_oob != !subdev_master->_write_oob) {
Do you really need this change?

I think both "!concat->mtd._read_oob != !subdev[i]->_read_oob" and "!concat->mtd._write_oob != !subdev[i]->_write_oob" need to be modified otherwise concatenating goes failure.

I thought there exists two problems:

  1. Wrong callback fetching in mtd partition device

  2. Warning for existence of _read and _read_oob at the same time

so I solved them in two steps to make history commit logs a bit clear.

Though these two patches can be combined to one.