PM: mm: cleanup swsusp_swap_check

Use blkdev_get_by_dev instead of bdget + blkdev_get.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Christoph Hellwig 2020-09-21 09:19:57 +02:00 committed by Jens Axboe
parent 21bd900572
commit 36daaa98f7

View File

@ -343,12 +343,10 @@ static int swsusp_swap_check(void)
return res; return res;
root_swap = res; root_swap = res;
hib_resume_bdev = bdget(swsusp_resume_device); hib_resume_bdev = blkdev_get_by_dev(swsusp_resume_device, FMODE_WRITE,
if (!hib_resume_bdev) NULL);
return -ENOMEM; if (IS_ERR(hib_resume_bdev))
res = blkdev_get(hib_resume_bdev, FMODE_WRITE, NULL); return PTR_ERR(hib_resume_bdev);
if (res)
return res;
res = set_blocksize(hib_resume_bdev, PAGE_SIZE); res = set_blocksize(hib_resume_bdev, PAGE_SIZE);
if (res < 0) if (res < 0)