]> err.no Git - linux-2.6/blobdiff - drivers/message/fusion/mptctl.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[linux-2.6] / drivers / message / fusion / mptctl.c
index b7d1159916c27191ece3344b573acea54605a0c0..e630b50966ec5ba0192a36acb9e22a328e9b5675 100644 (file)
@@ -348,7 +348,7 @@ static int mptctl_bus_reset(MPT_IOCTL *ioctl)
        if (ioctl->ioc->sh == NULL)
                return -EPERM;
 
-       hd = (MPT_SCSI_HOST *) ioctl->ioc->sh->hostdata;
+       hd = shost_priv(ioctl->ioc->sh);
        if (hd == NULL)
                return -EPERM;
 
@@ -449,7 +449,7 @@ mptctl_free_tm_flags(MPT_ADAPTER *ioc)
        MPT_SCSI_HOST * hd;
        unsigned long flags;
 
-       hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
+       hd = shost_priv(ioc->sh);
        if (hd == NULL)
                return;
 
@@ -1708,7 +1708,7 @@ mptctl_replace_fw (unsigned long arg)
  *
  * Outputs:    None.
  * Return:     0 if successful
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -EFAULT if data unavailable
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
@@ -1748,7 +1748,7 @@ mptctl_mpt_command (unsigned long arg)
  *
  * Outputs:    None.
  * Return:     0 if successful
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -EFAULT if data unavailable
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
@@ -1774,7 +1774,10 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
        ulong           timeout;
        struct scsi_device *sdev;
 
+       /* bufIn and bufOut are used for user to kernel space transfers
+        */
        bufIn.kptr = bufOut.kptr = NULL;
+       bufIn.len = bufOut.len = 0;
 
        if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
            (ioc == NULL)) {
@@ -2026,7 +2029,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
        case MPI_FUNCTION_SCSI_TASK_MGMT:
                {
                        MPT_SCSI_HOST *hd = NULL;
-                       if ((ioc->sh == NULL) || ((hd = (MPT_SCSI_HOST *)ioc->sh->hostdata) == NULL)) {
+                       if ((ioc->sh == NULL) || ((hd = shost_priv(ioc->sh)) == NULL)) {
                                printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_do_mpt_command - "
                                        "SCSI driver not loaded or SCSI host not found. \n",
                                        ioc->name, __FILE__, __LINE__);
@@ -2108,11 +2111,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
        psge = (char *) (((int *) mf) + karg.dataSgeOffset);
        flagsLength = 0;
 
-       /* bufIn and bufOut are used for user to kernel space transfers
-        */
-       bufIn.kptr = bufOut.kptr = NULL;
-       bufIn.len = bufOut.len = 0;
-
        if (karg.dataOutSize > 0)
                sgSize ++;
 
@@ -2318,7 +2316,7 @@ done_free_mem:
  * Outputs:    None.
  * Return:     0 if successful
  *             -EFAULT if data unavailable
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
  *             -ENOMEM if memory allocation error
@@ -2466,7 +2464,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
        karg.soft_resets = 0;
        karg.timeouts = 0;
        if (ioc->sh != NULL) {
-               MPT_SCSI_HOST *hd =  (MPT_SCSI_HOST *)ioc->sh->hostdata;
+               MPT_SCSI_HOST *hd =  shost_priv(ioc->sh);
 
                if (hd && (cim_rev == 1)) {
                        karg.hard_resets = hd->hard_resets;
@@ -2555,7 +2553,7 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
  * Outputs:    None.
  * Return:     0 if successful
  *             -EFAULT if data unavailable
- *             -EBUSY  if previous command timout and IOC reset is not complete.
+ *             -EBUSY  if previous command timeout and IOC reset is not complete.
  *             -ENODEV if no such device/adapter
  *             -ETIME  if timer expires
  *             -ENOMEM if memory allocation error
@@ -2683,7 +2681,7 @@ mptctl_hp_targetinfo(unsigned long arg)
                        pci_free_consistent(ioc->pcidev, data_sz, (u8 *) pg3_alloc, page_dma);
                }
        }
-       hd = (MPT_SCSI_HOST *) ioc->sh->hostdata;
+       hd = shost_priv(ioc->sh);
        if (hd != NULL)
                karg.select_timeouts = hd->sel_timeout[karg.hdr.id];