how to get mtd partitions info in chip->ecc.read_page

eq613 eq613 at qq.com
Thu Feb 19 07:27:15 EST 2009


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);


More information about the linux-mtd mailing list