summaryrefslogtreecommitdiff
path: root/drivers/target/target_core_device.c
diff options
context:
space:
mode:
authorMike Christie <mchristi@redhat.com>2017-06-23 09:18:12 +0300
committerNicholas Bellinger <nab@linux-iscsi.org>2017-07-07 09:11:37 +0300
commit926347061ef1f4d3873829fd1960c6e4b965aa9f (patch)
treefcad36c9ecdda953447bdb8bf19975531a92162c /drivers/target/target_core_device.c
parent2d76443e02f260d7a5bd0ede1851ae5534f0c68d (diff)
downloadlinux-926347061ef1f4d3873829fd1960c6e4b965aa9f.tar.xz
target: break up free_device callback
With this patch free_device is now used to free what is allocated in the alloc_device callback and destroy_device tears down the resources that are setup in the configure_device callback. This patch will be needed in the next patch where tcmu needs to be able to look up the device in the destroy callback. Signed-off-by: Mike Christie <mchristi@redhat.com> Reviewed-by: Bart Van Assche <bart.vanassche@wdc.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_device.c')
-rw-r--r--drivers/target/target_core_device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 11c80c47b9d3..16a701fed66b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -974,6 +974,8 @@ void target_free_device(struct se_device *dev)
if (dev->dev_flags & DF_CONFIGURED) {
destroy_workqueue(dev->tmr_wq);
+ dev->transport->destroy_device(dev);
+
mutex_lock(&g_device_mutex);
list_del(&dev->g_dev_node);
mutex_unlock(&g_device_mutex);