]> git.hungrycats.org Git - linux/commitdiff
[PATCH] sym2 get host
authorJens Axboe <axboe@suse.de>
Fri, 18 Oct 2002 03:47:36 +0000 (20:47 -0700)
committerJens Axboe <axboe@suse.de>
Fri, 18 Oct 2002 03:47:36 +0000 (20:47 -0700)
Recent scsi host changes broke sym2, it iterates over the scsi host list
itself. This patch changes sym2 to use scsi_host_hn_get() to find a scsi
host from its hostno.

drivers/scsi/sym53c8xx_2/sym_glue.c

index 685a29399965d8ca77ce50a6d6ec12de9408e69c..3b096fc6eaec9449aadab1e7ef47ead27ecdd33c 100644 (file)
@@ -1793,16 +1793,12 @@ static int sym53c8xx_proc_info(char *buffer, char **start, off_t offset,
        hcb_p np = 0;
        int retv;
 
-       for (host = first_host; host; host = host->next) {
-               if (host->hostt != first_host->hostt)
-                       continue;
-               if (host->host_no == hostno) {
-                       host_data = (struct host_data *) host->hostdata;
-                       np = host_data->ncb;
-                       break;
-               }
-       }
+       host = scsi_host_hn_get(hostno);
+       if (!host)
+               return -EINVAL;
 
+       host_data = (struct host_data *) host->hostdata;
+       np = host_data->ncb;
        if (!np)
                return -EINVAL;
 
@@ -1823,6 +1819,7 @@ static int sym53c8xx_proc_info(char *buffer, char **start, off_t offset,
 #endif
        }
 
+       scsi_host_put(host);
        return retv;
 }
 #endif /* SYM_LINUX_PROC_INFO_SUPPORT */