mtd: Do not allow MTD devices with inconsistent erase properties
authorBoris Brezillon <boris.brezillon@free-electrons.com>
Fri, 15 Dec 2017 12:39:51 +0000 (13:39 +0100)
committerBoris Brezillon <boris.brezillon@free-electrons.com>
Sat, 6 Jan 2018 14:09:40 +0000 (15:09 +0100)
commit33f45c44d68b3593826524ba6d02bd9cce9e101e
tree4a7246975527f107e7b09525ee85cca2cf76f940
parent911c3a30cab8269239d24e68df4adf9f7f9e2a01
mtd: Do not allow MTD devices with inconsistent erase properties

When mtd->erasesize is 0 or mtd->_erase is NULL, that means the device
does not support the erase operation, which in turn means it should
have the MTD_NO_ERASE flag set.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: Miquel Raynal <miquel.raynal@free-electrons.com>
drivers/mtd/mtdcore.c