• Miquel Raynal's avatar
    mtd: Fallback to ->_read/write() when ->_read/write_oob() is missing · 89fd23ef
    Miquel Raynal authored
    Some MTD sublayers/drivers are implementing ->_read/write() and
    not ->_read/write_oob().
    
    While for NAND devices both are usually valid, for NOR devices, using
    the _oob variant has no real meaning. But, as the MTD layer is supposed
    to hide as much as possible the flash complexity to the user, there is
    no reason to error out while it is just a matter of rewritting things
    internally.
    
    Add a fallback on mtd->_read() (resp. mtd->_write()) when the user calls
    mtd_read_oob() (resp. mtd_write_oob()) while mtd->_read_oob() (resp.
    mtd->_write_oob) is not implemented. There is already a fallback on the
    _oob variant if the former is used.
    Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
    89fd23ef
mtdcore.c 50.5 KB