diff options
author | Chad Dupuis <chad.dupuis@qlogic.com> | 2010-07-23 06:28:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-28 10:06:11 -0400 |
commit | 8867048b486a64125b62f93af13a379d6d575ee2 (patch) | |
tree | 72bd8422dddba119d0b90831cbe8d6441d0b189f /drivers/scsi/qla2xxx/qla_os.c | |
parent | 14e303d98bcfe4a6075407b531b1df2f237deb28 (diff) |
[SCSI] qla2xxx: Add qla2x00_free_fcports() function
This function was added to encapsulate freeing the memory for all the fcports
associated with a particular vha. Also added a call to qla2x00_free_fcports()
to qla2x00_free_device() to free the memory for all the fcports associated with
a vha during device removal.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 5be8db748964..fcdbf7a0be55 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -2487,11 +2487,24 @@ qla2x00_free_device(scsi_qla_host_t *vha) | |||
2487 | 2487 | ||
2488 | qla2x00_free_irqs(vha); | 2488 | qla2x00_free_irqs(vha); |
2489 | 2489 | ||
2490 | qla2x00_free_fcports(vha); | ||
2491 | |||
2490 | qla2x00_mem_free(ha); | 2492 | qla2x00_mem_free(ha); |
2491 | 2493 | ||
2492 | qla2x00_free_queues(ha); | 2494 | qla2x00_free_queues(ha); |
2493 | } | 2495 | } |
2494 | 2496 | ||
2497 | void qla2x00_free_fcports(struct scsi_qla_host *vha) | ||
2498 | { | ||
2499 | fc_port_t *fcport, *tfcport; | ||
2500 | |||
2501 | list_for_each_entry_safe(fcport, tfcport, &vha->vp_fcports, list) { | ||
2502 | list_del(&fcport->list); | ||
2503 | kfree(fcport); | ||
2504 | fcport = NULL; | ||
2505 | } | ||
2506 | } | ||
2507 | |||
2495 | static inline void | 2508 | static inline void |
2496 | qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport, | 2509 | qla2x00_schedule_rport_del(struct scsi_qla_host *vha, fc_port_t *fcport, |
2497 | int defer) | 2510 | int defer) |