lkml.org 
[lkml]   [2010]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 15/29] Staging: yaffs2: yaffs_mtdif2: Add files
    On Mon, 1 Nov 2010, Tracey Dent wrote:

    > Adding files to yaffs2 directory.
    >
    > Signed-off-by: Tracey Dent <tdent48227@gmail.com>
    > ---
    > drivers/staging/yaffs2/yaffs_mtdif2.c | 256 +++++++++++++++++++++++++++++++++
    > drivers/staging/yaffs2/yaffs_mtdif2.h | 29 ++++
    > 2 files changed, 285 insertions(+), 0 deletions(-)
    > create mode 100644 drivers/staging/yaffs2/yaffs_mtdif2.c
    > create mode 100644 drivers/staging/yaffs2/yaffs_mtdif2.h
    >
    > diff --git a/drivers/staging/yaffs2/yaffs_mtdif2.c b/drivers/staging/yaffs2/yaffs_mtdif2.c
    > new file mode 100644
    > index 0000000..1c60a44
    > --- /dev/null
    > +++ b/drivers/staging/yaffs2/yaffs_mtdif2.c
    ...
    > +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
    > + ops.mode = MTD_OOB_AUTO;
    > + ops.ooblen = (dev->param.inband_tags) ? 0 : packed_tags_size;
    > + ops.len = dev->param.total_bytes_per_chunk;
    > + ops.ooboffs = 0;
    > + ops.datbuf = (__u8 *)data;
    > + ops.oobbuf = (dev->param.inband_tags) ? NULL : packed_tags_ptr;
    > + retval = mtd->write_oob(mtd, addr, &ops);
    > +
    > +#else
    ...
    > +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
    > + if (dev->param.inband_tags || (data && !tags))
    > + retval = mtd->read(mtd, addr, dev->param.total_bytes_per_chunk,
    > + &dummy, data);
    > + else if (tags) {
    > + ops.mode = MTD_OOB_AUTO;
    > + ops.ooblen = packed_tags_size;
    > + ops.len = data ? dev->data_bytes_per_chunk : packed_tags_size;
    > + ops.ooboffs = 0;
    > + ops.datbuf = data;
    > + ops.oobbuf = yaffs_dev_to_lc(dev)->spare_buffer;
    > + retval = mtd->read_oob(mtd, addr, &ops);
    > + }
    > +#else
    ...

    If/when this code gets merged it will definitely be into a kernel with a
    version greater than 2.6.17, so I believe you should just get rid of the
    #ifdef and the code in the #else parts.

    --
    Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
    Plain text mails only, please http://www.expita.com/nomime.html
    Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html



    \
     
     \ /
      Last update: 2010-11-01 20:19    [W:4.689 / U:0.024 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site