block: cleanup partition scanning in register_disk
authorChristoph Hellwig <hch@lst.de>
Mon, 21 Sep 2020 07:19:46 +0000 (09:19 +0200)
committerJens Axboe <axboe@kernel.dk>
Wed, 23 Sep 2020 16:43:19 +0000 (10:43 -0600)
commit9301fe734384990ef9a2463cb7aeb3b00bf5dad5
tree2cfaa7c9ad519b65e74e6cf2a02a995b0b24c498
parent38430f0876fa8b9549ec434f569dce03e057c076
block: cleanup partition scanning in register_disk

Use blkdev_get_by_dev instead of open coding it using bdget_disk +
blkdev_get, and split the code to read the partition table into a
separate helper to make it a little more obvious.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/genhd.c