Staging: hv: Cleanup blkvsc_remove()
blkvsc_remove() cannot fail. Clean it up accordingly. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c425065a18
commit
a31de969bf
1 changed files with 3 additions and 12 deletions
|
@ -556,22 +556,12 @@ static int blkvsc_remove(struct device *device)
|
||||||
struct hv_device *device_obj = device_to_hv_device(device);
|
struct hv_device *device_obj = device_to_hv_device(device);
|
||||||
struct block_device_context *blkdev = dev_get_drvdata(device);
|
struct block_device_context *blkdev = dev_get_drvdata(device);
|
||||||
unsigned long flags;
|
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
|
* Call to the vsc driver to let it know that the device is being
|
||||||
* removed
|
* removed
|
||||||
*/
|
*/
|
||||||
ret = storvsc_drv_obj->base.dev_rm(device_obj);
|
storvsc_drv_obj->base.dev_rm(device_obj);
|
||||||
if (ret != 0) {
|
|
||||||
/* TODO: */
|
|
||||||
DPRINT_ERR(BLKVSC_DRV,
|
|
||||||
"unable to remove blkvsc device (ret %d)", ret);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Get to a known state */
|
/* Get to a known state */
|
||||||
spin_lock_irqsave(&blkdev->lock, flags);
|
spin_lock_irqsave(&blkdev->lock, flags);
|
||||||
|
@ -604,7 +594,8 @@ static int blkvsc_remove(struct device *device)
|
||||||
|
|
||||||
kfree(blkdev);
|
kfree(blkdev);
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void blkvsc_shutdown(struct device *device)
|
static void blkvsc_shutdown(struct device *device)
|
||||||
|
|
Loading…
Add table
Reference in a new issue