[RFC 00/12] block: *add_disk*() driver conversions __register_blkdev()

From: Luis Chamberlain
Date: Thu Jul 15 2021 - 16:59:35 EST


This is the 4th group of driver conversion examples. This set is
complete, as there are only a few drivers which use __register_blkdev().
The __register_blkdev() call uses an optional probe call, and if set
will be used when blk_request_module() is called for the block device.
Since these probe calls can fail, now that we added *add_disk*() error
handling, take advatage of this and extend the probe call to capture
the errors.

There are only a few drivers which benefit from this. The meat of the
work is the last patch, which includes all driver conversions. The rest
of the patches are adding add_disk() error handling in the other
places of the drivers.

Luis Chamberlain (12):
floppy: fix add_disk() assumption on exit
floppy: use blk_cleanup_disk()
floppy: add error handling support for add_disk()
scsi/sd: use blk_cleanup_queue() insted of put_disk()
scsi/sd: add error handling support for add_disk()
scsi/sr: use blk_cleanup_disk() instead of put_disk()
scsi/sr: add error handling support for add_disk()
block/ataflop: use the blk_cleanup_disk() helper
block/ataflop: add a helper for removing disks
block/ataflop add error handling support for add_disk()
block/brd: add error handling support for add_disk()
block: make probe in blk_request_module() return an error

block/genhd.c | 15 ++++++----
drivers/block/ataflop.c | 66 ++++++++++++++++++++++++-----------------
drivers/block/brd.c | 17 ++++++++---
drivers/block/floppy.c | 48 ++++++++++++++----------------
drivers/block/loop.c | 6 ++--
drivers/scsi/sd.c | 11 +++++--
drivers/scsi/sr.c | 7 +++--
fs/block_dev.c | 5 +++-
include/linux/genhd.h | 4 +--
9 files changed, 105 insertions(+), 74 deletions(-)

--
2.27.0