Lines Matching refs:ops

187 			struct mtd_oob_ops ops;  in mtdchar_read()  local
189 ops.mode = MTD_OPS_RAW; in mtdchar_read()
190 ops.datbuf = kbuf; in mtdchar_read()
191 ops.oobbuf = NULL; in mtdchar_read()
192 ops.len = len; in mtdchar_read()
194 ret = mtd_read_oob(mtd, *ppos, &ops); in mtdchar_read()
195 retlen = ops.retlen; in mtdchar_read()
281 struct mtd_oob_ops ops; in mtdchar_write() local
283 ops.mode = MTD_OPS_RAW; in mtdchar_write()
284 ops.datbuf = kbuf; in mtdchar_write()
285 ops.oobbuf = NULL; in mtdchar_write()
286 ops.ooboffs = 0; in mtdchar_write()
287 ops.len = len; in mtdchar_write()
289 ret = mtd_write_oob(mtd, *ppos, &ops); in mtdchar_write()
290 retlen = ops.retlen; in mtdchar_write()
367 struct mtd_oob_ops ops; in mtdchar_writeoob() local
385 ops.ooblen = length; in mtdchar_writeoob()
386 ops.ooboffs = start & (mtd->writesize - 1); in mtdchar_writeoob()
387 ops.datbuf = NULL; in mtdchar_writeoob()
388 ops.mode = (mfi->mode == MTD_FILE_MODE_RAW) ? MTD_OPS_RAW : in mtdchar_writeoob()
391 if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) in mtdchar_writeoob()
394 ops.oobbuf = memdup_user(ptr, length); in mtdchar_writeoob()
395 if (IS_ERR(ops.oobbuf)) in mtdchar_writeoob()
396 return PTR_ERR(ops.oobbuf); in mtdchar_writeoob()
399 ret = mtd_write_oob(mtd, start, &ops); in mtdchar_writeoob()
401 if (ops.oobretlen > 0xFFFFFFFFU) in mtdchar_writeoob()
403 retlen = ops.oobretlen; in mtdchar_writeoob()
407 kfree(ops.oobbuf); in mtdchar_writeoob()
416 struct mtd_oob_ops ops; in mtdchar_readoob() local
425 ops.ooblen = length; in mtdchar_readoob()
426 ops.ooboffs = start & (mtd->writesize - 1); in mtdchar_readoob()
427 ops.datbuf = NULL; in mtdchar_readoob()
428 ops.mode = (mfi->mode == MTD_FILE_MODE_RAW) ? MTD_OPS_RAW : in mtdchar_readoob()
431 if (ops.ooboffs && ops.ooblen > (mtd->oobsize - ops.ooboffs)) in mtdchar_readoob()
434 ops.oobbuf = kmalloc(length, GFP_KERNEL); in mtdchar_readoob()
435 if (!ops.oobbuf) in mtdchar_readoob()
439 ret = mtd_read_oob(mtd, start, &ops); in mtdchar_readoob()
441 if (put_user(ops.oobretlen, retp)) in mtdchar_readoob()
443 else if (ops.oobretlen && copy_to_user(ptr, ops.oobbuf, in mtdchar_readoob()
444 ops.oobretlen)) in mtdchar_readoob()
447 kfree(ops.oobbuf); in mtdchar_readoob()
539 struct mtd_oob_ops ops; in mtdchar_write_ioctl() local
555 ops.mode = req.mode; in mtdchar_write_ioctl()
556 ops.len = (size_t)req.len; in mtdchar_write_ioctl()
557 ops.ooblen = (size_t)req.ooblen; in mtdchar_write_ioctl()
558 ops.ooboffs = 0; in mtdchar_write_ioctl()
561 ops.datbuf = memdup_user(usr_data, ops.len); in mtdchar_write_ioctl()
562 if (IS_ERR(ops.datbuf)) in mtdchar_write_ioctl()
563 return PTR_ERR(ops.datbuf); in mtdchar_write_ioctl()
565 ops.datbuf = NULL; in mtdchar_write_ioctl()
569 ops.oobbuf = memdup_user(usr_oob, ops.ooblen); in mtdchar_write_ioctl()
570 if (IS_ERR(ops.oobbuf)) { in mtdchar_write_ioctl()
571 kfree(ops.datbuf); in mtdchar_write_ioctl()
572 return PTR_ERR(ops.oobbuf); in mtdchar_write_ioctl()
575 ops.oobbuf = NULL; in mtdchar_write_ioctl()
578 ret = mtd_write_oob(mtd, (loff_t)req.start, &ops); in mtdchar_write_ioctl()
580 kfree(ops.datbuf); in mtdchar_write_ioctl()
581 kfree(ops.oobbuf); in mtdchar_write_ioctl()