aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_ccw.c
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2009-11-24 10:53:59 -0500
committerJames Bottomley <James.Bottomley@suse.de>2009-12-04 13:02:02 -0500
commitf3450c7b917201bb49d67032e9f60d5125675d6a (patch)
tree404b1c23490b0a5ba3d6cbbb14e64381a12a108a /drivers/s390/scsi/zfcp_ccw.c
parentecf0c7721b104c0ce9c8ca534c911f6310cf92a8 (diff)
[SCSI] zfcp: Replace local reference counting with common kref
Replace the local reference counting by already available mechanisms offered by kref. Where possible existing device structures were used, including the same functionality. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_ccw.c')
-rw-r--r--drivers/s390/scsi/zfcp_ccw.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c
index aca2047dc2d5..c89dbe250377 100644
--- a/drivers/s390/scsi/zfcp_ccw.c
+++ b/drivers/s390/scsi/zfcp_ccw.c
@@ -128,13 +128,15 @@ static void zfcp_ccw_remove(struct ccw_device *ccw_device)
128 write_unlock_irq(&adapter->port_list_lock); 128 write_unlock_irq(&adapter->port_list_lock);
129 mutex_unlock(&zfcp_data.config_mutex); 129 mutex_unlock(&zfcp_data.config_mutex);
130 130
131 list_for_each_entry_safe(port, p, &port_remove_lh, list) { 131 list_for_each_entry_safe(unit, u, &unit_remove_lh, list)
132 list_for_each_entry_safe(unit, u, &unit_remove_lh, list) 132 zfcp_device_unregister(&unit->sysfs_device,
133 zfcp_unit_dequeue(unit); 133 &zfcp_sysfs_unit_attrs);
134 zfcp_port_dequeue(port); 134
135 } 135 list_for_each_entry_safe(port, p, &port_remove_lh, list)
136 wait_event(adapter->remove_wq, atomic_read(&adapter->refcount) == 0); 136 zfcp_device_unregister(&port->sysfs_device,
137 zfcp_adapter_dequeue(adapter); 137 &zfcp_sysfs_port_attrs);
138
139 kref_put(&adapter->ref, zfcp_adapter_release);
138} 140}
139 141
140/** 142/**