diff options
Diffstat (limited to 'drivers/scsi/mpt3sas/mpt3sas_transport.c')
-rw-r--r-- | drivers/scsi/mpt3sas/mpt3sas_transport.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/scsi/mpt3sas/mpt3sas_transport.c b/drivers/scsi/mpt3sas/mpt3sas_transport.c index 70fd019e7ee5..ca36d7ea0964 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_transport.c +++ b/drivers/scsi/mpt3sas/mpt3sas_transport.c | |||
@@ -734,7 +734,7 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, | |||
734 | rphy->identify = mpt3sas_port->remote_identify; | 734 | rphy->identify = mpt3sas_port->remote_identify; |
735 | 735 | ||
736 | if (mpt3sas_port->remote_identify.device_type == SAS_END_DEVICE) { | 736 | if (mpt3sas_port->remote_identify.device_type == SAS_END_DEVICE) { |
737 | sas_device = mpt3sas_scsih_sas_device_find_by_sas_address(ioc, | 737 | sas_device = mpt3sas_get_sdev_by_addr(ioc, |
738 | mpt3sas_port->remote_identify.sas_address); | 738 | mpt3sas_port->remote_identify.sas_address); |
739 | if (!sas_device) { | 739 | if (!sas_device) { |
740 | dfailprintk(ioc, printk(MPT3SAS_FMT | 740 | dfailprintk(ioc, printk(MPT3SAS_FMT |
@@ -750,8 +750,10 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, | |||
750 | ioc->name, __FILE__, __LINE__, __func__); | 750 | ioc->name, __FILE__, __LINE__, __func__); |
751 | } | 751 | } |
752 | 752 | ||
753 | if (mpt3sas_port->remote_identify.device_type == SAS_END_DEVICE) | 753 | if (mpt3sas_port->remote_identify.device_type == SAS_END_DEVICE) { |
754 | sas_device->pend_sas_rphy_add = 0; | 754 | sas_device->pend_sas_rphy_add = 0; |
755 | sas_device_put(sas_device); | ||
756 | } | ||
755 | 757 | ||
756 | if ((ioc->logging_level & MPT_DEBUG_TRANSPORT)) | 758 | if ((ioc->logging_level & MPT_DEBUG_TRANSPORT)) |
757 | dev_printk(KERN_INFO, &rphy->dev, | 759 | dev_printk(KERN_INFO, &rphy->dev, |
@@ -1324,15 +1326,17 @@ _transport_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) | |||
1324 | int rc; | 1326 | int rc; |
1325 | 1327 | ||
1326 | spin_lock_irqsave(&ioc->sas_device_lock, flags); | 1328 | spin_lock_irqsave(&ioc->sas_device_lock, flags); |
1327 | sas_device = mpt3sas_scsih_sas_device_find_by_sas_address(ioc, | 1329 | sas_device = __mpt3sas_get_sdev_by_addr(ioc, |
1328 | rphy->identify.sas_address); | 1330 | rphy->identify.sas_address); |
1329 | if (sas_device) { | 1331 | if (sas_device) { |
1330 | *identifier = sas_device->enclosure_logical_id; | 1332 | *identifier = sas_device->enclosure_logical_id; |
1331 | rc = 0; | 1333 | rc = 0; |
1334 | sas_device_put(sas_device); | ||
1332 | } else { | 1335 | } else { |
1333 | *identifier = 0; | 1336 | *identifier = 0; |
1334 | rc = -ENXIO; | 1337 | rc = -ENXIO; |
1335 | } | 1338 | } |
1339 | |||
1336 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | 1340 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
1337 | return rc; | 1341 | return rc; |
1338 | } | 1342 | } |
@@ -1352,12 +1356,14 @@ _transport_get_bay_identifier(struct sas_rphy *rphy) | |||
1352 | int rc; | 1356 | int rc; |
1353 | 1357 | ||
1354 | spin_lock_irqsave(&ioc->sas_device_lock, flags); | 1358 | spin_lock_irqsave(&ioc->sas_device_lock, flags); |
1355 | sas_device = mpt3sas_scsih_sas_device_find_by_sas_address(ioc, | 1359 | sas_device = __mpt3sas_get_sdev_by_addr(ioc, |
1356 | rphy->identify.sas_address); | 1360 | rphy->identify.sas_address); |
1357 | if (sas_device) | 1361 | if (sas_device) { |
1358 | rc = sas_device->slot; | 1362 | rc = sas_device->slot; |
1359 | else | 1363 | sas_device_put(sas_device); |
1364 | } else { | ||
1360 | rc = -ENXIO; | 1365 | rc = -ENXIO; |
1366 | } | ||
1361 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | 1367 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
1362 | return rc; | 1368 | return rc; |
1363 | } | 1369 | } |