aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sr.c
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2005-10-02 11:45:08 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-10-28 14:23:02 -0500
commit9ccfc756a70d454dfa82f48897e2883560c01a0e (patch)
tree9a6d3b10b1ec0e5fe7a63252a21598a03e93ad4e /drivers/scsi/sr.c
parent[SCSI] qla2xxx: remove eh_active checks in qla2xxx error handling (diff)
downloadlinux-dev-9ccfc756a70d454dfa82f48897e2883560c01a0e.tar.xz
linux-dev-9ccfc756a70d454dfa82f48897e2883560c01a0e.zip
[SCSI] move the mid-layer printk's over to shost/starget/sdev_printk
This should eliminate (at least in the mid layer) to make numeric assumptions about any of the enumeration variables. As a side effect, it will also make all the messages consistent and line us up nicely for the error logging strategy (if it ever shows itself again). Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sr.c')
-rw-r--r--drivers/scsi/sr.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 561901b1cf11..9e267c6d3a43 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -360,7 +360,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
}
if (s_size != 512 && s_size != 1024 && s_size != 2048) {
- printk("sr: bad sector size %d\n", s_size);
+ sdev_printk(KERN_ERR, SCpnt->device, "bad sector size %d\n", s_size);
return 0;
}
@@ -385,8 +385,9 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
size += sg[i].length;
if (size != SCpnt->request_bufflen && SCpnt->use_sg) {
- printk(KERN_ERR "sr: mismatch count %d, bytes %d\n",
- size, SCpnt->request_bufflen);
+ sdev_printk(KERN_ERR, SCpnt->device,
+ "mismatch count %d, bytes %d\n",
+ size, SCpnt->request_bufflen);
if (SCpnt->request_bufflen > size)
SCpnt->request_bufflen = SCpnt->bufflen = size;
}
@@ -397,7 +398,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt)
*/
if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) ||
(SCpnt->request_bufflen % s_size)) {
- printk("sr: unaligned transfer\n");
+ sdev_printk(KERN_NOTICE, SCpnt->device, "unaligned transfer\n");
return 0;
}
@@ -622,10 +623,8 @@ static int sr_probe(struct device *dev)
disk->flags |= GENHD_FL_REMOVABLE;
add_disk(disk);
- printk(KERN_DEBUG
- "Attached scsi CD-ROM %s at scsi%d, channel %d, id %d, lun %d\n",
- cd->cdi.name, sdev->host->host_no, sdev->channel,
- sdev->id, sdev->lun);
+ sdev_printk(KERN_DEBUG, sdev,
+ "Attached scsi CD-ROM %s\n", cd->cdi.name);
return 0;
fail_put: