diff options
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_rdac.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c index 8b9e14318d1b..c5e4476e912b 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c | |||
@@ -525,17 +525,6 @@ static int rdac_activate(struct scsi_device *sdev) | |||
525 | if (err != SCSI_DH_OK) | 525 | if (err != SCSI_DH_OK) |
526 | goto done; | 526 | goto done; |
527 | 527 | ||
528 | if (!h->ctlr) { | ||
529 | err = initialize_controller(sdev, h); | ||
530 | if (err != SCSI_DH_OK) | ||
531 | goto done; | ||
532 | } | ||
533 | |||
534 | if (h->ctlr->use_ms10 == -1) { | ||
535 | err = set_mode_select(sdev, h); | ||
536 | if (err != SCSI_DH_OK) | ||
537 | goto done; | ||
538 | } | ||
539 | if (h->lun_state == RDAC_LUN_UNOWNED) | 528 | if (h->lun_state == RDAC_LUN_UNOWNED) |
540 | err = send_mode_select(sdev, h); | 529 | err = send_mode_select(sdev, h); |
541 | done: | 530 | done: |
@@ -681,12 +670,20 @@ static int rdac_bus_attach(struct scsi_device *sdev) | |||
681 | if (err != SCSI_DH_OK) | 670 | if (err != SCSI_DH_OK) |
682 | goto failed; | 671 | goto failed; |
683 | 672 | ||
684 | err = check_ownership(sdev, h); | 673 | err = initialize_controller(sdev, h); |
685 | if (err != SCSI_DH_OK) | 674 | if (err != SCSI_DH_OK) |
686 | goto failed; | 675 | goto failed; |
687 | 676 | ||
677 | err = check_ownership(sdev, h); | ||
678 | if (err != SCSI_DH_OK) | ||
679 | goto clean_ctlr; | ||
680 | |||
681 | err = set_mode_select(sdev, h); | ||
682 | if (err != SCSI_DH_OK) | ||
683 | goto clean_ctlr; | ||
684 | |||
688 | if (!try_module_get(THIS_MODULE)) | 685 | if (!try_module_get(THIS_MODULE)) |
689 | goto failed; | 686 | goto clean_ctlr; |
690 | 687 | ||
691 | spin_lock_irqsave(sdev->request_queue->queue_lock, flags); | 688 | spin_lock_irqsave(sdev->request_queue->queue_lock, flags); |
692 | sdev->scsi_dh_data = scsi_dh_data; | 689 | sdev->scsi_dh_data = scsi_dh_data; |
@@ -698,6 +695,9 @@ static int rdac_bus_attach(struct scsi_device *sdev) | |||
698 | 695 | ||
699 | return 0; | 696 | return 0; |
700 | 697 | ||
698 | clean_ctlr: | ||
699 | kref_put(&h->ctlr->kref, release_controller); | ||
700 | |||
701 | failed: | 701 | failed: |
702 | kfree(scsi_dh_data); | 702 | kfree(scsi_dh_data); |
703 | sdev_printk(KERN_ERR, sdev, "%s: not attached\n", | 703 | sdev_printk(KERN_ERR, sdev, "%s: not attached\n", |