Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28c31729 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Christoph Hellwig
Browse files

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: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 95e159d6
Loading
Loading
Loading
Loading
+9 −5
Original line number Original line Diff line number Diff line
@@ -84,15 +84,19 @@ static const char * vendor_labels[CH_TYPES-4] = {
};
};
// module_param_string_array(vendor_labels, NULL, 0444);
// module_param_string_array(vendor_labels, NULL, 0444);


#define ch_printk(prefix, ch, fmt, a...) \
	sdev_printk(prefix, (ch)->device, "[%s] " fmt, \
		    (ch)->name, ##a)

#define DPRINTK(fmt, arg...)						\
#define DPRINTK(fmt, arg...)						\
do {									\
do {									\
	if (debug)							\
	if (debug)							\
		printk(KERN_DEBUG "%s: " fmt, ch->name, ##arg);		\
		ch_printk(KERN_DEBUG, ch, fmt, ##arg);			\
} while (0)
} while (0)
#define VPRINTK(level, fmt, arg...)					\
#define VPRINTK(level, fmt, arg...)					\
do {									\
do {									\
	if (verbose)							\
	if (verbose)							\
		printk(level "%s: " fmt, ch->name, ##arg);		\
		ch_printk(level, ch, fmt, ##arg);			\
} while (0)
} while (0)


/* ------------------------------------------------------------------- */
/* ------------------------------------------------------------------- */
@@ -924,7 +928,7 @@ static int ch_probe(struct device *dev)
				  MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch,
				  MKDEV(SCSI_CHANGER_MAJOR, ch->minor), ch,
				  "s%s", ch->name);
				  "s%s", ch->name);
	if (IS_ERR(class_dev)) {
	if (IS_ERR(class_dev)) {
		printk(KERN_WARNING "ch%d: device_create failed\n",
		sdev_printk(KERN_WARNING, sd, "ch%d: device_create failed\n",
			    ch->minor);
			    ch->minor);
		ret = PTR_ERR(class_dev);
		ret = PTR_ERR(class_dev);
		goto remove_idr;
		goto remove_idr;