mtd_blkdevs: simplify the refcounting in blktrans_{open, release}
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Aug 2021 07:33:59 +0000 (09:33 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 23 Aug 2021 08:01:16 +0000 (10:01 +0200)
commitee28b42006c37aaeb68c83300fe5608db662082f
tree49c4d2b61e35efb59e6e85a4b2431bfd4f511e4b
parent37b143d12b5f099bb4375162303ff1df1692cc5e
mtd_blkdevs: simplify the refcounting in blktrans_{open, release}

Always grab a reference to the mtd_blktrans_dev in ->open instead of
just on the first open, and do away with the additional temporary
references in ->open and ->release.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210823073359.705281-9-hch@lst.de
drivers/mtd/mtd_blkdevs.c