Skip to contentSkip to conversation

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

DISCUSSION eq613 1 participant 1 message Feb 19, 2009 Memory technology devices (MTD)

lore
Share & tools
lore

eq613

author
#0 lore raw

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