Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a31de969 authored by K. Y. Srinivasan's avatar K. Y. Srinivasan Committed by Greg Kroah-Hartman
Browse files

Staging: hv: Cleanup blkvsc_remove()



blkvsc_remove() cannot fail. Clean it up accordingly.

Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarHaiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: default avatarHank Janssen <hjanssen@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c425065a
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -556,22 +556,12 @@ static int blkvsc_remove(struct device *device)
	struct hv_device *device_obj = device_to_hv_device(device);
	struct block_device_context *blkdev = dev_get_drvdata(device);
	unsigned long flags;
	int ret;


	if (!storvsc_drv_obj->base.dev_rm)
		return -1;

	/*
	 * Call to the vsc driver to let it know that the device is being
	 * removed
	 */
	ret = storvsc_drv_obj->base.dev_rm(device_obj);
	if (ret != 0) {
		/* TODO: */
		DPRINT_ERR(BLKVSC_DRV,
			   "unable to remove blkvsc device (ret %d)", ret);
	}
	storvsc_drv_obj->base.dev_rm(device_obj);

	/* Get to a known state */
	spin_lock_irqsave(&blkdev->lock, flags);
@@ -604,7 +594,8 @@ static int blkvsc_remove(struct device *device)

	kfree(blkdev);

	return ret;
	return 0;

}

static void blkvsc_shutdown(struct device *device)