mtd: create an mtd_oobavail() helper and make use of it
authorBoris BREZILLON <boris.brezillon@free-electrons.com>
Mon, 7 Mar 2016 09:46:52 +0000 (10:46 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 8 Mar 2016 00:23:09 +0000 (16:23 -0800)
commit29f1058a90b319b01c4cf469720e0350212d5c9c
tree6094d39b99c1cae2d98d0459778852d7043690e1
parentf5b8aa78ef086248145363bf1ffe5ca4348b6a98
mtd: create an mtd_oobavail() helper and make use of it

Currently, all MTD drivers/sublayers exposing an OOB area are
doing the same kind of test to extract the available OOB size
based on the mtd_info and mtd_oob_ops structures.
Move this common logic into an inline function and make use of it.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Suggested-by: Priit Laes <plaes@plaes.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/mtdpart.c
drivers/mtd/nand/nand_base.c
drivers/mtd/onenand/onenand_base.c
include/linux/mtd/mtd.h