aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ibmvscsi/rpa_vscsi.c
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2007-06-13 18:12:19 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2007-06-17 16:52:25 -0400
commit6c0a60ec52042ece8bf4904c91ac497188e8d70b (patch)
tree27bcae804d75986c54636ba7497775f9f9094a08 /drivers/scsi/ibmvscsi/rpa_vscsi.c
parent2a7309372fe56ae46c499b772d811ad31c501dd9 (diff)
[SCSI] ibmvscsi: Enhanced error logging
Converts ibmvscsi to use dev_printk and friends to simplify debugging. ibmvscsi adapter initialization now looks like this: ibmvscsi 30000005: SRP_VERSION: 16.a ibmvscsi 30000005: partner initialization complete ibmvscsi 30000005: sent SRP login ibmvscsi 30000005: SRP_LOGIN succeeded Additionally, this patch adds the logging of a couple return codes in a couple logs. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ibmvscsi/rpa_vscsi.c')
-rw-r--r--drivers/scsi/ibmvscsi/rpa_vscsi.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c
index d8700aaa6114..9c14e789df5f 100644
--- a/drivers/scsi/ibmvscsi/rpa_vscsi.c
+++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c
@@ -177,7 +177,7 @@ static void set_adapter_info(struct ibmvscsi_host_data *hostdata)
177 memset(&hostdata->madapter_info, 0x00, 177 memset(&hostdata->madapter_info, 0x00,
178 sizeof(hostdata->madapter_info)); 178 sizeof(hostdata->madapter_info));
179 179
180 printk(KERN_INFO "rpa_vscsi: SPR_VERSION: %s\n", SRP_VERSION); 180 dev_info(hostdata->dev, "SRP_VERSION: %s\n", SRP_VERSION);
181 strcpy(hostdata->madapter_info.srp_version, SRP_VERSION); 181 strcpy(hostdata->madapter_info.srp_version, SRP_VERSION);
182 182
183 strncpy(hostdata->madapter_info.partition_name, partition_name, 183 strncpy(hostdata->madapter_info.partition_name, partition_name,
@@ -232,25 +232,24 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
232 232
233 if (rc == 2) { 233 if (rc == 2) {
234 /* Adapter is good, but other end is not ready */ 234 /* Adapter is good, but other end is not ready */
235 printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n"); 235 dev_warn(hostdata->dev, "Partner adapter not ready\n");
236 retrc = 0; 236 retrc = 0;
237 } else if (rc != 0) { 237 } else if (rc != 0) {
238 printk(KERN_WARNING "ibmvscsi: Error %d opening adapter\n", rc); 238 dev_warn(hostdata->dev, "Error %d opening adapter\n", rc);
239 goto reg_crq_failed; 239 goto reg_crq_failed;
240 } 240 }
241 241
242 if (request_irq(vdev->irq, 242 if (request_irq(vdev->irq,
243 ibmvscsi_handle_event, 243 ibmvscsi_handle_event,
244 0, "ibmvscsi", (void *)hostdata) != 0) { 244 0, "ibmvscsi", (void *)hostdata) != 0) {
245 printk(KERN_ERR "ibmvscsi: couldn't register irq 0x%x\n", 245 dev_err(hostdata->dev, "couldn't register irq 0x%x\n",
246 vdev->irq); 246 vdev->irq);
247 goto req_irq_failed; 247 goto req_irq_failed;
248 } 248 }
249 249
250 rc = vio_enable_interrupts(vdev); 250 rc = vio_enable_interrupts(vdev);
251 if (rc != 0) { 251 if (rc != 0) {
252 printk(KERN_ERR "ibmvscsi: Error %d enabling interrupts!!!\n", 252 dev_err(hostdata->dev, "Error %d enabling interrupts!!!\n", rc);
253 rc);
254 goto req_irq_failed; 253 goto req_irq_failed;
255 } 254 }
256 255
@@ -294,7 +293,7 @@ int ibmvscsi_reenable_crq_queue(struct crq_queue *queue,
294 } while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); 293 } while ((rc == H_IN_PROGRESS) || (rc == H_BUSY) || (H_IS_LONG_BUSY(rc)));
295 294
296 if (rc) 295 if (rc)
297 printk(KERN_ERR "ibmvscsi: Error %d enabling adapter\n", rc); 296 dev_err(hostdata->dev, "Error %d enabling adapter\n", rc);
298 return rc; 297 return rc;
299} 298}
300 299
@@ -327,10 +326,9 @@ int ibmvscsi_reset_crq_queue(struct crq_queue *queue,
327 queue->msg_token, PAGE_SIZE); 326 queue->msg_token, PAGE_SIZE);
328 if (rc == 2) { 327 if (rc == 2) {
329 /* Adapter is good, but other end is not ready */ 328 /* Adapter is good, but other end is not ready */
330 printk(KERN_WARNING "ibmvscsi: Partner adapter not ready\n"); 329 dev_warn(hostdata->dev, "Partner adapter not ready\n");
331 } else if (rc != 0) { 330 } else if (rc != 0) {
332 printk(KERN_WARNING 331 dev_warn(hostdata->dev, "couldn't register crq--rc 0x%x\n", rc);
333 "ibmvscsi: couldn't register crq--rc 0x%x\n", rc);
334 } 332 }
335 return rc; 333 return rc;
336} 334}