diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-04-01 00:10:42 +0400 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 15:00:36 +0400 |
commit | 037afc7812e2b202fbc18218e6c0eff34dad36ed (patch) | |
tree | c5a176ecc5aa34d6d1b98c9fd92797c4bb14155e /drivers/scsi/isci/remote_device.c | |
parent | ed8a72d108bd951909b28fa4a89aad6489f414e1 (diff) | |
download | linux-037afc7812e2b202fbc18218e6c0eff34dad36ed.tar.xz |
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.c | 22 |
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) * isci_remote_device_ready() - This function is called by the scic when the * remote device is ready. We mark the isci device as ready and signal the * waiting proccess. - * @idev: This parameter specifies the remote device + * @ihost: our valid isci_host + * @idev: remote device * */ -void isci_remote_device_ready(struct isci_remote_device *idev) +void isci_remote_device_ready(struct isci_host *ihost, struct isci_remote_device *idev) { - struct isci_host *ihost = idev->isci_port->isci_host; - dev_dbg(&ihost->pdev->dev, "%s: idev = %p\n", __func__, idev); @@ -304,18 +303,17 @@ void isci_remote_device_ready(struct isci_remote_device *idev) * @isci_device: This parameter specifies the remote device * */ -void isci_remote_device_not_ready( - struct isci_remote_device *isci_device, - u32 reason_code) +void isci_remote_device_not_ready(struct isci_host *ihost, + struct isci_remote_device *idev, u32 reason) { - dev_dbg(&isci_device->isci_port->isci_host->pdev->dev, - "%s: isci_device = %p\n", __func__, isci_device); + dev_dbg(&ihost->pdev->dev, + "%s: isci_device = %p\n", __func__, idev); - if (reason_code == SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED) - isci_remote_device_change_state(isci_device, isci_stopping); + if (reason == SCIC_REMOTE_DEVICE_NOT_READY_STOP_REQUESTED) + isci_remote_device_change_state(idev, isci_stopping); else /* device ready is actually a "not ready for io" state. */ - isci_remote_device_change_state(isci_device, isci_ready); + isci_remote_device_change_state(idev, isci_ready); } /** |