diff options
Diffstat (limited to 'drivers/scsi/mpt2sas/mpt2sas_transport.c')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_transport.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c index ff2500ab9ba4..af868009395d 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_transport.c +++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c | |||
@@ -1323,15 +1323,17 @@ _transport_get_enclosure_identifier(struct sas_rphy *rphy, u64 *identifier) | |||
1323 | int rc; | 1323 | int rc; |
1324 | 1324 | ||
1325 | spin_lock_irqsave(&ioc->sas_device_lock, flags); | 1325 | spin_lock_irqsave(&ioc->sas_device_lock, flags); |
1326 | sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc, | 1326 | sas_device = __mpt2sas_get_sdev_by_addr(ioc, |
1327 | rphy->identify.sas_address); | 1327 | rphy->identify.sas_address); |
1328 | if (sas_device) { | 1328 | if (sas_device) { |
1329 | *identifier = sas_device->enclosure_logical_id; | 1329 | *identifier = sas_device->enclosure_logical_id; |
1330 | rc = 0; | 1330 | rc = 0; |
1331 | sas_device_put(sas_device); | ||
1331 | } else { | 1332 | } else { |
1332 | *identifier = 0; | 1333 | *identifier = 0; |
1333 | rc = -ENXIO; | 1334 | rc = -ENXIO; |
1334 | } | 1335 | } |
1336 | |||
1335 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | 1337 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
1336 | return rc; | 1338 | return rc; |
1337 | } | 1339 | } |
@@ -1351,12 +1353,14 @@ _transport_get_bay_identifier(struct sas_rphy *rphy) | |||
1351 | int rc; | 1353 | int rc; |
1352 | 1354 | ||
1353 | spin_lock_irqsave(&ioc->sas_device_lock, flags); | 1355 | spin_lock_irqsave(&ioc->sas_device_lock, flags); |
1354 | sas_device = mpt2sas_scsih_sas_device_find_by_sas_address(ioc, | 1356 | sas_device = __mpt2sas_get_sdev_by_addr(ioc, |
1355 | rphy->identify.sas_address); | 1357 | rphy->identify.sas_address); |
1356 | if (sas_device) | 1358 | if (sas_device) { |
1357 | rc = sas_device->slot; | 1359 | rc = sas_device->slot; |
1358 | else | 1360 | sas_device_put(sas_device); |
1361 | } else { | ||
1359 | rc = -ENXIO; | 1362 | rc = -ENXIO; |
1363 | } | ||
1360 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); | 1364 | spin_unlock_irqrestore(&ioc->sas_device_lock, flags); |
1361 | return rc; | 1365 | return rc; |
1362 | } | 1366 | } |