summaryrefslogtreecommitdiffstats
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 1119c535a667..20796ebc33ce 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)
return -ENOMEM;
}
+ get_device(&port->dev);
+
if (device_register(&unit->dev)) {
put_device(&unit->dev);
return -ENOMEM;
@@ -152,8 +154,6 @@ int zfcp_unit_add(struct zfcp_port *port, u64 fcp_lun)
return -EINVAL;
}
- get_device(&port->dev);
-
write_lock_irq(&port->unit_list_lock);
list_add_tail(&unit->list, &port->unit_list);
write_unlock_irq(&port->unit_list_lock);