aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci/remote_device.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-03-31 16:10:42 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:00:36 -0400
commit037afc7812e2b202fbc18218e6c0eff34dad36ed (patch)
treec5a176ecc5aa34d6d1b98c9fd92797c4bb14155e /drivers/scsi/isci/remote_device.c
parented8a72d108bd951909b28fa4a89aad6489f414e1 (diff)
isci: cleanup isci_remote_device[_not]_ready interface
Require a valid isci_host in support of the general cleanup to not re-lookup the host via potentially fragile methods when more robust methods are available. Also cleans up some more casting that should be using container_of() to up-cast a base structure in a more type-safe manner. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/remote_device.c')
-rw-r--r--drivers/scsi/isci/remote_device.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index 6fe6815e4b74..0fdaa6d62c1b 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -281,13 +281,12 @@ isci_remote_device_alloc(struct isci_host *ihost, struct isci_port *iport)
281 * isci_remote_device_ready() - This function is called by the scic when the 281 * isci_remote_device_ready() - This function is called by the scic when the
282 * remote device is ready. We mark the isci device as ready and signal the 282 * remote device is ready. We mark the isci device as ready and signal the
283 * waiting proccess. 283 * waiting proccess.
284 * @idev: This parameter specifies the remote device 284 * @ihost: our valid isci_host
285 * @idev: remote device
285 * 286 *
286 */ 287 */
287void isci_remote_device_ready(struct isci_remote_device *idev) 288void isci_remote_device_ready(struct isci_host *ihost, struct isci_remote_device *idev)
288{ 289{
289 struct isci_host *ihost = idev->isci_port->isci_host;
290
291 dev_dbg(&ihost->pdev->dev, 290 dev_dbg(&ihost->pdev->dev,
292 "%s: idev = %p\n", __func__, idev); 291 "%s: idev = %p\n", __func__, idev);
293 292
@@ -304,18 +303,17 @@ void isci_remote_device_ready(struct isci_remote_device *idev)
304 * @isci_device: This parameter specifies the remote device 303 * @isci_device: This parameter specifies the remote device
305 * 304 *
306 */ 305 */
307void isci_remote_device_not_ready( 306void isci_remote_device_not_ready(struct isci_host *ihost,
308 struct isci_remote_device *isci_device, 307 struct isci_remote_device *idev, u32 reason)
309 u32 reason_code)
310{ 308{
311 dev_dbg(&isci_device->isci_port->isci_host->pdev->dev, 309 dev_dbg(&ihost->pdev->dev,
312 "%s: isci_device = %p\n", __func__, isci_device); 310 "%s: isci_device = %p\n", __func__, idev);
313 311
314 if (reason_code == SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED) 312 if (reason == SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED)
315 isci_remote_device_change_state(isci_device, isci_stopping); 313 isci_remote_device_change_state(idev, isci_stopping);
316 else 314 else
317 /* device ready is actually a "not ready for io" state. */ 315 /* device ready is actually a "not ready for io" state. */
318 isci_remote_device_change_state(isci_device, isci_ready); 316 isci_remote_device_change_state(idev, isci_ready);
319} 317}
320 318
321/** 319/**