diff options
author | Christoph Hellwig <hch@lst.de> | 2020-09-21 09:19:57 +0200 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2020-09-23 10:43:19 -0600 |
commit | 36daaa98f7ad9224421b18549a3f7bdf4d220414 (patch) | |
tree | 808efd394e827a53a04038b3f268239df47da646 /kernel | |
parent | 21bd900572f3708e281ea25f051fc92462eb1193 (diff) |
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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/swap.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/kernel/power/swap.c b/kernel/power/swap.c index 9d3ffbfe08db..71385bedcc3a 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c @@ -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) |