diff options
author | James Bottomley <James.Bottomley@steeleye.com> | 2005-10-02 12:45:08 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-10-28 15:23:02 -0400 |
commit | 9ccfc756a70d454dfa82f48897e2883560c01a0e (patch) | |
tree | 9a6d3b10b1ec0e5fe7a63252a21598a03e93ad4e /drivers/scsi/sr.c | |
parent | 9a41a62b74388827998253d62c58707e63cc5874 (diff) |
[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.c | 15 |
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) | |||
360 | } | 360 | } |
361 | 361 | ||
362 | if (s_size != 512 && s_size != 1024 && s_size != 2048) { | 362 | if (s_size != 512 && s_size != 1024 && s_size != 2048) { |
363 | printk("sr: bad sector size %d\n", s_size); | 363 | sdev_printk(KERN_ERR, SCpnt->device, "bad sector size %d\n", s_size); |
364 | return 0; | 364 | return 0; |
365 | } | 365 | } |
366 | 366 | ||
@@ -385,8 +385,9 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) | |||
385 | size += sg[i].length; | 385 | size += sg[i].length; |
386 | 386 | ||
387 | if (size != SCpnt->request_bufflen && SCpnt->use_sg) { | 387 | if (size != SCpnt->request_bufflen && SCpnt->use_sg) { |
388 | printk(KERN_ERR "sr: mismatch count %d, bytes %d\n", | 388 | sdev_printk(KERN_ERR, SCpnt->device, |
389 | size, SCpnt->request_bufflen); | 389 | "mismatch count %d, bytes %d\n", |
390 | size, SCpnt->request_bufflen); | ||
390 | if (SCpnt->request_bufflen > size) | 391 | if (SCpnt->request_bufflen > size) |
391 | SCpnt->request_bufflen = SCpnt->bufflen = size; | 392 | SCpnt->request_bufflen = SCpnt->bufflen = size; |
392 | } | 393 | } |
@@ -397,7 +398,7 @@ static int sr_init_command(struct scsi_cmnd * SCpnt) | |||
397 | */ | 398 | */ |
398 | if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) || | 399 | if (((unsigned int)SCpnt->request->sector % (s_size >> 9)) || |
399 | (SCpnt->request_bufflen % s_size)) { | 400 | (SCpnt->request_bufflen % s_size)) { |
400 | printk("sr: unaligned transfer\n"); | 401 | sdev_printk(KERN_NOTICE, SCpnt->device, "unaligned transfer\n"); |
401 | return 0; | 402 | return 0; |
402 | } | 403 | } |
403 | 404 | ||
@@ -622,10 +623,8 @@ static int sr_probe(struct device *dev) | |||
622 | disk->flags |= GENHD_FL_REMOVABLE; | 623 | disk->flags |= GENHD_FL_REMOVABLE; |
623 | add_disk(disk); | 624 | add_disk(disk); |
624 | 625 | ||
625 | printk(KERN_DEBUG | 626 | sdev_printk(KERN_DEBUG, sdev, |
626 | "Attached scsi CD-ROM %s at scsi%d, channel %d, id %d, lun %d\n", | 627 | "Attached scsi CD-ROM %s\n", cd->cdi.name); |
627 | cd->cdi.name, sdev->host->host_no, sdev->channel, | ||
628 | sdev->id, sdev->lun); | ||
629 | return 0; | 628 | return 0; |
630 | 629 | ||
631 | fail_put: | 630 | fail_put: |