[RFC 06/12] scsi/sr: use blk_cleanup_disk() instead of put_disk()

Luis Chamberlain
2021-07-15T21:00:11Z

The single put_disk() is useful if you know you're not doing
a cleanup after add_disk(), but since we want to add support
for that, just use the normal form of blk_cleanup_disk() to
cleanup the queue and put the disk.

Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/scsi/sr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 94c254e9012e..362f04a3761a 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -789,7 +789,7 @@ static int sr_probe(struct device *dev)
clear_bit(minor, sr_index_bits);
spin_unlock(&sr_index_lock);
fail_put:
- put_disk(disk);
+ blk_cleanup_disk(disk);
mutex_destroy(&cd->lock);
fail_free:
kfree(cd);
--
2.27.0