There is quite a bit of code on del_gendisk() which relates toReviewed-by: Hannes Reinecke <hare@xxxxxxx>
unregistering the disk, using register_disk() as an counter.
Move all this code into a helper instead of re-writing our own,
which we'll need later to handle errors on add_disk().
Since disk unregistrationa also deals with parition unregistration,
provide a halper for that as well, as we'll later need this when
adding error handling for add_disk().
Signed-off-by: Luis Chamberlain <mcgrof@xxxxxxxxxx>
---
block/genhd.c | 56 +++++++++++++++++++++++++++++----------------------
1 file changed, 32 insertions(+), 24 deletions(-)