/* swsusp_swap_check - check if the resume device is a swap device and get its index (if so)  */
static int swsusp_swap_check(void)
/* swsusp_swap_check - check if the resume device is a swap device and get its index (if so)  */
static int swsusp_swap_check(void)
{
	int res;
	res = swap_type_of(swsusp_resume_device, swsusp_resume_block,
			&resume_bdev);
	if (res < 0)
		return res;
	root_swap = res;
	res = blkdev_get(resume_bdev, FMODE_WRITE);
	if (res)
		return res;
	res = set_blocksize(resume_bdev, PAGE_SIZE);
	if (res < 0)
		blkdev_put(resume_bdev, FMODE_WRITE);
	return res;
}