aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-06-25 10:39:56 -0400
committerChristoph Hellwig <hch@lst.de>2014-07-17 16:07:40 -0400
commit28c31729c890ca28feb8e279828203d0579df4ba (patch)
treedc65dc396d450e189f6e42707247059453284747
parent95e159d6dd808b2c28de1790e451e9bfb1176002 (diff)
scsi: Implement ch_printk()
Update the ch 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>
-rw-r--r--drivers/scsi/ch.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/scsi/ch.c b/drivers/scsi/ch.c
index 7e952cadbcf1..ef5ae0d03616 100644
--- a/drivers/scsi/ch.c
+++ b/drivers/scsi/ch.c
@@ -84,15 +84,19 @@ static const char * vendor_labels[CH_TYPES-4] = {
84}; 84};
85// module_param_string_array(vendor_labels, NULL, 0444); 85// module_param_string_array(vendor_labels, NULL, 0444);
86 86
87#define ch_printk(prefix, ch, fmt, a...) \
88 sdev_printk(prefix, (ch)->device, "[%s] " fmt, \
89 (ch)->name, ##a)
90
87#define DPRINTK(fmt, arg...) \ 91#define DPRINTK(fmt, arg...) \
88do { \ 92do { \
89 if (debug) \ 93 if (debug) \
90 printk(KERN_DEBUG "%s: " fmt, ch->name, ##arg); \ 94 ch_printk(KERN_DEBUG, ch, fmt, ##arg); \
91} while (0) 95} while (0)
92#define VPRINTK(level, fmt, arg...) \ 96#define VPRINTK(level, fmt, arg...) \
93do { \ 97do { \
94 if (verbose) \ 98 if (verbose) \
95 printk(level "%s: " fmt, ch->name, ##arg); \ 99 ch_printk(level, ch, fmt, ##arg); \
96} while (0) 100} while (0)
97 101
98/* ------------------------------------------------------------------- */ 102/* ------------------------------------------------------------------- */
@@ -196,7 +200,7 @@ ch_do_scsi(scsi_changer *ch, unsigned char *cmd,
196 __scsi_print_command(cmd); 200 __scsi_print_command(cmd);
197 } 201 }
198 202
199 result = scsi_execute_req(ch->device, cmd, direction, buffer, 203 result = scsi_execute_req(ch->device, cmd, direction, buffer,
200 buflength, &sshdr, timeout * HZ, 204 buflength, &sshdr, timeout * HZ,
201 MAX_RETRIES, NULL); 205 MAX_RETRIES, NULL);
202 206
@@ -924,8 +928,8 @@ static int ch_probe(struct device *dev)
924 MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch, 928 MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch,
925 "s%s", ch->name); 929 "s%s", ch->name);
926 if (IS_ERR(class_dev)) { 930 if (IS_ERR(class_dev)) {
927 printk(KERN_WARNING "ch%d: device_create failed\n", 931 sdev_printk(KERN_WARNING, sd, "ch%d: device_create failed\n",
928 ch->minor); 932 ch->minor);
929 ret = PTR_ERR(class_dev); 933 ret = PTR_ERR(class_dev);
930 goto remove_idr; 934 goto remove_idr;
931 } 935 }