aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_scsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index 6feece3b2e36..39a621d729e9 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -52,7 +52,7 @@ static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt)
52{ 52{
53 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; 53 struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata;
54 unit->device = NULL; 54 unit->device = NULL;
55 zfcp_unit_put(unit); 55 put_device(&unit->sysfs_device);
56} 56}
57 57
58static int zfcp_scsi_slave_configure(struct scsi_device *sdp) 58static int zfcp_scsi_slave_configure(struct scsi_device *sdp)
@@ -335,8 +335,7 @@ void zfcp_adapter_scsi_unregister(struct zfcp_adapter *adapter)
335 335
336 read_lock_irq(&adapter->port_list_lock); 336 read_lock_irq(&adapter->port_list_lock);
337 list_for_each_entry(port, &adapter->port_list, list) 337 list_for_each_entry(port, &adapter->port_list, list)
338 if (port->rport) 338 port->rport = NULL;
339 port->rport = NULL;
340 read_unlock_irq(&adapter->port_list_lock); 339 read_unlock_irq(&adapter->port_list_lock);
341 340
342 fc_remove_host(shost); 341 fc_remove_host(shost);
@@ -356,7 +355,7 @@ zfcp_init_fc_host_stats(struct zfcp_adapter *adapter)
356 fc_stats = kmalloc(sizeof(*fc_stats), GFP_KERNEL); 355 fc_stats = kmalloc(sizeof(*fc_stats), GFP_KERNEL);
357 if (!fc_stats) 356 if (!fc_stats)
358 return NULL; 357 return NULL;
359 adapter->fc_stats = fc_stats; /* freed in adater_dequeue */ 358 adapter->fc_stats = fc_stats; /* freed in adapter_release */
360 } 359 }
361 memset(adapter->fc_stats, 0, sizeof(*adapter->fc_stats)); 360 memset(adapter->fc_stats, 0, sizeof(*adapter->fc_stats));
362 return adapter->fc_stats; 361 return adapter->fc_stats;
@@ -472,7 +471,7 @@ static void zfcp_reset_fc_host_stats(struct Scsi_Host *shost)
472 adapter->stats_reset = jiffies/HZ; 471 adapter->stats_reset = jiffies/HZ;
473 kfree(adapter->stats_reset_data); 472 kfree(adapter->stats_reset_data);
474 adapter->stats_reset_data = data; /* finally freed in 473 adapter->stats_reset_data = data; /* finally freed in
475 adapter_dequeue */ 474 adapter_release */
476 } 475 }
477} 476}
478 477
@@ -517,7 +516,7 @@ static void zfcp_scsi_terminate_rport_io(struct fc_rport *rport)
517 516
518 if (port) { 517 if (port) {
519 zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL); 518 zfcp_erp_port_reopen(port, 0, "sctrpi1", NULL);
520 zfcp_port_put(port); 519 put_device(&port->sysfs_device);
521 } 520 }
522} 521}
523 522
@@ -559,23 +558,23 @@ static void zfcp_scsi_rport_block(struct zfcp_port *port)
559 558
560void zfcp_scsi_schedule_rport_register(struct zfcp_port *port) 559void zfcp_scsi_schedule_rport_register(struct zfcp_port *port)
561{ 560{
562 zfcp_port_get(port); 561 get_device(&port->sysfs_device);
563 port->rport_task = RPORT_ADD; 562 port->rport_task = RPORT_ADD;
564 563
565 if (!queue_work(port->adapter->work_queue, &port->rport_work)) 564 if (!queue_work(port->adapter->work_queue, &port->rport_work))
566 zfcp_port_put(port); 565 put_device(&port->sysfs_device);
567} 566}
568 567
569void zfcp_scsi_schedule_rport_block(struct zfcp_port *port) 568void zfcp_scsi_schedule_rport_block(struct zfcp_port *port)
570{ 569{
571 zfcp_port_get(port); 570 get_device(&port->sysfs_device);
572 port->rport_task = RPORT_DEL; 571 port->rport_task = RPORT_DEL;
573 572
574 if (port->rport && queue_work(port->adapter->work_queue, 573 if (port->rport && queue_work(port->adapter->work_queue,
575 &port->rport_work)) 574 &port->rport_work))
576 return; 575 return;
577 576
578 zfcp_port_put(port); 577 put_device(&port->sysfs_device);
579} 578}
580 579
581void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter) 580void zfcp_scsi_schedule_rports_block(struct zfcp_adapter *adapter)
@@ -604,7 +603,7 @@ void zfcp_scsi_rport_work(struct work_struct *work)
604 } 603 }
605 } 604 }
606 605
607 zfcp_port_put(port); 606 put_device(&port->sysfs_device);
608} 607}
609 608
610 609
@@ -622,7 +621,7 @@ void zfcp_scsi_scan(struct work_struct *work)
622 scsilun_to_int((struct scsi_lun *) 621 scsilun_to_int((struct scsi_lun *)
623 &unit->fcp_lun), 0); 622 &unit->fcp_lun), 0);
624 623
625 zfcp_unit_put(unit); 624 put_device(&unit->sysfs_device);
626} 625}
627 626
628static int zfcp_execute_fc_job(struct fc_bsg_job *job) 627static int zfcp_execute_fc_job(struct fc_bsg_job *job)