aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_unit.c')
-rw-r--r--drivers/s390/scsi/zfcp_unit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_unit.c b/drivers/s390/scsi/zfcp_unit.c
index 1119c535a66..20796ebc33c 100644
--- a/drivers/s390/scsi/zfcp_unit.c
+++ b/drivers/s390/scsi/zfcp_unit.c
@@ -142,6 +142,8 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
142 return -ENOMEM; 142 return -ENOMEM;
143 } 143 }
144 144
145 get_device(&port->dev);
146
145 if (device_register(&unit->dev)) { 147 if (device_register(&unit->dev)) {
146 put_device(&unit->dev); 148 put_device(&unit->dev);
147 return -ENOMEM; 149 return -ENOMEM;
@@ -152,8 +154,6 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
152 return -EINVAL; 154 return -EINVAL;
153 } 155 }
154 156
155 get_device(&port->dev);
156
157 write_lock_irq(&port->unit_list_lock); 157 write_lock_irq(&port->unit_list_lock);
158 list_add_tail(&unit->list, &port->unit_list); 158 list_add_tail(&unit->list, &port->unit_list);
159 write_unlock_irq(&port->unit_list_lock); 159 write_unlock_irq(&port->unit_list_lock);