Commit 841ab72c authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

dasd: cleanup dasd_scan_partitions

Use blkdev_get_by_dev instead of bdget_disk + blkdev_get.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarStefan Haberland <sth@linux.ibm.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 5a56ad78
...@@ -101,18 +101,11 @@ int dasd_scan_partitions(struct dasd_block *block) ...@@ -101,18 +101,11 @@ int dasd_scan_partitions(struct dasd_block *block)
struct block_device *bdev; struct block_device *bdev;
int rc; int rc;
bdev = bdget_disk(block->gdp, 0); bdev = blkdev_get_by_dev(disk_devt(block->gdp), FMODE_READ, NULL);
if (!bdev) { if (IS_ERR(bdev)) {
DBF_DEV_EVENT(DBF_ERR, block->base, "%s",
"scan partitions error, bdget returned NULL");
return -ENODEV;
}
rc = blkdev_get(bdev, FMODE_READ, NULL);
if (rc < 0) {
DBF_DEV_EVENT(DBF_ERR, block->base, DBF_DEV_EVENT(DBF_ERR, block->base,
"scan partitions error, blkdev_get returned %d", "scan partitions error, blkdev_get returned %ld",
rc); PTR_ERR(bdev));
return -ENODEV; return -ENODEV;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment