提交 4f9e14ae 编写于 作者: C Christoph Hellwig 提交者: Jens Axboe

sx8: use the internal state machine to check if del_gendisk needs to be called

Remove usage of the block layer internal GENHD_FL_UP by just looking
at the host state.
Signed-off-by: NChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20210809064028.1198327-6-hch@lst.deSigned-off-by: NJens Axboe <axboe@kernel.dk>
上级 916a470d
...@@ -1373,7 +1373,7 @@ static void carm_free_disk(struct carm_host *host, unsigned int port_no) ...@@ -1373,7 +1373,7 @@ static void carm_free_disk(struct carm_host *host, unsigned int port_no)
if (!disk) if (!disk)
return; return;
if (disk->flags & GENHD_FL_UP) if (host->state > HST_DEV_ACTIVATE)
del_gendisk(disk); del_gendisk(disk);
blk_cleanup_disk(disk); blk_cleanup_disk(disk);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册