mtd: keep original flags for every struct mtd_info
authorRafał Miłecki <rafal@milecki.pl>
Tue, 20 Nov 2018 08:55:45 +0000 (09:55 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Sun, 2 Dec 2018 08:29:16 +0000 (09:29 +0100)
commit1186af457cc186c5ed01708da71b1ffbdf0a2638
treec8f61cc3709a015c686435e0993f1c25aa84fc45
parent89f706dbd54faf2da1cb5bea9abc07b00c36ef69
mtd: keep original flags for every struct mtd_info

When allocating a new partition mtd subsystem runs internal tests in the
allocate_partition(). They may result in modifying specified flags (e.g.
dropping some /features/ like write access).

Those constraints don't have to be necessary true for subpartitions. It
may happen parent partition isn't block aligned (effectively disabling
write access) while subpartition may fit blocks nicely. In such case all
checks should be run again (starting with original flags value).

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/mtdcore.c
drivers/mtd/mtdpart.c
include/linux/mtd/mtd.h