Commit 36daaa98 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

PM: mm: cleanup swsusp_swap_check

Use blkdev_get_by_dev instead of bdget + blkdev_get.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Acked-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 21bd9005
......@@ -343,12 +343,10 @@ static int swsusp_swap_check(void)
return res;
root_swap = res;
hib_resume_bdev = bdget(swsusp_resume_device);
if (!hib_resume_bdev)
return -ENOMEM;
res = blkdev_get(hib_resume_bdev, FMODE_WRITE, NULL);
if (res)
return res;
hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, FMODE_WRITE,
NULL);
if (IS_ERR(hib_resume_bdev))
return PTR_ERR(hib_resume_bdev);
res = set_blocksize(hib_resume_bdev, PAGE_SIZE);
if (res < 0)
......
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