X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fmtd%2Finftlcore.c;h=c4f9d3378b24c658f246d8777d47735050cfdffe;hb=d9c566198bfdf72a041322a093fdc1a2dc231170;hp=1e21a2c3dd29eba442cd621deed1cf8f57788a8a;hpb=9a1fcdfd4bee27c418424cac47abf7c049541297;p=linux-2.6 diff --git a/drivers/mtd/inftlcore.c b/drivers/mtd/inftlcore.c index 1e21a2c3dd..c4f9d3378b 100644 --- a/drivers/mtd/inftlcore.c +++ b/drivers/mtd/inftlcore.c @@ -7,8 +7,6 @@ * (c) 1999 Machine Vision Holdings, Inc. * Author: David Woodhouse * - * $Id: inftlcore.c,v 1.19 2005/11/07 11:14:20 gleixner Exp $ - * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -24,7 +22,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include @@ -68,17 +65,16 @@ static void inftl_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd) DEBUG(MTD_DEBUG_LEVEL3, "INFTL: add_mtd for %s\n", mtd->name); - inftl = kmalloc(sizeof(*inftl), GFP_KERNEL); + inftl = kzalloc(sizeof(*inftl), GFP_KERNEL); if (!inftl) { printk(KERN_WARNING "INFTL: Out of memory for data structures\n"); return; } - memset(inftl, 0, sizeof(*inftl)); inftl->mbd.mtd = mtd; inftl->mbd.devnum = -1; - inftl->mbd.blksize = 512; + inftl->mbd.tr = tr; if (INFTL_mount(inftl) < 0) { @@ -164,10 +160,9 @@ int inftl_read_oob(struct mtd_info *mtd, loff_t offs, size_t len, ops.ooblen = len; ops.oobbuf = buf; ops.datbuf = NULL; - ops.len = len; res = mtd->read_oob(mtd, offs & ~(mtd->writesize - 1), &ops); - *retlen = ops.retlen; + *retlen = ops.oobretlen; return res; } @@ -185,10 +180,9 @@ int inftl_write_oob(struct mtd_info *mtd, loff_t offs, size_t len, ops.ooblen = len; ops.oobbuf = buf; ops.datbuf = NULL; - ops.len = len; res = mtd->write_oob(mtd, offs & ~(mtd->writesize - 1), &ops); - *retlen = ops.retlen; + *retlen = ops.oobretlen; return res; } @@ -946,6 +940,7 @@ static struct mtd_blktrans_ops inftl_tr = { .name = "inftl", .major = INFTL_MAJOR, .part_bits = INFTL_PARTN_BITS, + .blksize = 512, .getgeo = inftl_getgeo, .readsect = inftl_readblock, .writesect = inftl_writeblock, @@ -956,9 +951,6 @@ static struct mtd_blktrans_ops inftl_tr = { static int __init init_inftl(void) { - printk(KERN_INFO "INFTL: inftlcore.c $Revision: 1.19 $, " - "inftlmount.c %s\n", inftlmountrev); - return register_mtd_blktrans(&inftl_tr); }