Thread (14 messages) 14 messages, 4 authors, 2021-08-12
STALE1784d LANDED

[PATCH 5/8] sx8: use the internal state machine to check if del_gendisk needs to be called

From: Christoph Hellwig <hch@lst.de>
Date: 2021-08-09 06:46:59
Also in: linux-bcache, linux-mmc, linux-nvme, linux-raid
Subsystem: block layer, the rest · Maintainers: Jens Axboe, Linus Torvalds

Remove usage of the block layer internal GENHD_FL_UP by just looking
at the host state.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 drivers/block/sx8.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/sx8.c b/drivers/block/sx8.c
index 7b54353ee92b..420cd952ddc4 100644
--- a/drivers/block/sx8.c
+++ b/drivers/block/sx8.c
@@ -1373,7 +1373,7 @@ static void carm_free_disk(struct carm_host *host, unsigned int port_no)
 	if (!disk)
 		return;
 
-	if (disk->flags & GENHD_FL_UP)
+	if (host->state > HST_DEV_ACTIVATE)
 		del_gendisk(disk);
 	blk_cleanup_disk(disk);
 }
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help