how to get mtd partitions info in chip->ecc.read_page
in the read_page function, I want to do some special for different nand partition, but the chip->ecc.read_page(mtd, chip, bufpoi); //mtd=slave->master, but i want get the mtd_info of slave
is there some methord ?
struct mtd_part {
struct mtd_info mtd; //want this
struct mtd_info *master; // but get this
u_int32_t offset;
int index;
struct list_head list;
int registered;
};
the container_of does not work:
struct mtd_part * mtdmaster_to_mtd_part( struct mtd_info **mtd){
return container_of(mtd,struct mtd_part,master);
}
struct mtd_part * mtd_part=mtdmaster_to_mtd_part(&mtd);
struct mtd_info * slavepart=(struct mtd_info*)(mtd_part);