diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvstgt.c | 1 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_srp.c | 10 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c index 3db03dd6b56e..82bcab688b44 100644 --- a/drivers/scsi/ibmvscsi/ibmvstgt.c +++ b/drivers/scsi/ibmvscsi/ibmvstgt.c | |||
@@ -820,6 +820,7 @@ static struct scsi_host_template ibmvstgt_sht = { | |||
820 | .eh_abort_handler = ibmvstgt_eh_abort_handler, | 820 | .eh_abort_handler = ibmvstgt_eh_abort_handler, |
821 | .shost_attrs = ibmvstgt_attrs, | 821 | .shost_attrs = ibmvstgt_attrs, |
822 | .proc_name = TGT_NAME, | 822 | .proc_name = TGT_NAME, |
823 | .supported_mode = MODE_TARGET, | ||
823 | }; | 824 | }; |
824 | 825 | ||
825 | static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id) | 826 | static int ibmvstgt_probe(struct vio_dev *dev, const struct vio_device_id *id) |
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index 430501ef9f02..44a340bd937b 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c | |||
@@ -222,7 +222,8 @@ struct srp_rport *srp_rport_add(struct Scsi_Host *shost, | |||
222 | return ERR_PTR(ret); | 222 | return ERR_PTR(ret); |
223 | } | 223 | } |
224 | 224 | ||
225 | if (ids->roles == SRP_RPORT_ROLE_INITIATOR) { | 225 | if (shost->active_mode & MODE_TARGET && |
226 | ids->roles == SRP_RPORT_ROLE_INITIATOR) { | ||
226 | ret = srp_tgt_it_nexus_create(shost, (unsigned long)rport, | 227 | ret = srp_tgt_it_nexus_create(shost, (unsigned long)rport, |
227 | rport->port_id); | 228 | rport->port_id); |
228 | if (ret) { | 229 | if (ret) { |
@@ -249,10 +250,11 @@ EXPORT_SYMBOL_GPL(srp_rport_add); | |||
249 | void srp_rport_del(struct srp_rport *rport) | 250 | void srp_rport_del(struct srp_rport *rport) |
250 | { | 251 | { |
251 | struct device *dev = &rport->dev; | 252 | struct device *dev = &rport->dev; |
253 | struct Scsi_Host *shost = dev_to_shost(dev->parent); | ||
252 | 254 | ||
253 | if (rport->roles == SRP_RPORT_ROLE_INITIATOR) | 255 | if (shost->active_mode & MODE_TARGET && |
254 | srp_tgt_it_nexus_destroy(dev_to_shost(dev->parent), | 256 | rport->roles == SRP_RPORT_ROLE_INITIATOR) |
255 | (unsigned long)rport); | 257 | srp_tgt_it_nexus_destroy(shost, (unsigned long)rport); |
256 | 258 | ||
257 | transport_remove_device(dev); | 259 | transport_remove_device(dev); |
258 | device_del(dev); | 260 | device_del(dev); |