mtip32xx: fix device removal
authorChristoph Hellwig <hch@lst.de>
Sun, 19 Jun 2022 06:05:48 +0000 (08:05 +0200)
committerJens Axboe <axboe@kernel.dk>
Tue, 28 Jun 2022 12:30:26 +0000 (06:30 -0600)
commite8b58ef09e84c15cf782b01cfc73cc5b1180d519
tree9a9e981a062bddd8eebaac61dfd2930596861b29
parentec5263f422a3364442e0db2d9c2866d9154cbcc4
mtip32xx: fix device removal

Use the proper helper to mark a surpise removal, remove the gendisk as
soon as possible when removing the device and implement the ->free_disk
callback to ensure the private data is alive as long as the gendisk has
references.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/20220619060552.1850436-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/mtip32xx/mtip32xx.c
drivers/block/mtip32xx/mtip32xx.h