aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pluto.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 11:19:33 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-15 11:19:33 -0400
commitdf3d80f5a5c74168be42788364d13cf6c83c7b9c (patch)
tree892a964c2fd28d028f2fb7471e8543d3f4006a58 /drivers/scsi/pluto.c
parent3d06f7a5f74a813cee817c4b30b5e6f0398da0be (diff)
parentc8e91b0a8fc8493e3bf3efcb3c8f866e9453cf1c (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (207 commits) [SCSI] gdth: fix CONFIG_ISA build failure [SCSI] esp_scsi: remove __dev{init,exit} [SCSI] gdth: !use_sg cleanup and use of scsi accessors [SCSI] gdth: Move members from SCp to gdth_cmndinfo, stage 2 [SCSI] gdth: Setup proper per-command private data [SCSI] gdth: Remove gdth_ctr_tab[] [SCSI] gdth: switch to modern scsi host registration [SCSI] gdth: gdth_interrupt() gdth_get_status() & gdth_wait() fixes [SCSI] gdth: clean up host private data [SCSI] gdth: Remove virt hosts [SCSI] gdth: Reorder scsi_host_template intitializers [SCSI] gdth: kill gdth_{read,write}[bwl] wrappers [SCSI] gdth: Remove 2.4.x support, in-kernel changelog [SCSI] gdth: split out pci probing [SCSI] gdth: split out eisa probing [SCSI] gdth: split out isa probing gdth: Make one abuse of scsi_cmnd less obvious [SCSI] NCR5380: Use scsi_eh API for REQUEST_SENSE invocation [SCSI] usb storage: use scsi_eh API in REQUEST_SENSE execution [SCSI] scsi_error: Refactoring scsi_error to facilitate in synchronous REQUEST_SENSE ...
Diffstat (limited to 'drivers/scsi/pluto.c')
-rw-r--r--drivers/scsi/pluto.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/scsi/pluto.c b/drivers/scsi/pluto.c
index d953d43fe2e6..0363c1cd68c1 100644
--- a/drivers/scsi/pluto.c
+++ b/drivers/scsi/pluto.c
@@ -111,13 +111,12 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
111#endif 111#endif
112 return 0; 112 return 0;
113 } 113 }
114 fcs = kmalloc(sizeof (struct ctrl_inquiry) * fcscount, GFP_DMA); 114 fcs = kcalloc(fcscount, sizeof (struct ctrl_inquiry), GFP_DMA);
115 if (!fcs) { 115 if (!fcs) {
116 printk ("PLUTO: Not enough memory to probe\n"); 116 printk ("PLUTO: Not enough memory to probe\n");
117 return 0; 117 return 0;
118 } 118 }
119 119
120 memset (fcs, 0, sizeof (struct ctrl_inquiry) * fcscount);
121 memset (&dev, 0, sizeof(dev)); 120 memset (&dev, 0, sizeof(dev));
122 atomic_set (&fcss, fcscount); 121 atomic_set (&fcss, fcscount);
123 122
@@ -161,7 +160,6 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
161 160
162 SCpnt->request->cmd_flags &= ~REQ_STARTED; 161 SCpnt->request->cmd_flags &= ~REQ_STARTED;
163 162
164 SCpnt->done = pluto_detect_done;
165 SCpnt->request_bufflen = 256; 163 SCpnt->request_bufflen = 256;
166 SCpnt->request_buffer = fcs[i].inquiry; 164 SCpnt->request_buffer = fcs[i].inquiry;
167 PLD(("set up %d %08lx\n", i, (long)SCpnt)) 165 PLD(("set up %d %08lx\n", i, (long)SCpnt))
@@ -196,7 +194,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
196 SCpnt = &(fcs[i].cmd); 194 SCpnt = &(fcs[i].cmd);
197 195
198 /* Let FC mid-level free allocated resources */ 196 /* Let FC mid-level free allocated resources */
199 SCpnt->done (SCpnt); 197 pluto_detect_scsi_done(SCpnt);
200 198
201 if (!SCpnt->result) { 199 if (!SCpnt->result) {
202 struct pluto_inquiry *inq; 200 struct pluto_inquiry *inq;
@@ -211,7 +209,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
211 char *p; 209 char *p;
212 long *ages; 210 long *ages;
213 211
214 ages = kmalloc (((inq->channels + 1) * inq->targets) * sizeof(long), GFP_KERNEL); 212 ages = kcalloc((inq->channels + 1) * inq->targets, sizeof(long), GFP_KERNEL);
215 if (!ages) continue; 213 if (!ages) continue;
216 214
217 host = scsi_register (tpnt, sizeof (struct pluto)); 215 host = scsi_register (tpnt, sizeof (struct pluto));
@@ -238,7 +236,6 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
238 fc->channels = inq->channels + 1; 236 fc->channels = inq->channels + 1;
239 fc->targets = inq->targets; 237 fc->targets = inq->targets;
240 fc->ages = ages; 238 fc->ages = ages;
241 memset (ages, 0, ((inq->channels + 1) * inq->targets) * sizeof(long));
242 239
243 pluto->fc = fc; 240 pluto->fc = fc;
244 memcpy (pluto->rev_str, inq->revision, 4); 241 memcpy (pluto->rev_str, inq->revision, 4);
@@ -260,7 +257,7 @@ int __init pluto_detect(struct scsi_host_template *tpnt)
260 } else 257 } else
261 fc->fcp_register(fc, TYPE_SCSI_FCP, 1); 258 fc->fcp_register(fc, TYPE_SCSI_FCP, 1);
262 } 259 }
263 kfree((char *)fcs); 260 kfree(fcs);
264 if (nplutos) 261 if (nplutos)
265 printk ("PLUTO: Total of %d SparcSTORAGE Arrays found\n", nplutos); 262 printk ("PLUTO: Total of %d SparcSTORAGE Arrays found\n", nplutos);
266 return nplutos; 263 return nplutos;