diff options
author | Hannes Reinecke <hare@suse.de> | 2014-06-25 18:39:54 +0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-07-18 00:07:39 +0400 |
commit | 96eefad2d9e5a0d988cdfee85193b6154c0ae1d2 (patch) | |
tree | e222b5850aef9e3dd77c69aabca0e36db752478e /drivers/scsi/sr_vendor.c | |
parent | d9e5d6183715e691b37afd3785c311d05cd1338d (diff) | |
download | linux-96eefad2d9e5a0d988cdfee85193b6154c0ae1d2.tar.xz |
scsi: Implement sr_printk()
Update the sr driver to use dev_printk() variants instead of
plain printk(); this will prefix logging messages with the
appropriate device.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/sr_vendor.c')
-rw-r--r-- | drivers/scsi/sr_vendor.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/scsi/sr_vendor.c b/drivers/scsi/sr_vendor.c index 92cc2efb25d7..11a238cb2222 100644 --- a/drivers/scsi/sr_vendor.c +++ b/drivers/scsi/sr_vendor.c @@ -123,7 +123,7 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength) return -ENOMEM; #ifdef DEBUG - printk("%s: MODE SELECT 0x%x/%d\n", cd->cdi.name, density, blocklength); + sr_printk(KERN_INFO, cd, "MODE SELECT 0x%x/%d\n", density, blocklength); #endif memset(&cgc, 0, sizeof(struct packet_command)); cgc.cmd[0] = MODE_SELECT; @@ -144,8 +144,9 @@ int sr_set_blocklength(Scsi_CD *cd, int blocklength) } #ifdef DEBUG else - printk("%s: switching blocklength to %d bytes failed\n", - cd->cdi.name, blocklength); + sr_printk(KERN_INFO, cd, + "switching blocklength to %d bytes failed\n", + blocklength); #endif kfree(buffer); return rc; @@ -190,8 +191,8 @@ int sr_cd_check(struct cdrom_device_info *cdi) if (rc != 0) break; if ((buffer[0] << 8) + buffer[1] < 0x0a) { - printk(KERN_INFO "%s: Hmm, seems the drive " - "doesn't support multisession CD's\n", cd->cdi.name); + sr_printk(KERN_INFO, cd, "Hmm, seems the drive " + "doesn't support multisession CD's\n"); no_multi = 1; break; } @@ -218,9 +219,9 @@ int sr_cd_check(struct cdrom_device_info *cdi) if (rc != 0) break; if (buffer[14] != 0 && buffer[14] != 0xb0) { - printk(KERN_INFO "%s: Hmm, seems the cdrom " - "doesn't support multisession CD's\n", - cd->cdi.name); + sr_printk(KERN_INFO, cd, "Hmm, seems the cdrom " + "doesn't support multisession CD's\n"); + no_multi = 1; break; } @@ -245,9 +246,8 @@ int sr_cd_check(struct cdrom_device_info *cdi) cgc.timeout = VENDOR_TIMEOUT; rc = sr_do_ioctl(cd, &cgc); if (rc == -EINVAL) { - printk(KERN_INFO "%s: Hmm, seems the drive " - "doesn't support multisession CD's\n", - cd->cdi.name); + sr_printk(KERN_INFO, cd, "Hmm, seems the drive " + "doesn't support multisession CD's\n"); no_multi = 1; break; } @@ -277,8 +277,8 @@ int sr_cd_check(struct cdrom_device_info *cdi) break; } if ((rc = buffer[2]) == 0) { - printk(KERN_WARNING - "%s: No finished session\n", cd->cdi.name); + sr_printk(KERN_WARNING, cd, + "No finished session\n"); break; } cgc.cmd[0] = READ_TOC; /* Read TOC */ @@ -301,9 +301,9 @@ int sr_cd_check(struct cdrom_device_info *cdi) default: /* should not happen */ - printk(KERN_WARNING - "%s: unknown vendor code (%i), not initialized ?\n", - cd->cdi.name, cd->vendor); + sr_printk(KERN_WARNING, cd, + "unknown vendor code (%i), not initialized ?\n", + cd->vendor); sector = 0; no_multi = 1; break; @@ -321,8 +321,8 @@ int sr_cd_check(struct cdrom_device_info *cdi) #ifdef DEBUG if (sector) - printk(KERN_DEBUG "%s: multisession offset=%lu\n", - cd->cdi.name, sector); + sr_printk(KERN_DEBUG, cd, "multisession offset=%lu\n", + sector); #endif kfree(buffer); return rc; |