add_mtd_partition question

Clive Davies cdavies at altera.com
Wed Jul 10 03:23:58 EDT 2002


I think this is probably a more correct fix. If you could let me know if it 
looks ok, if so then I'll commit it.

Index: mtdpart.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/mtdpart.c,v
retrieving revision 1.27
diff -r1.27 mtdpart.c
72a73,88
> static int part_read_user_prot_reg (struct mtd_info *mtd, loff_t from, 
size_t len,
>                       size_t *retlen, u_char *buf)
> {
>       struct mtd_part *part = PART(mtd);
>       return part->master->read_user_prot_reg (part->master, from,
>                                       len, retlen, buf);
> }
>
> static int part_read_fact_prot_reg (struct mtd_info *mtd, loff_t from, 
size_t len,
>                       size_t *retlen, u_char *buf)
> {
>       struct mtd_part *part = PART(mtd);
>       return part->master->read_user_prot_reg (part->master, from,
>                                       len, retlen, buf);
> }
>
100a117,124
> static int part_write_user_prot_reg (struct mtd_info *mtd, loff_t from, 
size_t len,
>                       size_t *retlen, u_char *buf)
> {
>       struct mtd_part *part = PART(mtd);
>       return part->master->write_user_prot_reg (part->master, from,
>                                       len, retlen, buf);
> }
>
229,231d252
<               slave->mtd.read_user_prot_reg = master->read_user_prot_reg;
<               slave->mtd.read_fact_prot_reg = master->read_fact_prot_reg;
<               slave->mtd.write_user_prot_reg = master->write_user_prot_reg;
243a265,270
>               if(master->read_user_prot_reg)
>                       slave->mtd.read_user_prot_reg = 
part_read_user_prot_reg;
>               if(master->read_fact_prot_reg)
>                       slave->mtd.read_fact_prot_reg = 
part_read_fact_prot_reg;
>               if(master->write_user_prot_reg)
>                       slave->mtd.write_user_prot_reg = 
part_write_user_prot_reg;




More information about the linux-mtd mailing list