mtd: core: Fix refcounting for unpartitioned MTDs
authorRichard Weinberger <richard@nod.at>
Sun, 6 Dec 2020 20:22:20 +0000 (21:22 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 7 Dec 2020 11:29:11 +0000 (12:29 +0100)
commit1ca71415f075353974524e96ed175306d8a937a8
treec384c0704de6005a57f46f1c1cbd9cd557b80674
parent18b9c9403758ff68d93ee2f593096778d58e6f76
mtd: core: Fix refcounting for unpartitioned MTDs

Apply changes to usecount also to the master partition.
Otherwise we have no refcounting at all if an MTD has no partitions.

Cc: stable@vger.kernel.org
Fixes: 46b5889cc2c5 ("mtd: implement proper partition handling")
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20201206202220.27290-1-richard@nod.at
drivers/mtd/mtdcore.c