public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c
@ 2005-03-05 23:37 James Nelson
  2005-03-05 23:37 ` [PATCH 2/13] usbaudio: Clean up printk()'s in drivers/usb/class/audio.c James Nelson
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Add a KERN_WARNING constant to a printk() that is missing it, and add a driver
prefix to another two in drivers/usb/atm/speedtch.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/atm/speedtch.c linux-2.6.11-mm1/drivers/usb/atm/speedtch.c
--- linux-2.6.11-mm1-original/drivers/usb/atm/speedtch.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/atm/speedtch.c	2005-03-05 13:36:44.000000000 -0500
@@ -192,8 +192,8 @@ static int speedtch_set_swbuff(struct sp
 			      0x32, 0x40, state ? 0x01 : 0x00,
 			      0x00, NULL, 0, 100);
 	if (ret < 0) {
-		printk("Warning: %sabling SW buffering: usb_control_msg returned %d\n",
-		     state ? "En" : "Dis", ret);
+		printk(KERN_WARNING "%s: %sabling SW buffering: usb_control_msg returned %d\n",
+		     speedtch_driver_name, state ? "En" : "Dis", ret);
 		return ret;
 	}
 
@@ -252,7 +252,8 @@ static int speedtch_start_synchro(struct
 			      0x12, 0xc0, 0x04, 0x00,
 			      buf, sizeof(buf), CTRL_TIMEOUT);
 	if (ret < 0) {
-		printk(KERN_WARNING "SpeedTouch: Failed to start ADSL synchronisation: %d\n", ret);
+		printk(KERN_WARNING "%s: Failed to start ADSL synchronisation: %d\n",
+			speedtch_driver_name, ret);
 		return ret;
 	}
 
@@ -374,8 +375,8 @@ static void speedtch_poll_status(struct 
 
 	ret = speedtch_get_status(instance, buf);
 	if (ret) {
-		printk(KERN_WARNING
-		       "SpeedTouch: Error %d fetching device status\n", ret);
+		printk(KERN_WARNING "%s: Error %d fetching device status\n",
+			speedtch_driver_name, ret);
 		return;
 	}
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/13] usbaudio: Clean up printk()'s in drivers/usb/class/audio.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
@ 2005-03-05 23:37 ` James Nelson
  2005-03-05 23:37 ` [PATCH 3/13] usb: Clean up printk()'s in drivers/usb/gadget/ether.c James Nelson
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Fix a badly-implemented debugging printk macro, and clean up the other printk()s
in drivers/usb/class/audio.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/class/audio.c linux-2.6.11-mm1/drivers/usb/class/audio.c
--- linux-2.6.11-mm1-original/drivers/usb/class/audio.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/class/audio.c	2005-03-05 14:47:44.000000000 -0500
@@ -179,6 +179,10 @@
 
 /*****************************************************************************/
 
+#ifdef CONFIG_USB_DEBUG
+#define DEBUG
+#endif /*CONFIG_USB_DEBUG*/
+
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/string.h>
@@ -206,11 +210,13 @@
 #define DRIVER_AUTHOR "Alan Cox <alan@lxorguk.ukuu.org.uk>, Thomas Sailer (sailer@ife.ee.ethz.ch)"
 #define DRIVER_DESC "USB Audio Class driver"
 
+#define PFX "usbaudio: "
+
 #define AUDIO_DEBUG 1
 
 #define SND_DEV_DSP16   5
 
-#define dprintk(x)
+#define DPRINTK(fmt, args...) pr_debug (PFX "%s(): ", fmt, __FUNCTION__, ##args)
 
 /* --------------------------------------------------------------------- */
 
@@ -490,10 +496,11 @@ static int dmabuf_init(struct dmabuf *db
 	}
 	db->bufsize = nr << PAGE_SHIFT;
 	db->ready = 1;
-	dprintk((KERN_DEBUG "usbaudio: dmabuf_init bytepersec %d bufs %d ossfragshift %d ossmaxfrags %d "
-	         "fragshift %d fragsize %d numfrag %d dmasize %d bufsize %d fmt 0x%x srate %d\n",
-	         bytepersec, bufs, db->ossfragshift, db->ossmaxfrags, db->fragshift, db->fragsize,
-	         db->numfrag, db->dmasize, db->bufsize, db->format, db->srate));
+	DPRINTK("bytepersec %d bufs %d ossfragshift %d ossmaxfrags %d "
+		"fragshift %d fragsize %d numfrag %d dmasize %d bufsize %d "
+		"fmt 0x%x srate %d\n", bytepersec, bufs,db->ossfragshift,
+		db->ossmaxfrags, db->fragshift, db->fragsize, db->numfrag,
+		db->dmasize, db->bufsize, db->format, db->srate);
 	return 0;
 }
 
@@ -851,7 +858,7 @@ static int usbin_retire_desc(struct usbi
 	for (i = 0; i < DESCFRAMES; i++) {
 		cp = ((unsigned char *)urb->transfer_buffer) + urb->iso_frame_desc[i].offset;
 		if (urb->iso_frame_desc[i].status) {
-			dprintk((KERN_DEBUG "usbin_retire_desc: frame %u status %d\n", i, urb->iso_frame_desc[i].status));
+			DPRINTK("frame %u status %d\n", i, urb->iso_frame_desc[i].status);
 			continue;
 		}
 		scnt = urb->iso_frame_desc[i].actual_length >> ufmtsh;
@@ -869,11 +876,11 @@ static int usbin_retire_desc(struct usbi
 		u->dma.count += cnt;
 		if (u->format == u->dma.format) {
 			/* we do not need format conversion */
-			dprintk((KERN_DEBUG "usbaudio: no sample format conversion\n"));
+			DPRINTK("no sample format conversion\n");
 			dmabuf_copyin(&u->dma, cp, cnt);
 		} else {
 			/* we need sampling format conversion */
-			dprintk((KERN_DEBUG "usbaudio: sample format conversion %x != %x\n", u->format, u->dma.format));
+			DPRINTK("sample format conversion %x != %x\n", u->format, u->dma.format);
 			usbin_convert(u, cp, scnt);
 		}
 	}
@@ -893,7 +900,8 @@ static void usbin_completed(struct urb *
 	int suret = 0;
 
 #if 0
-	printk(KERN_DEBUG "usbin_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags);
+	printk(KERN_DEBUG PFX "%s(): status %d errcnt %d flags 0x%x\n",
+		__FUNCTION__, urb->status, urb->error_count, u->flags);
 #endif
 	if (urb == u->durb[0].urb)
 		mask = FLG_URB0RUNNING;
@@ -901,7 +909,7 @@ static void usbin_completed(struct urb *
 		mask = FLG_URB1RUNNING;
 	else {
 		mask = 0;
-		printk(KERN_ERR "usbin_completed: panic: unknown URB\n");
+		printk(KERN_ERR PFX "%s(): unknown URB\n", __FUNCTION__);
 	}
 	urb->dev = as->state->usbdev;
 	spin_lock_irqsave(&as->lock, flags);
@@ -913,7 +921,8 @@ static void usbin_completed(struct urb *
 	} else {
 		u->flags &= ~(mask | FLG_RUNNING);
 		wake_up(&u->dma.wait);
-		printk(KERN_DEBUG "usbin_completed: descriptor not restarted (usb_submit_urb: %d)\n", suret);
+		printk(KERN_DEBUG PFX "%s(): descriptor not restarted (usb_submit_urb: %d)\n",
+			__FUNCTION__, suret);
 	}
 	spin_unlock_irqrestore(&as->lock, flags);
 }
@@ -946,7 +955,7 @@ static int usbin_sync_retire_desc(struct
 	
 	for (i = 0; i < SYNCFRAMES; i++)
 		if (urb->iso_frame_desc[0].status)
-			dprintk((KERN_DEBUG "usbin_sync_retire_desc: frame %u status %d\n", i, urb->iso_frame_desc[i].status));
+			DPRINTK("frame %u status %d\n", i, urb->iso_frame_desc[i].status);
 	return 0;
 }
 
@@ -959,7 +968,8 @@ static void usbin_sync_completed(struct 
 	int suret = 0;
 
 #if 0
-	printk(KERN_DEBUG "usbin_sync_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags);
+	printk(KERN_DEBUG PFX "%s(): status %d errcnt %d flags 0x%x\n",
+		__FUNCTION__, urb->status, urb->error_count, u->flags);
 #endif
 	if (urb == u->surb[0].urb)
 		mask = FLG_SYNC0RUNNING;
@@ -967,7 +977,7 @@ static void usbin_sync_completed(struct 
 		mask = FLG_SYNC1RUNNING;
 	else {
 		mask = 0;
-		printk(KERN_ERR "usbin_sync_completed: panic: unknown URB\n");
+		printk(KERN_ERR PFX "%s(): unknown URB\n", __FUNCTION__);
 	}
 	urb->dev = as->state->usbdev;
 	spin_lock_irqsave(&as->lock, flags);
@@ -979,7 +989,7 @@ static void usbin_sync_completed(struct 
 	} else {
 		u->flags &= ~(mask | FLG_RUNNING);
 		wake_up(&u->dma.wait);
-		dprintk((KERN_DEBUG "usbin_sync_completed: descriptor not restarted (usb_submit_urb: %d)\n", suret));
+		DPRINTK("descriptor not restarted (usb_submit_urb: %d)\n", suret);
 	}
 	spin_unlock_irqrestore(&as->lock, flags);
 }
@@ -993,8 +1003,8 @@ static int usbin_start(struct usb_audiod
 	unsigned int maxsze, bufsz;
 
 #if 0
-	printk(KERN_DEBUG "usbin_start: device %d ufmt 0x%08x dfmt 0x%08x srate %d\n",
-	       dev->devnum, u->format, u->dma.format, u->dma.srate);
+	printk(KERN_DEBUG PFX "%s(): device %d ufmt 0x%08x dfmt 0x%08x srate %d\n",
+		__FUNCTION__, dev->devnum, u->format, u->dma.format, u->dma.srate);
 #endif
 	/* allocate USB storage if not already done */
 	spin_lock_irqsave(&as->lock, flags);
@@ -1029,7 +1039,7 @@ static int usbin_start(struct usb_audiod
 		}
 		if (!u->durb[0].urb->transfer_buffer || !u->durb[1].urb->transfer_buffer || 
 		    (u->syncpipe && (!u->surb[0].urb->transfer_buffer || !u->surb[1].urb->transfer_buffer))) {
-			printk(KERN_ERR "usbaudio: cannot start playback device %d\n", dev->devnum);
+			printk(KERN_ERR PFX "cannot start playback device %d\n", dev->devnum);
 			return 0;
 		}
 		spin_lock_irqsave(&as->lock, flags);
@@ -1237,7 +1247,7 @@ static int usbout_retire_desc(struct usb
 
 	for (i = 0; i < DESCFRAMES; i++) {
 		if (urb->iso_frame_desc[i].status) {
-			dprintk((KERN_DEBUG "usbout_retire_desc: frame %u status %d\n", i, urb->iso_frame_desc[i].status));
+			DPRINTK("frame %u status %d\n", i, urb->iso_frame_desc[i].status);
 			continue;
 		}
 	}
@@ -1253,7 +1263,8 @@ static void usbout_completed(struct urb 
 	int suret = 0;
 
 #if 0
-	printk(KERN_DEBUG "usbout_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags);
+	printk(KERN_DEBUG PFX "%s(): status %d errcnt %d flags 0x%x\n", __FUNCTION__,
+		urb->status, urb->error_count, u->flags);
 #endif
 	if (urb == u->durb[0].urb)
 		mask = FLG_URB0RUNNING;
@@ -1261,7 +1272,7 @@ static void usbout_completed(struct urb 
 		mask = FLG_URB1RUNNING;
 	else {
 		mask = 0;
-		printk(KERN_ERR "usbout_completed: panic: unknown URB\n");
+		printk(KERN_ERR PFX "%s(): unknown URB\n", __FUNCTION__);
 	}
 	urb->dev = as->state->usbdev;
 	spin_lock_irqsave(&as->lock, flags);
@@ -1273,7 +1284,7 @@ static void usbout_completed(struct urb 
 	} else {
 		u->flags &= ~(mask | FLG_RUNNING);
 		wake_up(&u->dma.wait);
-		dprintk((KERN_DEBUG "usbout_completed: descriptor not restarted (usb_submit_urb: %d)\n", suret));
+		DPRINTK("descriptor not restarted (usb_submit_urb: %d)\n", suret);
 	}
 	spin_unlock_irqrestore(&as->lock, flags);
 }
@@ -1300,16 +1311,17 @@ static int usbout_sync_retire_desc(struc
 
 	for (i = 0; i < SYNCFRAMES; i++, cp += 3) {
 		if (urb->iso_frame_desc[i].status) {
-			dprintk((KERN_DEBUG "usbout_sync_retire_desc: frame %u status %d\n", i, urb->iso_frame_desc[i].status));
+			DPRINTK("frame %u status %d\n", i, urb->iso_frame_desc[i].status);
 			continue;
 		}
 		if (urb->iso_frame_desc[i].actual_length < 3) {
-			dprintk((KERN_DEBUG "usbout_sync_retire_desc: frame %u length %d\n", i, urb->iso_frame_desc[i].actual_length));
+			DPRINTK("frame %u length %d\n", i, urb->iso_frame_desc[i].actual_length);
 			continue;
 		}
 		f = cp[0] | (cp[1] << 8) | (cp[2] << 16);
 		if (abs(f - u->freqn) > (u->freqn >> 3) || f > u->freqmax) {
-			printk(KERN_WARNING "usbout_sync_retire_desc: requested frequency %u (nominal %u) out of range!\n", f, u->freqn);
+			printk(KERN_WARNING PFX "%s(): requested frequency %u (nominal %u) out of range!\n",
+				__FUNCTION__, f, u->freqn);
 			continue;
 		}
 		u->freqm = f;
@@ -1326,7 +1338,8 @@ static void usbout_sync_completed(struct
 	int suret = 0;
 
 #if 0
-	printk(KERN_DEBUG "usbout_sync_completed: status %d errcnt %d flags 0x%x\n", urb->status, urb->error_count, u->flags);
+	printk(KERN_DEBUG PFX "%s(): status %d errcnt %d flags 0x%x\n", __FUNCTION__,
+		urb->status, urb->error_count, u->flags);
 #endif
 	if (urb == u->surb[0].urb)
 		mask = FLG_SYNC0RUNNING;
@@ -1334,7 +1347,7 @@ static void usbout_sync_completed(struct
 		mask = FLG_SYNC1RUNNING;
 	else {
 		mask = 0;
-		printk(KERN_ERR "usbout_sync_completed: panic: unknown URB\n");
+		printk(KERN_ERR PFX "%s(): unknown URB\n", __FUNCTION__);
 	}
 	urb->dev = as->state->usbdev;
 	spin_lock_irqsave(&as->lock, flags);
@@ -1346,7 +1359,7 @@ static void usbout_sync_completed(struct
 	} else {
 		u->flags &= ~(mask | FLG_RUNNING);
 		wake_up(&u->dma.wait);
-		dprintk((KERN_DEBUG "usbout_sync_completed: descriptor not restarted (usb_submit_urb: %d)\n", suret));
+		DPRINTK("descriptor not restarted (usb_submit_urb: %d)\n", suret);
 	}
 	spin_unlock_irqrestore(&as->lock, flags);
 }
@@ -1360,8 +1373,8 @@ static int usbout_start(struct usb_audio
 	unsigned int maxsze, bufsz;
 
 #if 0
-	printk(KERN_DEBUG "usbout_start: device %d ufmt 0x%08x dfmt 0x%08x srate %d\n",
-	       dev->devnum, u->format, u->dma.format, u->dma.srate);
+	printk(KERN_DEBUG PFX "%s(): device %d ufmt 0x%08x dfmt 0x%08x srate %d\n",
+		__FUNCTION__, dev->devnum, u->format, u->dma.format, u->dma.srate);
 #endif
 	/* allocate USB storage if not already done */
 	spin_lock_irqsave(&as->lock, flags);
@@ -1396,7 +1409,7 @@ static int usbout_start(struct usb_audio
 		}
 		if (!u->durb[0].urb->transfer_buffer || !u->durb[1].urb->transfer_buffer || 
 		    (u->syncpipe && (!u->surb[0].urb->transfer_buffer || !u->surb[1].urb->transfer_buffer))) {
-			printk(KERN_ERR "usbaudio: cannot start playback device %d\n", dev->devnum);
+			printk(KERN_ERR PFX "cannot start playback device %d\n", dev->devnum);
 			return 0;
 		}
 		spin_lock_irqsave(&as->lock, flags);
@@ -1521,7 +1534,7 @@ static int set_format_in(struct usb_audi
 
 	fmtnr = find_format(as->fmtin, as->numfmtin, d->format, d->srate);
 	if (fmtnr < 0) {
-		printk(KERN_ERR "usbaudio: set_format_in(): failed to find desired format/speed combination.\n");
+		printk(KERN_ERR PFX "%s(): failed to find desired format/speed combination\n", __FUNCTION__);
 		return -1;
 	}
 
@@ -1535,7 +1548,7 @@ static int set_format_in(struct usb_audi
 		    alts->endpoint[1].desc.bmAttributes != 0x01 ||
 		    alts->endpoint[1].desc.bSynchAddress != 0 ||
 		    alts->endpoint[1].desc.bEndpointAddress != (alts->endpoint[0].desc.bSynchAddress & 0x7f)) {
-			printk(KERN_WARNING "usbaudio: device %d interface %d altsetting %d claims adaptive in "
+			printk(KERN_WARNING PFX "device %d interface %d altsetting %d claims adaptive in "
 			       "but has invalid synch pipe; treating as asynchronous in\n",
 			       dev->devnum, u->interface, fmt->altsetting);
 		} else {
@@ -1547,10 +1560,9 @@ static int set_format_in(struct usb_audi
 		d->srate = fmt->sratelo;
 	if (d->srate > fmt->sratehi)
 		d->srate = fmt->sratehi;
-	dprintk((KERN_DEBUG "usbaudio: set_format_in: usb_set_interface %u %u\n",
-			u->interface, fmt->altsetting));
+	DPRINTK("usb_set_interface %u %u\n", u->interface, fmt->altsetting);
 	if (usb_set_interface(dev, alts->desc.bInterfaceNumber, fmt->altsetting) < 0) {
-		printk(KERN_WARNING "usbaudio: usb_set_interface failed, device %d interface %d altsetting %d\n",
+		printk(KERN_WARNING PFX "usb_set_interface failed, device %d interface %d altsetting %d\n",
 		       dev->devnum, u->interface, fmt->altsetting);
 		return -1;
 	}
@@ -1562,7 +1574,7 @@ static int set_format_in(struct usb_audi
 		data[0] = 1;
 		if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, 
 					   PITCH_CONTROL << 8, ep, data, 1, 1000)) < 0) {
-			printk(KERN_ERR "usbaudio: failure (error %d) to set output pitch control device %d interface %u endpoint 0x%x to %u\n",
+			printk(KERN_ERR PFX "failure (error %d) to set output pitch control device %d interface %u endpoint 0x%x to %u\n",
 			       ret, dev->devnum, u->interface, ep, d->srate);
 			return -1;
 		}
@@ -1574,21 +1586,23 @@ static int set_format_in(struct usb_audi
 		data[2] = d->srate >> 16;
 		if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, 
 					   SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) {
-			printk(KERN_ERR "usbaudio: failure (error %d) to set input sampling frequency device %d interface %u endpoint 0x%x to %u\n",
-			       ret, dev->devnum, u->interface, ep, d->srate);
+			printk(KERN_ERR PFX "failure (error %d) to set input sampling frequency "
+				"device %d interface %u endpoint 0x%x to %u\n",
+				ret, dev->devnum, u->interface, ep, d->srate);
 			return -1;
 		}
 		if ((ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR, USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN,
 					   SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) {
-			printk(KERN_ERR "usbaudio: failure (error %d) to get input sampling frequency device %d interface %u endpoint 0x%x\n",
+			printk(KERN_ERR PFX "failure (error %d) to get input sampling frequency device %d interface %u endpoint 0x%x\n",
 			       ret, dev->devnum, u->interface, ep);
 			return -1;
 		}
-		dprintk((KERN_DEBUG "usbaudio: set_format_in: device %d interface %d altsetting %d srate req: %u real %u\n",
-		        dev->devnum, u->interface, fmt->altsetting, d->srate, data[0] | (data[1] << 8) | (data[2] << 16)));
+		DPRINTK("device %d interface %d altsetting %d srate req: %u real %u\n",
+			dev->devnum, u->interface, fmt->altsetting, d->srate,
+			data[0] | (data[1] << 8) | (data[2] << 16)));
 		d->srate = data[0] | (data[1] << 8) | (data[2] << 16);
 	}
-	dprintk((KERN_DEBUG "usbaudio: set_format_in: USB format 0x%x, DMA format 0x%x srate %u\n", u->format, d->format, d->srate));
+	DPRINTK("USB format 0x%x, DMA format 0x%x srate %u\n", u->format, d->format, d->srate);
 	return 0;
 }
 
@@ -1610,7 +1624,7 @@ static int set_format_out(struct usb_aud
 
 	fmtnr = find_format(as->fmtout, as->numfmtout, d->format, d->srate);
 	if (fmtnr < 0) {
-		printk(KERN_ERR "usbaudio: set_format_out(): failed to find desired format/speed combination.\n");
+		printk(KERN_ERR PFX "%s(): failed to find desired format/speed combination\n", __FORMAT__);
 		return -1;
 	}
 
@@ -1621,9 +1635,9 @@ static int set_format_out(struct usb_aud
 	u->syncpipe = u->syncinterval = 0;
 	if ((alts->endpoint[0].desc.bmAttributes & 0x0c) == 0x04) {
 #if 0
-		printk(KERN_DEBUG "bNumEndpoints 0x%02x endpoint[1].bmAttributes 0x%02x\n"
-		       KERN_DEBUG "endpoint[1].bSynchAddress 0x%02x endpoint[1].bEndpointAddress 0x%02x\n"
-		       KERN_DEBUG "endpoint[0].bSynchAddress 0x%02x\n", alts->bNumEndpoints,
+		printk(KERN_DEBUG PFX "bNumEndpoints 0x%02x endpoint[1].bmAttributes 0x%02x\n"
+		       KERN_DEBUG PFX "endpoint[1].bSynchAddress 0x%02x endpoint[1].bEndpointAddress 0x%02x\n"
+		       KERN_DEBUG PFX "endpoint[0].bSynchAddress 0x%02x\n", alts->bNumEndpoints,
 		       alts->endpoint[1].bmAttributes, alts->endpoint[1].bSynchAddress,
 		       alts->endpoint[1].bEndpointAddress, alts->endpoint[0].bSynchAddress);
 #endif
@@ -1631,7 +1645,7 @@ static int set_format_out(struct usb_aud
 		    alts->endpoint[1].desc.bmAttributes != 0x01 ||
 		    alts->endpoint[1].desc.bSynchAddress != 0 ||
 		    alts->endpoint[1].desc.bEndpointAddress != (alts->endpoint[0].desc.bSynchAddress | 0x80)) {
-			printk(KERN_WARNING "usbaudio: device %d interface %d altsetting %d claims asynch out "
+			printk(KERN_WARNING PFX "device %d interface %d altsetting %d claims asynch out "
 			       "but has invalid synch pipe; treating as adaptive out\n",
 			       dev->devnum, u->interface, fmt->altsetting);
 		} else {
@@ -1643,11 +1657,10 @@ static int set_format_out(struct usb_aud
 		d->srate = fmt->sratelo;
 	if (d->srate > fmt->sratehi)
 		d->srate = fmt->sratehi;
-	dprintk((KERN_DEBUG "usbaudio: set_format_out: usb_set_interface %u %u\n",
-			u->interface, fmt->altsetting));
+	DPRINTK("usb_set_interface %u %u\n", u->interface, fmt->altsetting);
 	if (usb_set_interface(dev, u->interface, fmt->altsetting) < 0) {
-		printk(KERN_WARNING "usbaudio: usb_set_interface failed, device %d interface %d altsetting %d\n",
-		       dev->devnum, u->interface, fmt->altsetting);
+		printk(KERN_WARNING PFX "usb_set_interface failed, device %d interface %d altsetting %d\n",
+			dev->devnum, u->interface, fmt->altsetting);
 		return -1;
 	}
 	if (fmt->sratelo == fmt->sratehi)
@@ -1658,8 +1671,9 @@ static int set_format_out(struct usb_aud
 		data[0] = 1;
 		if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, 
 					   PITCH_CONTROL << 8, ep, data, 1, 1000)) < 0) {
-			printk(KERN_ERR "usbaudio: failure (error %d) to set output pitch control device %d interface %u endpoint 0x%x to %u\n",
-			       ret, dev->devnum, u->interface, ep, d->srate);
+			printk(KERN_ERR PFX "failure (error %d) to set output pitch control "
+				"device %d interface %u endpoint 0x%x to %u\n",
+				ret, dev->devnum, u->interface, ep, d->srate);
 			return -1;
 		}
 	}
@@ -1670,21 +1684,24 @@ static int set_format_out(struct usb_aud
 		data[2] = d->srate >> 16;
 		if ((ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_OUT, 
 					   SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) {
-			printk(KERN_ERR "usbaudio: failure (error %d) to set output sampling frequency device %d interface %u endpoint 0x%x to %u\n",
-			       ret, dev->devnum, u->interface, ep, d->srate);
+			printk(KERN_ERR PFX "failure (error %d) to set output sampling "
+				"frequency device %d interface %u endpoint 0x%x to %u\n",
+				ret, dev->devnum, u->interface, ep, d->srate);
 			return -1;
 		}
 		if ((ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR, USB_TYPE_CLASS|USB_RECIP_ENDPOINT|USB_DIR_IN,
 					   SAMPLING_FREQ_CONTROL << 8, ep, data, 3, 1000)) < 0) {
-			printk(KERN_ERR "usbaudio: failure (error %d) to get output sampling frequency device %d interface %u endpoint 0x%x\n",
-			       ret, dev->devnum, u->interface, ep);
+			printk(KERN_ERR PFX "failure (error %d) to get output sampling "
+				"frequency device %d interface %u endpoint 0x%x\n",
+				driver_pfx, ret, dev->devnum, u->interface, ep);
 			return -1;
 		}
-		dprintk((KERN_DEBUG "usbaudio: set_format_out: device %d interface %d altsetting %d srate req: %u real %u\n",
-		        dev->devnum, u->interface, fmt->altsetting, d->srate, data[0] | (data[1] << 8) | (data[2] << 16)));
+		DPRINTK("device %d interface %d altsetting %d srate req: %u real %u\n",
+			dev->devnum, u->interface, fmt->altsetting, d->srate,
+			data[0] | (data[1] << 8) | (data[2] << 16));
 		d->srate = data[0] | (data[1] << 8) | (data[2] << 16);
 	}
-	dprintk((KERN_DEBUG "usbaudio: set_format_out: USB format 0x%x, DMA format 0x%x srate %u\n", u->format, d->format, d->srate));
+	DPRINTK("USB format 0x%x, DMA format 0x%x srate %u\n", u->format, d->format, d->srate);
 	return 0;
 }
 
@@ -1803,7 +1820,7 @@ static int wrmixer(struct usb_mixerdev *
 	return 0;
 
  err:
-	printk(KERN_ERR "usbaudio: mixer request device %u if %u unit %u ch %u selector %u failed\n", 
+	printk(KERN_ERR PFX "mixer request device %u if %u unit %u ch %u selector %u failed\n", 
 		dev->devnum, ms->iface, ch->unitid, ch->chnum, ch->selector);
 	return -1;
 }
@@ -1822,7 +1839,7 @@ static int get_rec_src(struct usb_mixerd
 		if (usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR, USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
 				    0, ms->iface | (ms->ch[i].slctunitid << 8), &buf, 1, 1000) < 0) {
 			err = -EIO;
-			printk(KERN_ERR "usbaudio: selector read request device %u if %u unit %u failed\n", 
+			printk(KERN_ERR PFX "selector read request device %u if %u unit %u failed\n", 
 			       dev->devnum, ms->iface, ms->ch[i].slctunitid & 0xff);
 			continue;
 		}
@@ -1853,7 +1870,7 @@ static int set_rec_src(struct usb_mixerd
 		if (usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), GET_CUR, USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_IN,
 				    0, ms->iface | (ms->ch[i].slctunitid << 8), &buf, 1, 1000) < 0) {
 			err = -EIO;
-			printk(KERN_ERR "usbaudio: selector read request device %u if %u unit %u failed\n", 
+			printk(KERN_ERR PFX "selector read request device %u if %u unit %u failed\n", 
 			       dev->devnum, ms->iface, ms->ch[i].slctunitid & 0xff);
 			continue;
 		}
@@ -1882,7 +1899,7 @@ static int set_rec_src(struct usb_mixerd
 			if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
 				    0, ms->iface | (ms->ch[j].slctunitid << 8), &buf, 1, 1000) < 0) {
 				err = -EIO;
-				printk(KERN_ERR "usbaudio: selector write request device %u if %u unit %u failed\n", 
+				printk(KERN_ERR PFX "selector write request device %u if %u unit %u failed\n", 
 				       dev->devnum, ms->iface, ms->ch[j].slctunitid & 0xff);
 				continue;
 			}
@@ -2125,7 +2142,7 @@ static int drain_out(struct usb_audiodev
 		tmo = 3 * HZ * count / as->usbout.dma.srate;
 		tmo >>= AFMT_BYTESSHIFT(as->usbout.dma.format);
 		if (!schedule_timeout(tmo + 1)) {
-			printk(KERN_DEBUG "usbaudio: dma timed out??\n");
+			printk(KERN_DEBUG PFX "dma timed out?\n");
 			break;
 		}
 	}
@@ -2224,9 +2241,9 @@ static ssize_t usb_audio_write(struct fi
 	add_wait_queue(&as->usbout.dma.wait, &wait);
 	while (count > 0) {
 #if 0
-		printk(KERN_DEBUG "usb_audio_write: count %u dma: count %u rdptr %u wrptr %u dmasize %u fragsize %u flags 0x%02x taskst 0x%lx\n",
-		       count, as->usbout.dma.count, as->usbout.dma.rdptr, as->usbout.dma.wrptr, as->usbout.dma.dmasize, as->usbout.dma.fragsize,
-		       as->usbout.flags, current->state);
+		printk(KERN_DEBUG PFX "%s(): count %u dma: count %u rdptr %u wrptr %u dmasize %u fragsize %u flags 0x%02x taskst 0x%lx\n",
+			__FUNCTION__, count, as->usbout.dma.count, as->usbout.dma.rdptr, as->usbout.dma.wrptr, as->usbout.dma.dmasize,
+			as->usbout.dma.fragsize, as->usbout.flags, current->state);
 #endif
 		spin_lock_irqsave(&as->lock, flags);
 		if (as->usbout.dma.count < 0) {
@@ -2367,7 +2384,7 @@ static int usb_audio_ioctl(struct inode 
 #if 0
 	if (arg)
 		get_user(val, (int *)arg);
-	printk(KERN_DEBUG "usbaudio: usb_audio_ioctl cmd=%x arg=%lx *arg=%d\n", cmd, arg, val)
+	printk(KERN_DEBUG PFX "%s(): cmd=%x arg=%lx *arg=%d\n", __FUNCTION__, cmd, arg, val)
 #endif
 	switch (cmd) {
 	case OSS_GETVERSION:
@@ -2626,7 +2643,7 @@ static int usb_audio_ioctl(struct inode 
 	case SOUND_PCM_READ_FILTER:
 		return -EINVAL;
 	}
-	dprintk((KERN_DEBUG "usbaudio: usb_audio_ioctl - no command found\n"));
+	DPRINTK("no command found\n");
 	return -ENOIOCTLCMD;
 }
 
@@ -2864,49 +2881,49 @@ static void usb_audio_parsestreaming(str
 				continue;
 			if (alts->desc.bNumEndpoints < 1) {
 				if (i != 0) {  /* altsetting 0 has no endpoints (Section B.3.4.1) */
-					printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u does not have an endpoint\n", 
-					       dev->devnum, asifin, i);
+					printk(KERN_ERR PFX "device %u interface %u altsetting %u does not have an endpoint\n", 
+						dev->devnum, asifin, i);
 				}
 				continue;
 			}
 			if ((alts->endpoint[0].desc.bmAttributes & 0x03) != 0x01 ||
 			    !(alts->endpoint[0].desc.bEndpointAddress & 0x80)) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u first endpoint not isochronous in\n", 
-				       dev->devnum, asifin, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u first endpoint not isochronous in\n", 
+					dev->devnum, asifin, i);
 				continue;
 			}
 			fmt = find_csinterface_descriptor(buffer, buflen, NULL, AS_GENERAL, asifin, i);
 			if (!fmt) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
-				       dev->devnum, asifin, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
+					dev->devnum, asifin, i);
 				continue;
 			}
 			if (fmt[0] < 7 || fmt[6] != 0 || (fmt[5] != 1 && fmt[5] != 2)) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u format not supported\n", 
-				       dev->devnum, asifin, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u format not supported\n", 
+					dev->devnum, asifin, i);
 				continue;
 			}
 			format = (fmt[5] == 2) ? (AFMT_U16_LE | AFMT_U8) : (AFMT_S16_LE | AFMT_S8);
 			fmt = find_csinterface_descriptor(buffer, buflen, NULL, FORMAT_TYPE, asifin, i);
 			if (!fmt) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
-				       dev->devnum, asifin, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
+					dev->devnum, asifin, i);
 				continue;
 			}
 			if (fmt[0] < 8+3*(fmt[7] ? fmt[7] : 2) || fmt[3] != 1) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u FORMAT_TYPE descriptor not supported\n", 
-				       dev->devnum, asifin, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u FORMAT_TYPE descriptor not supported\n", 
+					dev->devnum, asifin, i);
 				continue;
 			}
 			if (fmt[4] < 1 || fmt[4] > 2 || fmt[5] < 1 || fmt[5] > 2) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u unsupported channels %u framesize %u\n", 
-				       dev->devnum, asifin, i, fmt[4], fmt[5]);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u unsupported channels %u framesize %u\n", 
+					dev->devnum, asifin, i, fmt[4], fmt[5]);
 				continue;
 			}
 			csep = find_descriptor(buffer, buflen, NULL, USB_DT_CS_ENDPOINT, asifin, i);
 			if (!csep || csep[0] < 7 || csep[2] != EP_GENERAL) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u no or invalid class specific endpoint descriptor\n", 
-				       dev->devnum, asifin, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u no or invalid class specific endpoint descriptor\n",
+					dev->devnum, asifin, i);
 				continue;
 			}
 			if (as->numfmtin >= MAXFORMATS)
@@ -2921,18 +2938,18 @@ static void usb_audio_parsestreaming(str
 			fp->format = format;
 			fp->altsetting = i;
 			fp->sratelo = fp->sratehi = fmt[8] | (fmt[9] << 8) | (fmt[10] << 16);
-			printk(KERN_INFO "usbaudio: valid input sample rate %u\n", fp->sratelo);
+			pr_info(PFX "valid input sample rate %u\n", fp->sratelo);
 			for (j = fmt[7] ? (fmt[7]-1) : 1; j > 0; j--) {
 				k = fmt[8+3*j] | (fmt[9+3*j] << 8) | (fmt[10+3*j] << 16);
-				printk(KERN_INFO "usbaudio: valid input sample rate %u\n", k);
+				pr_info(PFX "valid input sample rate %u\n", k);
 				if (k > fp->sratehi)
 					fp->sratehi = k;
 				if (k < fp->sratelo)
 					fp->sratelo = k;
 			}
 			fp->attributes = csep[3];
-			printk(KERN_INFO "usbaudio: device %u interface %u altsetting %u: format 0x%08x sratelo %u sratehi %u attributes 0x%02x\n", 
-			       dev->devnum, asifin, i, fp->format, fp->sratelo, fp->sratehi, fp->attributes);
+			pr_info(PFX "device %u interface %u altsetting %u: format 0x%08x sratelo %u sratehi %u attributes 0x%02x\n", 
+				dev->devnum, asifin, i, fp->format, fp->sratelo, fp->sratehi, fp->attributes);
 		}
 	}
 	/* search for output formats */
@@ -2947,26 +2964,26 @@ static void usb_audio_parsestreaming(str
 			if (alts->desc.bNumEndpoints < 1) {
 				/* altsetting 0 should never have iso EPs */
 				if (i != 0)
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u does not have an endpoint\n", 
-				       dev->devnum, asifout, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u does not have an endpoint\n", 
+					dev->devnum, asifout, i);
 				continue;
 			}
 			if ((alts->endpoint[0].desc.bmAttributes & 0x03) != 0x01 ||
 			    (alts->endpoint[0].desc.bEndpointAddress & 0x80)) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u first endpoint not isochronous out\n", 
-				       dev->devnum, asifout, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u first endpoint not isochronous out\n", 
+					dev->devnum, asifout, i);
 				continue;
 			}
 			/* See USB audio formats manual, section 2 */
 			fmt = find_csinterface_descriptor(buffer, buflen, NULL, AS_GENERAL, asifout, i);
 			if (!fmt) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
-				       dev->devnum, asifout, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
+					dev->devnum, asifout, i);
 				continue;
 			}
 			if (fmt[0] < 7 || fmt[6] != 0 || (fmt[5] != 1 && fmt[5] != 2)) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u format not supported\n", 
-				       dev->devnum, asifout, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u format not supported\n", 
+					dev->devnum, asifout, i);
 				continue;
 			}
 			format = (fmt[5] == 2) ? (AFMT_U16_LE | AFMT_U8) : (AFMT_S16_LE | AFMT_S8);
@@ -2976,23 +2993,23 @@ static void usb_audio_parsestreaming(str
 				format = (AFMT_S16_LE | AFMT_S8);
 			fmt = find_csinterface_descriptor(buffer, buflen, NULL, FORMAT_TYPE, asifout, i);
 			if (!fmt) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
-				       dev->devnum, asifout, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n", 
+					dev->devnum, asifout, i);
 				continue;
 			}
 			if (fmt[0] < 8+3*(fmt[7] ? fmt[7] : 2) || fmt[3] != 1) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u FORMAT_TYPE descriptor not supported\n", 
-				       dev->devnum, asifout, i);
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u FORMAT_TYPE descriptor not supported\n", 
+					dev->devnum, asifout, i);
 				continue;
 			}
 			if (fmt[4] < 1 || fmt[4] > 2 || fmt[5] < 1 || fmt[5] > 2) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u unsupported channels %u framesize %u\n", 
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u unsupported channels %u framesize %u\n", 
 				       dev->devnum, asifout, i, fmt[4], fmt[5]);
 				continue;
 			}
 			csep = find_descriptor(buffer, buflen, NULL, USB_DT_CS_ENDPOINT, asifout, i);
 			if (!csep || csep[0] < 7 || csep[2] != EP_GENERAL) {
-				printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u no or invalid class specific endpoint descriptor\n", 
+				printk(KERN_ERR PFX "device %u interface %u altsetting %u no or invalid class specific endpoint descriptor\n", 
 				       dev->devnum, asifout, i);
 				continue;
 			}
@@ -3008,17 +3025,17 @@ static void usb_audio_parsestreaming(str
 			fp->format = format;
 			fp->altsetting = i;
 			fp->sratelo = fp->sratehi = fmt[8] | (fmt[9] << 8) | (fmt[10] << 16);
-			printk(KERN_INFO "usbaudio: valid output sample rate %u\n", fp->sratelo);
+			pr_info(PFX "valid output sample rate %u\n", fp->sratelo);
 			for (j = fmt[7] ? (fmt[7]-1) : 1; j > 0; j--) {
 				k = fmt[8+3*j] | (fmt[9+3*j] << 8) | (fmt[10+3*j] << 16);
-				printk(KERN_INFO "usbaudio: valid output sample rate %u\n", k);
+				pr_info(PFX "valid output sample rate %u\n", k);
 				if (k > fp->sratehi)
 					fp->sratehi = k;
 				if (k < fp->sratelo)
 					fp->sratelo = k;
 			}
 			fp->attributes = csep[3];
-			printk(KERN_INFO "usbaudio: device %u interface %u altsetting %u: format 0x%08x sratelo %u sratehi %u attributes 0x%02x\n", 
+			pr_info(PFX "device %u interface %u altsetting %u: format 0x%08x sratelo %u sratehi %u attributes 0x%02x\n", 
 			       dev->devnum, asifout, i, fp->format, fp->sratelo, fp->sratehi, fp->attributes);
 		}
 	}
@@ -3035,7 +3052,7 @@ static void usb_audio_parsestreaming(str
 		return;
 	}
 	if ((as->dev_audio = register_sound_dsp(&usb_audio_fops, -1)) < 0) {
-		printk(KERN_ERR "usbaudio: cannot register dsp\n");
+		printk(KERN_ERR PFX "cannot register dsp\n");
 		usb_free_urb(as->usbin.durb[0].urb);
 		usb_free_urb(as->usbin.durb[1].urb);
 		usb_free_urb(as->usbin.surb[0].urb);
@@ -3047,7 +3064,7 @@ static void usb_audio_parsestreaming(str
 		kfree(as);
 		return;
 	}
-	printk(KERN_INFO "usbaudio: registered dsp 14,%d\n", as->dev_audio);
+	pr_info(PFX "registered dsp 14,%d\n", as->dev_audio);
 	/* everything successful */
 	list_add_tail(&as->list, &s->audiolist);
 }
@@ -3072,11 +3089,11 @@ static struct mixerchannel *getmixchanne
 	struct mixerchannel *c;
 
 	if (nr >= SOUND_MIXER_NRDEVICES) {
-		printk(KERN_ERR "usbaudio: invalid OSS mixer channel %u\n", nr);
+		printk(KERN_ERR PFX "invalid OSS mixer channel %u\n", nr);
 		return NULL;
 	}
 	if (!(state->mixchmask & (1 << nr))) {
-		printk(KERN_WARNING "usbaudio: OSS mixer channel %u already in use\n", nr);
+		printk(KERN_WARNING PFX "OSS mixer channel %u already in use\n", nr);
 		return NULL;
 	}
 	c = &state->mixch[state->nrmixch++];
@@ -3128,7 +3145,7 @@ static void prepmixch(struct consmixstat
 		return;
 	buf = kmalloc(sizeof(*buf) * 2, GFP_KERNEL);
 	if (!buf) {
-		printk(KERN_ERR "prepmixch: out of memory\n") ;
+		printk(KERN_ERR PFX "%s(): out of memory\n", __FUNCTION__);
 		return;
 	}
 
@@ -3248,7 +3265,7 @@ static void prepmixch(struct consmixstat
 	kfree(buf);
 	return;
  err:
-	printk(KERN_ERR "usbaudio: mixer request device %u if %u unit %u ch %u selector %u failed\n", 
+	printk(KERN_ERR PFX "mixer request device %u if %u unit %u ch %u selector %u failed\n", 
 	       dev->devnum, state->ctrlif, ch->unitid, ch->chnum, ch->selector);
 	if (state->nrmixch)
 		state->nrmixch--;
@@ -3285,11 +3302,11 @@ static void usb_audio_mixerunit(struct c
 	unsigned int i;
 
 	if (!mixer[4]) {
-		printk(KERN_ERR "usbaudio: unit %u invalid MIXER_UNIT descriptor\n", mixer[3]);
+		printk(KERN_ERR PFX "unit %u invalid MIXER_UNIT descriptor\n", mixer[3]);
 		return;
 	}
 	if (mixer[4] > SOUND_MIXER_NRDEVICES) {
-		printk(KERN_ERR "usbaudio: mixer unit %u: too many input pins\n", mixer[3]);
+		printk(KERN_ERR PFX "mixer unit %u: too many input pins\n", mixer[3]);
 		return;
 	}
 	chidx[0] = 0;
@@ -3303,7 +3320,7 @@ static void usb_audio_mixerunit(struct c
 	bmapsize = (nroutch * chidx[mixer[4]] + 7) >> 3;
 	bmap += bmapsize - 1;
 	if (mixer[0] < 10+mixer[4]+bmapsize) {
-		printk(KERN_ERR "usbaudio: unit %u invalid MIXER_UNIT descriptor (bitmap too small)\n", mixer[3]);
+		printk(KERN_ERR PFX "unit %u invalid MIXER_UNIT descriptor (bitmap too small)\n", mixer[3]);
 		return;
 	}
 	for (i = 0; i < mixer[4]; i++) {
@@ -3353,7 +3370,7 @@ static void usb_audio_selectorunit(struc
 	struct mixerchannel *mch;
 
 	if (!selector[4]) {
-		printk(KERN_ERR "usbaudio: unit %u invalid SELECTOR_UNIT descriptor\n", selector[3]);
+		printk(KERN_ERR PFX "unit %u invalid SELECTOR_UNIT descriptor\n", selector[3]);
 		return;
 	}
 	mixch = state->nrmixch;
@@ -3364,14 +3381,14 @@ static void usb_audio_selectorunit(struc
 	} else if ((mch = slctsrc_findunit(state, selector[5]))) {
 		mch->slctunitid = selector[3] | (1 << 8);
 	} else {
-		printk(KERN_INFO "usbaudio: selector unit %u: ignoring channel 1\n", selector[3]);
+		pr_info(PFX "selector unit %u: ignoring channel 1\n", selector[3]);
 	}
 	chnum = state->nrchannels;
 	for (i = 1; i < selector[4]; i++) {
 		mixch = state->nrmixch;
 		usb_audio_recurseunit(state, selector[5+i]);
 		if (chnum != state->nrchannels) {
-			printk(KERN_ERR "usbaudio: selector unit %u: input pins with varying channel numbers\n", selector[3]);
+			printk(KERN_ERR PFX "selector unit %u: input pins with varying channel numbers\n", selector[3]);
 			state->termtype = 0;
 			state->chconfig = 0;
 			state->nrchannels = 0;
@@ -3383,7 +3400,7 @@ static void usb_audio_selectorunit(struc
 		} else if ((mch = slctsrc_findunit(state, selector[5+i]))) {
 			mch->slctunitid = selector[3] | ((i + 1) << 8);
 		} else {
-			printk(KERN_INFO "usbaudio: selector unit %u: ignoring channel %u\n", selector[3], i+1);
+			pr_info(PFX "selector unit %u: ignoring channel %u\n", selector[3], i+1);
 		}
 	}
 	state->termtype = 0;
@@ -3418,29 +3435,32 @@ static void usb_audio_featureunit(struct
 	usb_audio_recurseunit(state, ftr[4]);
 
 	if (ftr[5] == 0 ) {
-		printk(KERN_ERR "usbaudio: wrong controls size in feature unit %u\n",ftr[3]);
+		printk(KERN_ERR PFX "wrong controls size in feature unit %u\n",ftr[3]);
 		return;
 	}
 
 	if (state->nrchannels == 0) {
-		printk(KERN_ERR "usbaudio: feature unit %u source has no channels\n", ftr[3]);
+		printk(KERN_ERR PFX "feature unit %u source has no channels\n", ftr[3]);
 		return;
 	}
 	if (state->nrchannels > 2)
-		printk(KERN_WARNING "usbaudio: feature unit %u: OSS mixer interface does not support more than 2 channels\n", ftr[3]);
+		printk(KERN_WARNING PFX "feature unit %u: OSS mixer interface does not support more than 2 channels\n", ftr[3]);
 
 	nr_logical_channels=(ftr[0]-7)/ftr[5]-1;
 
 	if (nr_logical_channels != state->nrchannels) {
-		printk(KERN_WARNING "usbaudio: warning: found %d of %d logical channels.\n", state->nrchannels,nr_logical_channels);
+		printk(KERN_WARNING PFX "warning: found %d of %d logical channels\n", state->nrchannels,nr_logical_channels);
 
 		if (state->nrchannels == 1 && nr_logical_channels==0) {
-			printk(KERN_INFO "usbaudio: assuming the channel found is the master channel (got a Philips camera?). Should be fine.\n");
+			pr_info(PFX "assuming the channel found is the master channel "
+				"(got a Philips camera?) - should be fine\n");
 		} else if (state->nrchannels == 1 && nr_logical_channels==2) {
-			printk(KERN_INFO "usbaudio: assuming that a stereo channel connected directly to a mixer is missing in search (got Labtec headset?). Should be fine.\n");
+			pr_info(PFX "assuming that a stereo channel connected directly "
+				"to a mixer is missing in search (got Labtec headset?) "
+				"- should be fine\n");
 			state->nrchannels=nr_logical_channels;
 		} else {
-			printk(KERN_WARNING "usbaudio: no idea what's going on..., contact linux-usb-devel@lists.sourceforge.net\n");
+			printk(KERN_WARNING PFX "no idea what's going on..., contact linux-usb-devel@lists.sourceforge.net\n");
 		}
 	}
 
@@ -3519,11 +3539,11 @@ static void usb_audio_featureunit(struct
 	/* if there are mute controls, unmute them */
 	/* does not seem to be necessary, and the Dallas chip does not seem to support the "all" channel (255) */
 	if ((chftr & 1) || (mchftr & 1)) {
-		printk(KERN_DEBUG "usbaudio: unmuting feature unit %u interface %u\n", ftr[3], state->ctrlif);
+		printk(KERN_DEBUG PFX "unmuting feature unit %u interface %u\n", ftr[3], state->ctrlif);
 		data[0] = 0;
 		if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0), SET_CUR, USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
 				    (MUTE_CONTROL << 8) | 0xff, state->ctrlif | (ftr[3] << 8), data, 1, 1000) < 0)
-			printk(KERN_WARNING "usbaudio: failure to unmute feature unit %u interface %u\n", ftr[3], state->ctrlif);
+			printk(KERN_WARNING PFX "failure to unmute feature unit %u interface %u\n", ftr[3], state->ctrlif);
  	}
 #endif
 }
@@ -3534,12 +3554,12 @@ static void usb_audio_recurseunit(struct
 	unsigned int i, j;
 
 	if (test_and_set_bit(unitid, state->unitbitmap)) {
-		printk(KERN_INFO "usbaudio: mixer path revisits unit %d\n", unitid);
+		pr_info(PFX "mixer path revisits unit %d\n", unitid);
 		return;
 	}
 	p1 = find_audiocontrol_unit(state->buffer, state->buflen, NULL, unitid, state->ctrlif);
 	if (!p1) {
-		printk(KERN_ERR "usbaudio: unit %d not found!\n", unitid);
+		printk(KERN_ERR PFX "unit %d not found!\n", unitid);
 		return;
 	}
 	state->nrchannels = 0;
@@ -3548,7 +3568,7 @@ static void usb_audio_recurseunit(struct
 	switch (p1[2]) {
 	case INPUT_TERMINAL:
 		if (p1[0] < 12) {
-			printk(KERN_ERR "usbaudio: unit %u: invalid INPUT_TERMINAL descriptor\n", unitid);
+			printk(KERN_ERR PFX "unit %u: invalid INPUT_TERMINAL descriptor\n", unitid);
 			return;
 		}
 		state->nrchannels = p1[7];
@@ -3558,7 +3578,7 @@ static void usb_audio_recurseunit(struct
 
 	case MIXER_UNIT:
 		if (p1[0] < 10 || p1[0] < 10+p1[4]) {
-			printk(KERN_ERR "usbaudio: unit %u: invalid MIXER_UNIT descriptor\n", unitid);
+			printk(KERN_ERR PFX "unit %u: invalid MIXER_UNIT descriptor\n", unitid);
 			return;
 		}
 		usb_audio_mixerunit(state, p1);
@@ -3566,7 +3586,7 @@ static void usb_audio_recurseunit(struct
 
 	case SELECTOR_UNIT:
 		if (p1[0] < 6 || p1[0] < 6+p1[4]) {
-			printk(KERN_ERR "usbaudio: unit %u: invalid SELECTOR_UNIT descriptor\n", unitid);
+			printk(KERN_ERR PFX "unit %u: invalid SELECTOR_UNIT descriptor\n", unitid);
 			return;
 		}
 		usb_audio_selectorunit(state, p1);
@@ -3574,7 +3594,7 @@ static void usb_audio_recurseunit(struct
 
 	case FEATURE_UNIT: /* See USB Audio Class Spec 4.3.2.5 */
 		if (p1[0] < 7 || p1[0] < 7+p1[5]) {
-			printk(KERN_ERR "usbaudio: unit %u: invalid FEATURE_UNIT descriptor\n", unitid);
+			printk(KERN_ERR PFX "unit %u: invalid FEATURE_UNIT descriptor\n", unitid);
 			return;
 		}
 		usb_audio_featureunit(state, p1);
@@ -3582,7 +3602,7 @@ static void usb_audio_recurseunit(struct
 
 	case PROCESSING_UNIT:
 		if (p1[0] < 13 || p1[0] < 13+p1[6] || p1[0] < 13+p1[6]+p1[11+p1[6]]) {
-			printk(KERN_ERR "usbaudio: unit %u: invalid PROCESSING_UNIT descriptor\n", unitid);
+			printk(KERN_ERR PFX "unit %u: invalid PROCESSING_UNIT descriptor\n", unitid);
 			return;
 		}
 		usb_audio_processingunit(state, p1);
@@ -3590,7 +3610,7 @@ static void usb_audio_recurseunit(struct
 
 	case EXTENSION_UNIT:
 		if (p1[0] < 13 || p1[0] < 13+p1[6] || p1[0] < 13+p1[6]+p1[11+p1[6]]) {
-			printk(KERN_ERR "usbaudio: unit %u: invalid EXTENSION_UNIT descriptor\n", unitid);
+			printk(KERN_ERR PFX "unit %u: invalid EXTENSION_UNIT descriptor\n", unitid);
 			return;
 		}
 		for (j = i = 0; i < p1[6]; i++) {
@@ -3606,12 +3626,13 @@ static void usb_audio_recurseunit(struct
 		return;
 
 	default:
-		printk(KERN_ERR "usbaudio: unit %u: unexpected type 0x%02x\n", unitid, p1[2]);
+		printk(KERN_ERR PFX "unit %u: unexpected type 0x%02x\n", unitid, p1[2]);
 		return;
 	}
 }
 
-static void usb_audio_constructmixer(struct usb_audio_state *s, unsigned char *buffer, unsigned int buflen, unsigned int ctrlif, unsigned char *oterm)
+static void usb_audio_constructmixer(struct usb_audio_state *s, unsigned char *buffer,
+			unsigned int buflen, unsigned int ctrlif, unsigned char *oterm)
 {
 	struct usb_mixerdev *ms;
 	struct consmixstate state;
@@ -3624,11 +3645,11 @@ static void usb_audio_constructmixer(str
 	state.buflen = buflen;
 	state.ctrlif = ctrlif;
 	set_bit(oterm[3], state.unitbitmap);  /* mark terminal ID as visited */
-	printk(KERN_DEBUG "usbaudio: constructing mixer for Terminal %u type 0x%04x\n",
+	printk(KERN_DEBUG PFX "constructing mixer for Terminal %u type 0x%04x\n",
 	       oterm[3], oterm[4] | (oterm[5] << 8));
 	usb_audio_recurseunit(&state, oterm[7]);
 	if (!state.nrmixch) {
-		printk(KERN_INFO "usbaudio: no mixer controls found for Terminal %u\n", oterm[3]);
+		pr_info(PFX "no mixer controls found for Terminal %u\n", oterm[3]);
 		return;
 	}
 	if (!(ms = kmalloc(sizeof(struct usb_mixerdev)+state.nrmixch*sizeof(struct mixerchannel), GFP_KERNEL)))
@@ -3639,11 +3660,11 @@ static void usb_audio_constructmixer(str
 	ms->iface = ctrlif;
 	ms->numch = state.nrmixch;
 	if ((ms->dev_mixer = register_sound_mixer(&usb_mixer_fops, -1)) < 0) {
-		printk(KERN_ERR "usbaudio: cannot register mixer\n");
+		printk(KERN_ERR PFX "cannot register mixer\n");
 		kfree(ms);
 		return;
 	}
-	printk(KERN_INFO "usbaudio: registered mixer 14,%d\n", ms->dev_mixer);
+	pr_info(PFX "registered mixer 14,%d\n", ms->dev_mixer);
 	list_add_tail(&ms->list, &s->mixerlist);
 }
 
@@ -3669,48 +3690,48 @@ static struct usb_audio_state *usb_audio
 
 	/* find audiocontrol interface */
 	if (!(p1 = find_csinterface_descriptor(buffer, buflen, NULL, HEADER, ctrlif, -1))) {
-		printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u no HEADER found\n",
+		printk(KERN_ERR PFX "device %d audiocontrol interface %u no HEADER found\n",
 		       dev->devnum, ctrlif);
 		goto ret;
 	}
 	if (p1[0] < 8 + p1[7]) {
-		printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u HEADER error\n",
+		printk(KERN_ERR PFX "device %d audiocontrol interface %u HEADER error\n",
 		       dev->devnum, ctrlif);
 		goto ret;
 	}
 	if (!p1[7])
-		printk(KERN_INFO "usbaudio: device %d audiocontrol interface %u has no AudioStreaming and MidiStreaming interfaces\n",
+		pr_info(PFX "device %d audiocontrol interface %u has no AudioStreaming and MidiStreaming interfaces\n",
 		       dev->devnum, ctrlif);
 	for (i = 0; i < p1[7]; i++) {
 		j = p1[8+i];
 		iface = usb_ifnum_to_if(dev, j);
 		if (!iface) {
-			printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u interface %u does not exist\n",
+			printk(KERN_ERR PFX "device %d audiocontrol interface %u interface %u does not exist\n",
 			       dev->devnum, ctrlif, j);
 			continue;
 		}
 		if (iface->num_altsetting == 1) {
-			printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u has only 1 altsetting.\n", dev->devnum, ctrlif);
+			printk(KERN_ERR PFX "device %d audiocontrol interface %u has only 1 altsetting.\n", dev->devnum, ctrlif);
 			continue;
 		}
 		alt = usb_altnum_to_altsetting(iface, 0);
 		if (!alt) {
-			printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u interface %u has no altsetting 0\n",
+			printk(KERN_ERR PFX "device %d audiocontrol interface %u interface %u has no altsetting 0\n",
 			       dev->devnum, ctrlif, j);
 			continue;
 		}
 		if (alt->desc.bInterfaceClass != USB_CLASS_AUDIO) {
-			printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u interface %u is not an AudioClass interface\n",
+			printk(KERN_ERR PFX "device %d audiocontrol interface %u interface %u is not an AudioClass interface\n",
 			       dev->devnum, ctrlif, j);
 			continue;
 		}
 		if (alt->desc.bInterfaceSubClass == 3) {
-			printk(KERN_INFO "usbaudio: device %d audiocontrol interface %u interface %u MIDIStreaming not supported\n",
+			printk(KERN_INFO PFX "device %d audiocontrol interface %u interface %u MIDIStreaming not supported\n",
 			       dev->devnum, ctrlif, j);
 			continue;
 		}
 		if (alt->desc.bInterfaceSubClass != 2) {
-			printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u interface %u invalid AudioClass subtype\n",
+			printk(KERN_ERR PFX "device %d audiocontrol interface %u interface %u invalid AudioClass subtype\n",
 			       dev->devnum, ctrlif, j);
 			continue;
 		}
@@ -3718,7 +3739,8 @@ static struct usb_audio_state *usb_audio
 			/* Check all endpoints; should they all have a bandwidth of 0 ? */
 			for (k = 0; k < alt->desc.bNumEndpoints; k++) {
 				if (le16_to_cpu(alt->endpoint[k].desc.wMaxPacketSize) > 0) {
-					printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u endpoint %d does not have 0 bandwidth at alt[0]\n", dev->devnum, ctrlif, k);
+					printk(KERN_ERR PFX "device %d audiocontrol interface %u endpoint %d does not have "
+						"0 bandwidth at alt[0]\n", dev->devnum, ctrlif, k);
 					break;
 				}
 			}
@@ -3728,12 +3750,12 @@ static struct usb_audio_state *usb_audio
 
 		alt = usb_altnum_to_altsetting(iface, 1);
 		if (!alt) {
-			printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u interface %u has no altsetting 1\n",
+			printk(KERN_ERR PFX "device %d audiocontrol interface %u interface %u has no altsetting 1\n",
 			       dev->devnum, ctrlif, j);
 			continue;
 		}
 		if (alt->desc.bNumEndpoints < 1) {
-			printk(KERN_ERR "usbaudio: device %d audiocontrol interface %u interface %u has no endpoint\n",
+			printk(KERN_ERR PFX "device %d audiocontrol interface %u interface %u has no endpoint\n",
 			       dev->devnum, ctrlif, j);
 			continue;
 		}
@@ -3751,7 +3773,7 @@ static struct usb_audio_state *usb_audio
 			}
 		}
 	}
-	printk(KERN_INFO "usbaudio: device %d audiocontrol interface %u has %u input and %u output AudioStreaming interfaces\n",
+	pr_info(PFX "device %d audiocontrol interface %u has %u input and %u output AudioStreaming interfaces\n",
 	       dev->devnum, ctrlif, numifin, numifout);
 	for (i = 0; i < numifin && i < numifout; i++)
 		usb_audio_parsestreaming(s, buffer, buflen, ifin[i], ifout[i]);
@@ -3776,7 +3798,7 @@ ret:
 	down(&open_sem);
 	list_add_tail(&s->audiodev, &audiodevs);
 	up(&open_sem);
-	printk(KERN_DEBUG "usb_audio_parsecontrol: usb_audio_state at %p\n", s);
+	printk(KERN_DEBUG PFX "%s(): usb_audio_state at %p\n", __FUNCTION__, s);
 	return s;
 }
 
@@ -3791,7 +3813,7 @@ static int usb_audio_probe(struct usb_in
 	unsigned int buflen;
 
 #if 0
-	printk(KERN_DEBUG "usbaudio: Probing if %i: IC %x, ISC %x\n", ifnum,
+	printk(KERN_DEBUG PFX "probing if %i: IC %x, ISC %x\n", ifnum,
 	       config->interface[ifnum].altsetting[0].desc.bInterfaceClass,
 	       config->interface[ifnum].altsetting[0].desc.bInterfaceSubClass);
 #endif
@@ -3824,11 +3846,11 @@ static void usb_audio_disconnect(struct 
 
 	/* we get called with -1 for every audiostreaming interface registered */
 	if (s == (struct usb_audio_state *)-1) {
-		dprintk((KERN_DEBUG "usbaudio: note, usb_audio_disconnect called with -1\n"));
+		DPRINTK("called with -1, returning\n");
 		return;
 	}
 	if (!s->usbdev) {
-		dprintk((KERN_DEBUG "usbaudio: error,  usb_audio_disconnect already called for %p!\n", s));
+		DPRINTK("already called for %p, returning\n", s);
 		return;
 	}
 	down(&open_sem);
@@ -3844,14 +3866,14 @@ static void usb_audio_disconnect(struct 
 		wake_up(&as->usbout.dma.wait);
 		if (as->dev_audio >= 0) {
 			unregister_sound_dsp(as->dev_audio);
-			printk(KERN_INFO "usbaudio: unregister dsp 14,%d\n", as->dev_audio);
+			pr_info(PFX "unregister dsp 14,%d\n", as->dev_audio);
 		}
 		as->dev_audio = -1;
 	}
 	list_for_each_entry(ms, &s->mixerlist, list) {
 		if (ms->dev_mixer >= 0) {
 			unregister_sound_mixer(ms->dev_mixer);
-			printk(KERN_INFO "usbaudio: unregister mixer 14,%d\n", ms->dev_mixer);
+			pr_info(PFX "unregister mixer 14,%d\n", ms->dev_mixer);
 		}
 		ms->dev_mixer = -1;
 	}

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 3/13] usb: Clean up printk()'s in drivers/usb/gadget/ether.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
  2005-03-05 23:37 ` [PATCH 2/13] usbaudio: Clean up printk()'s in drivers/usb/class/audio.c James Nelson
@ 2005-03-05 23:37 ` James Nelson
  2005-03-05 23:37 ` [PATCH 4/13] lh7a40x_udc: Clean up printk()'s in drivers/usb/gadget/lh7a40x_udc.c James Nelson
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Clean up debugging printk() macros in drivers/usb/gadget/ether.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/gadget/ether.c linux-2.6.11-mm1/drivers/usb/gadget/ether.c
--- linux-2.6.11-mm1-original/drivers/usb/gadget/ether.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/gadget/ether.c	2005-03-05 14:57:41.000000000 -0500
@@ -20,8 +20,8 @@
  */
 
 
-// #define DEBUG 1
-// #define VERBOSE
+#undef DEBUG
+#undef VERBOSE
 
 #include <linux/config.h>
 #include <linux/module.h>
@@ -296,20 +296,19 @@ module_param (qmult, uint, S_IRUGO|S_IWU
 	printk(level "%s: " fmt , (d)->net->name , ## args)
 
 #ifdef DEBUG
-#undef DEBUG
-#define DEBUG(dev,fmt,args...) \
-	xprintk(dev , KERN_DEBUG , fmt , ## args)
+#define DPRINTK(dev,fmt,args...) \
+	xprintk(dev , KERN_DEBUG , "%s(): ",fmt , __FUNCTION__, ## args)
 #else
-#define DEBUG(dev,fmt,args...) \
+#define DPRINTK(dev,fmt,args...) \
 	do { } while (0)
 #endif /* DEBUG */
 
 #ifdef VERBOSE
-#define VDEBUG	DEBUG
+#define VDEBUG	DPRINTK
 #else
 #define VDEBUG(dev,fmt,args...) \
 	do { } while (0)
-#endif /* DEBUG */
+#endif /* VERBOSE */
 
 #define ERROR(dev,fmt,args...) \
 	xprintk(dev , KERN_ERR , fmt , ## args)
@@ -1068,7 +1067,7 @@ set_ether_config (struct eth_dev *dev, i
 #endif
 
 	if (result == 0)
-		DEBUG (dev, "qlen %d\n", qlen (gadget));
+		DPRINTK (dev, "qlen %d\n", qlen (gadget));
 
 	/* caller is responsible for cleanup on error */
 	return result;
@@ -1081,7 +1080,7 @@ static void eth_reset_config (struct eth
 	if (dev->config == 0)
 		return;
 
-	DEBUG (dev, "%s\n", __FUNCTION__);
+	DPRINTK (dev, "start\n");
 
 	netif_stop_queue (dev->net);
 	netif_carrier_off (dev->net);
@@ -1220,11 +1219,11 @@ static void eth_status_complete (struct 
 
 		req->length = 16;
 		value = usb_ep_queue (ep, req, GFP_ATOMIC);
-		DEBUG (dev, "send SPEED_CHANGE --> %d\n", value);
+		DPRINTK (dev, "send SPEED_CHANGE --> %d\n", value);
 		if (value == 0)
 			return;
 	} else
-		DEBUG (dev, "event %02x --> %d\n",
+		DPRINTK (dev, "event %02x --> %d\n",
 			event->bNotificationType, value);
 
 	/* free when done */
@@ -1238,7 +1237,7 @@ static void issue_start_status (struct e
 	struct usb_cdc_notification	*event;
 	int				value;
  
-	DEBUG (dev, "%s, flush old status first\n", __FUNCTION__);
+	DPRINTK (dev, "flush old status first\n");
 
 	/* flush old status
 	 *
@@ -1253,13 +1252,13 @@ static void issue_start_status (struct e
 	/* FIXME make these allocations static like dev->req */
 	req = usb_ep_alloc_request (dev->status_ep, GFP_ATOMIC);
 	if (req == 0) {
-		DEBUG (dev, "status ENOMEM\n");
+		DPRINTK (dev, "status ENOMEM\n");
 		return;
 	}
 	req->buf = usb_ep_alloc_buffer (dev->status_ep, 16,
 				&dev->req->dma, GFP_ATOMIC);
 	if (req->buf == 0) {
-		DEBUG (dev, "status buf ENOMEM\n");
+		DPRINTK (dev, "status buf ENOMEM\n");
 free_req:
 		usb_ep_free_request (dev->status_ep, req);
 		return;
@@ -1279,7 +1278,7 @@ free_req:
 	req->complete = eth_status_complete;
 	value = usb_ep_queue (dev->status_ep, req, GFP_ATOMIC);
 	if (value < 0) {
-		DEBUG (dev, "status buf queue --> %d\n", value);
+		DPRINTK (dev, "status buf queue --> %d\n", value);
 		usb_ep_free_buffer (dev->status_ep,
 				req->buf, dev->req->dma, 16);
 		goto free_req;
@@ -1293,7 +1292,7 @@ free_req:
 static void eth_setup_complete (struct usb_ep *ep, struct usb_request *req)
 {
 	if (req->status || req->actual != req->length)
-		DEBUG ((struct eth_dev *) ep->driver_data,
+		DPRINTK ((struct eth_dev *) ep->driver_data,
 				"setup complete --> %d, %d/%d\n",
 				req->status, req->actual, req->length);
 }
@@ -1303,7 +1302,7 @@ static void eth_setup_complete (struct u
 static void rndis_response_complete (struct usb_ep *ep, struct usb_request *req)
 {
 	if (req->status || req->actual != req->length)
-		DEBUG ((struct eth_dev *) ep->driver_data,
+		DPRINTK ((struct eth_dev *) ep->driver_data,
 			"rndis response complete --> %d, %d/%d\n",
 			req->status, req->actual, req->length);
 
@@ -1394,9 +1393,9 @@ eth_setup (struct usb_gadget *gadget, co
 		if (ctrl->bRequestType != 0)
 			break;
 		if (gadget->a_hnp_support)
-			DEBUG (dev, "HNP available\n");
+			DPRINTK (dev, "HNP available\n");
 		else if (gadget->a_alt_hnp_support)
-			DEBUG (dev, "HNP needs a different root port\n");
+			DPRINTK (dev, "HNP needs a different root port\n");
 		spin_lock (&dev->lock);
 		value = eth_set_config (dev, wValue, GFP_ATOMIC);
 		spin_unlock (&dev->lock);
@@ -1502,7 +1501,7 @@ done_set_intf:
 				|| wLength != 0
 				|| wIndex > 1)
 			break;
-		DEBUG (dev, "NOP packet filter %04x\n", wValue);
+		DPRINTK (dev, "NOP packet filter %04x\n", wValue);
 		/* NOTE: table 62 has 5 filter bits to reduce traffic,
 		 * and we "must" support multicast and promiscuous.
 		 * this NOP implements a bad filter (always promisc)
@@ -1567,7 +1566,7 @@ done_set_intf:
 				&& (value % gadget->ep0->maxpacket) == 0;
 		value = usb_ep_queue (gadget->ep0, req, GFP_ATOMIC);
 		if (value < 0) {
-			DEBUG (dev, "ep_queue --> %d\n", value);
+			DPRINTK (dev, "ep_queue --> %d\n", value);
 			req->status = 0;
 			eth_setup_complete (gadget->ep0, req);
 		}
@@ -1647,7 +1646,7 @@ static void defer_kevent (struct eth_dev
 	if (!schedule_work (&dev->work))
 		ERROR (dev, "kevent %d may have been dropped\n", flag);
 	else
-		DEBUG (dev, "kevent %d scheduled\n", flag);
+		DPRINTK (dev, "kevent %d scheduled\n", flag);
 }
 
 static void rx_complete (struct usb_ep *ep, struct usb_request *req);
@@ -1679,7 +1678,7 @@ rx_submit (struct eth_dev *dev, struct u
 	size -= size % dev->out_ep->maxpacket;
 
 	if ((skb = alloc_skb (size + NET_IP_ALIGN, gfp_flags)) == 0) {
-		DEBUG (dev, "no rx skb\n");
+		DPRINTK (dev, "no rx skb\n");
 		goto enomem;
 	}
 	
@@ -1699,7 +1698,7 @@ rx_submit (struct eth_dev *dev, struct u
 enomem:
 		defer_kevent (dev, WORK_RX_MEMORY);
 	if (retval) {
-		DEBUG (dev, "rx submit --> %d\n", retval);
+		DPRINTK (dev, "rx submit --> %d\n", retval);
 		dev_kfree_skb_any (skb);
 		spin_lock (&dev->lock);
 		list_add (&req->list, &dev->rx_reqs);
@@ -1727,7 +1726,7 @@ static void rx_complete (struct usb_ep *
 		if (ETH_HLEN > skb->len || skb->len > ETH_FRAME_LEN) {
 			dev->stats.rx_errors++;
 			dev->stats.rx_length_errors++;
-			DEBUG (dev, "rx length %d\n", skb->len);
+			DPRINTK (dev, "rx length %d\n", skb->len);
 			break;
 		}
 
@@ -1751,7 +1750,7 @@ static void rx_complete (struct usb_ep *
 
 	/* for hardware automagic (such as pxa) */
 	case -ECONNABORTED:		// endpoint reset
-		DEBUG (dev, "rx %s reset\n", ep->name);
+		DPRINTK (dev, "rx %s reset\n", ep->name);
 		defer_kevent (dev, WORK_RX_MEMORY);
 quiesce:
 		dev_kfree_skb_any (skb);
@@ -1764,7 +1763,7 @@ quiesce:
 	    
 	default:
 		dev->stats.rx_errors++;
-		DEBUG (dev, "rx status %d\n", status);
+		DPRINTK (dev, "rx status %d\n", status);
 		break;
 	}
 
@@ -1832,7 +1831,7 @@ static int alloc_requests (struct eth_de
 		goto fail;
 	return 0;
 fail:
-	DEBUG (dev, "can't alloc requests\n");
+	DPRINTK (dev, "can't alloc requests\n");
 	return status;
 }
 
@@ -1873,7 +1872,7 @@ static void eth_work (void *_dev)
 	}
 
 	if (dev->todo)
-		DEBUG (dev, "work done, flags = 0x%lx\n", dev->todo);
+		DPRINTK (dev, "work done, flags = 0x%lx\n", dev->todo);
 }
 
 static void tx_complete (struct usb_ep *ep, struct usb_request *req)
@@ -1967,7 +1966,7 @@ static int eth_start_xmit (struct sk_buf
 	retval = usb_ep_queue (dev->in_ep, req, GFP_ATOMIC);
 	switch (retval) {
 	default:
-		DEBUG (dev, "tx queue err %d\n", retval);
+		DPRINTK (dev, "tx queue err %d\n", retval);
 		break;
 	case 0:
 		net->trans_start = jiffies;
@@ -2011,7 +2010,7 @@ static void
 rndis_control_ack_complete (struct usb_ep *ep, struct usb_request *req)
 {
 	if (req->status || req->actual != req->length)
-		DEBUG ((struct eth_dev *) ep->driver_data,
+		DPRINTK ((struct eth_dev *) ep->driver_data,
 			"rndis control ack complete --> %d, %d/%d\n",
 			req->status, req->actual, req->length);
 
@@ -2027,21 +2026,21 @@ static int rndis_control_ack (struct net
 	
 	/* in case RNDIS calls this after disconnect */
 	if (!dev->status_ep) {
-		DEBUG (dev, "status ENODEV\n");
+		DPRINTK (dev, "status ENODEV\n");
 		return -ENODEV;
 	}
 
 	/* Allocate memory for notification ie. ACK */
 	resp = usb_ep_alloc_request (dev->status_ep, GFP_ATOMIC);
 	if (!resp) {
-		DEBUG (dev, "status ENOMEM\n");
+		DPRINTK (dev, "status ENOMEM\n");
 		return -ENOMEM;
 	}
 	
 	resp->buf = usb_ep_alloc_buffer (dev->status_ep, 8,
 					 &resp->dma, GFP_ATOMIC);
 	if (!resp->buf) {
-		DEBUG (dev, "status buf ENOMEM\n");
+		DPRINTK (dev, "status buf ENOMEM\n");
 		usb_ep_free_request (dev->status_ep, resp);
 		return -ENOMEM;
 	}
@@ -2068,7 +2067,7 @@ static int rndis_control_ack (struct net
 
 static void eth_start (struct eth_dev *dev, int gfp_flags)
 {
-	DEBUG (dev, "%s\n", __FUNCTION__);
+	DPRINTK (dev, "start\n");
 
 	/* fill the rx queue */
 	rx_fill (dev, gfp_flags);
@@ -2090,7 +2089,7 @@ static int eth_open (struct net_device *
 {
 	struct eth_dev		*dev = netdev_priv(net);
 
-	DEBUG (dev, "%s\n", __FUNCTION__);
+	DPRINTK (dev, "start\n");
 	if (netif_carrier_ok (dev->net))
 		eth_start (dev, GFP_KERNEL);
 	return 0;
@@ -2100,10 +2099,10 @@ static int eth_stop (struct net_device *
 {
 	struct eth_dev		*dev = netdev_priv(net);
 
-	VDEBUG (dev, "%s\n", __FUNCTION__);
+	VDEBUG (dev, "start\n");
 	netif_stop_queue (net);
 
-	DEBUG (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n",
+	DPRINTK (dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n",
 		dev->stats.rx_packets, dev->stats.tx_packets, 
 		dev->stats.rx_errors, dev->stats.tx_errors
 		);
@@ -2113,7 +2112,7 @@ static int eth_stop (struct net_device *
 		usb_ep_disable (dev->in_ep);
 		usb_ep_disable (dev->out_ep);
 		if (netif_carrier_ok (dev->net)) {
-			DEBUG (dev, "host still using in/out endpoints\n");
+			DPRINTK (dev, "host still using in/out endpoints\n");
 			// FIXME idiom may leave toggle wrong here
 			usb_ep_enable (dev->in_ep, dev->in);
 			usb_ep_enable (dev->out_ep, dev->out);
@@ -2142,7 +2141,7 @@ eth_unbind (struct usb_gadget *gadget)
 {
 	struct eth_dev		*dev = get_gadget_data (gadget);
 
-	DEBUG (dev, "unbind\n");
+	DPRINTK (dev, "unbind\n");
 #ifdef CONFIG_USB_ETH_RNDIS
 	rndis_deregister (dev->rndis_config);
 	rndis_exit ();
@@ -2534,7 +2533,7 @@ eth_suspend (struct usb_gadget *gadget)
 {
 	struct eth_dev		*dev = get_gadget_data (gadget);
 
-	DEBUG (dev, "suspend\n");
+	DPRINTK (dev, "suspend\n");
 	dev->suspended = 1;
 }
 
@@ -2543,7 +2542,7 @@ eth_resume (struct usb_gadget *gadget)
 {
 	struct eth_dev		*dev = get_gadget_data (gadget);
 
-	DEBUG (dev, "resume\n");
+	DPRINTK (dev, "resume\n");
 	dev->suspended = 0;
 }
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 4/13] lh7a40x_udc: Clean up printk()'s in drivers/usb/gadget/lh7a40x_udc.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
  2005-03-05 23:37 ` [PATCH 2/13] usbaudio: Clean up printk()'s in drivers/usb/class/audio.c James Nelson
  2005-03-05 23:37 ` [PATCH 3/13] usb: Clean up printk()'s in drivers/usb/gadget/ether.c James Nelson
@ 2005-03-05 23:37 ` James Nelson
  2005-03-05 23:37 ` [PATCH 5/13] hc_crisv10: Clean up printk()'s in drivers/usb/host/hc_crisv10.c James Nelson
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Add KERN_ constants to drivers/usb/gadget/lh7a40x_udc.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/gadget/lh7a40x_udc.c linux-2.6.11-mm1/drivers/usb/gadget/lh7a40x_udc.c
--- linux-2.6.11-mm1-original/drivers/usb/gadget/lh7a40x_udc.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/gadget/lh7a40x_udc.c	2005-03-05 15:04:10.000000000 -0500
@@ -437,7 +437,7 @@ int usb_gadget_register_driver(struct us
 	device_add(&dev->gadget.dev);
 	retval = driver->bind(&dev->gadget);
 	if (retval) {
-		printk("%s: bind to driver %s --> error %d\n", dev->gadget.name,
+		printk(KERN_ERR "%s: bind to driver %s --> error %d\n", dev->gadget.name,
 		       driver->driver.name, retval);
 		device_del(&dev->gadget.dev);
 
@@ -450,7 +450,7 @@ int usb_gadget_register_driver(struct us
 	 * for set_configuration as well as eventual disconnect.
 	 * NOTE:  this shouldn't power up until later.
 	 */
-	printk("%s: registered gadget driver '%s'\n", dev->gadget.name,
+	pr_info("%s: registered gadget driver '%s'\n", dev->gadget.name,
 	       driver->driver.name);
 
 	udc_enable(dev);
@@ -585,7 +585,7 @@ static int read_fifo(struct lh7a40x_ep *
 			 * discard the extra data.
 			 */
 			if (req->req.status != -EOVERFLOW)
-				printk("%s overflow %d\n", ep->ep.name, count);
+				printk(KERN_ERR "%s overflow %d\n", ep->ep.name, count);
 			req->req.status = -EOVERFLOW;
 		} else {
 			*buf++ = byte;
@@ -835,7 +835,7 @@ static void lh7a40x_out_epn(struct lh7a4
 						       queue);
 
 				if (!req) {
-					printk("%s: NULL REQ %d\n",
+					printk(KERN_WARNING "%s: NULL REQ %d\n",
 					       __FUNCTION__, ep_idx);
 					flush(ep);
 					break;
@@ -848,7 +848,7 @@ static void lh7a40x_out_epn(struct lh7a4
 
 	} else {
 		/* Throw packet away.. */
-		printk("%s: No descriptor?!?\n", __FUNCTION__);
+		printk(KERN_WARNING "%s: no descriptor\n", __FUNCTION__);
 		flush(ep);
 	}
 }

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 5/13] hc_crisv10: Clean up printk()'s in drivers/usb/host/hc_crisv10.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (2 preceding siblings ...)
  2005-03-05 23:37 ` [PATCH 4/13] lh7a40x_udc: Clean up printk()'s in drivers/usb/gadget/lh7a40x_udc.c James Nelson
@ 2005-03-05 23:37 ` James Nelson
  2005-03-05 23:37 ` [PATCH 6/13] pxa27x-ohci: Clean up printk()'s in drivers/usb/host/ohci-pxa27x.c James Nelson
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Add KERN_ constants to printk()s missing them, and fix the debugging macros in
drivers/usb/host/hc_crisv10.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/host/hc_crisv10.c linux-2.6.11-mm1/drivers/usb/host/hc_crisv10.c
--- linux-2.6.11-mm1-original/drivers/usb/host/hc_crisv10.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/host/hc_crisv10.c	2005-03-05 15:21:06.000000000 -0500
@@ -32,16 +32,14 @@
 
 #include "hc_crisv10.h"
 
+#define PFX "hc_crisv10: "
+
 #define ETRAX_USB_HC_IRQ USB_HC_IRQ_NBR
 #define ETRAX_USB_RX_IRQ USB_DMA_RX_IRQ_NBR
 #define ETRAX_USB_TX_IRQ USB_DMA_TX_IRQ_NBR
 
 static const char *usb_hcd_version = "$Revision: 1.2 $";
 
-#undef KERN_DEBUG
-#define KERN_DEBUG ""
-
-
 #undef USB_DEBUG_RH
 #undef USB_DEBUG_EPID
 #undef USB_DEBUG_SB
@@ -54,50 +52,50 @@ static const char *usb_hcd_version = "$R
 #undef USB_DEBUG_ISOC
 
 #ifdef USB_DEBUG_RH
-#define dbg_rh(format, arg...) printk(KERN_DEBUG __FILE__ ": (RH) " format "\n" , ## arg)
+#define dbg_rh(format, arg...) printk(KERN_DEBUG PFX "(RH) " format "\n" , ## arg)
 #else
 #define dbg_rh(format, arg...) do {} while (0)
 #endif
 
 #ifdef USB_DEBUG_EPID
-#define dbg_epid(format, arg...) printk(KERN_DEBUG __FILE__ ": (EPID) " format "\n" , ## arg)
+#define dbg_epid(format, arg...) printk(KERN_DEBUG PFX "(EPID) " format "\n" , ## arg)
 #else
 #define dbg_epid(format, arg...) do {} while (0)
 #endif
 
 #ifdef USB_DEBUG_SB
-#define dbg_sb(format, arg...) printk(KERN_DEBUG __FILE__ ": (SB) " format "\n" , ## arg)
+#define dbg_sb(format, arg...) printk(KERN_DEBUG PFX "(SB) " format "\n" , ## arg)
 #else
 #define dbg_sb(format, arg...) do {} while (0)
 #endif
 
 #ifdef USB_DEBUG_CTRL
-#define dbg_ctrl(format, arg...) printk(KERN_DEBUG __FILE__ ": (CTRL) " format "\n" , ## arg)
+#define dbg_ctrl(format, arg...) printk(KERN_DEBUG PFX "(CTRL) " format "\n" , ## arg)
 #else
 #define dbg_ctrl(format, arg...) do {} while (0)
 #endif
 
 #ifdef USB_DEBUG_BULK
-#define dbg_bulk(format, arg...) printk(KERN_DEBUG __FILE__ ": (BULK) " format "\n" , ## arg)
+#define dbg_bulk(format, arg...) printk(KERN_DEBUG PFX "(BULK) " format "\n" , ## arg)
 #else
 #define dbg_bulk(format, arg...) do {} while (0)
 #endif
 
 #ifdef USB_DEBUG_INTR
-#define dbg_intr(format, arg...) printk(KERN_DEBUG __FILE__ ": (INTR) " format "\n" , ## arg)
+#define dbg_intr(format, arg...) printk(KERN_DEBUG PFX "(INTR) " format "\n" , ## arg)
 #else
 #define dbg_intr(format, arg...) do {} while (0)
 #endif
 
 #ifdef USB_DEBUG_ISOC
-#define dbg_isoc(format, arg...) printk(KERN_DEBUG __FILE__ ": (ISOC) " format "\n" , ## arg)
+#define dbg_isoc(format, arg...) printk(KERN_DEBUG PFX "(ISOC) " format "\n" , ## arg)
 #else
 #define dbg_isoc(format, arg...) do {} while (0)
 #endif
 
 #ifdef USB_DEBUG_TRACE
-#define DBFENTER (printk(": Entering: %s\n", __FUNCTION__))
-#define DBFEXIT  (printk(": Exiting:  %s\n", __FUNCTION__))
+#define DBFENTER (printk(PFX "%s(): entering\n", __FUNCTION__))
+#define DBFEXIT  (printk(PFX "%s(): exiting\n",  __FUNCTION__))
 #else
 #define DBFENTER do {} while (0)
 #define DBFEXIT  do {} while (0)
@@ -522,32 +520,36 @@ static struct usb_operations etrax_usb_d
    USB_DEBUG_URB macros. */
 static void __dump_urb(struct urb* purb)
 {
-	printk("\nurb                  :0x%08lx\n", (unsigned long)purb);
-	printk("dev                   :0x%08lx\n", (unsigned long)purb->dev);
-	printk("pipe                  :0x%08x\n", purb->pipe);
-	printk("status                :%d\n", purb->status);
-	printk("transfer_flags        :0x%08x\n", purb->transfer_flags);
-	printk("transfer_buffer       :0x%08lx\n", (unsigned long)purb->transfer_buffer);
-	printk("transfer_buffer_length:%d\n", purb->transfer_buffer_length);
-	printk("actual_length         :%d\n", purb->actual_length);
-	printk("setup_packet          :0x%08lx\n", (unsigned long)purb->setup_packet);
-	printk("start_frame           :%d\n", purb->start_frame);
-	printk("number_of_packets     :%d\n", purb->number_of_packets);
-	printk("interval              :%d\n", purb->interval);
-	printk("error_count           :%d\n", purb->error_count);
-	printk("context               :0x%08lx\n", (unsigned long)purb->context);
-	printk("complete              :0x%08lx\n\n", (unsigned long)purb->complete);
+	pr_info(PFX "%s(): start\n");
+	pr_info(PFX "urb                  :0x%08lx\n", (unsigned long)purb);
+	pr_info(PFX "dev                   :0x%08lx\n", (unsigned long)purb->dev);
+	pr_info(PFX "pipe                  :0x%08x\n", purb->pipe);
+	pr_info(PFX "status                :%d\n", purb->status);
+	pr_info(PFX "transfer_flags        :0x%08x\n", purb->transfer_flags);
+	pr_info(PFX "transfer_buffer       :0x%08lx\n", (unsigned long)purb->transfer_buffer);
+	pr_info(PFX "transfer_buffer_length:%d\n", purb->transfer_buffer_length);
+	pr_info(PFX "actual_length         :%d\n", purb->actual_length);
+	pr_info(PFX "setup_packet          :0x%08lx\n", (unsigned long)purb->setup_packet);
+	pr_info(PFX "start_frame           :%d\n", purb->start_frame);
+	pr_info(PFX "number_of_packets     :%d\n", purb->number_of_packets);
+	pr_info(PFX "interval              :%d\n", purb->interval);
+	pr_info(PFX "error_count           :%d\n", purb->error_count);
+	pr_info(PFX "context               :0x%08lx\n", (unsigned long)purb->context);
+	pr_info(PFX "complete              :0x%08lx\n\n", (unsigned long)purb->complete);
+	pr_info(PFX "%s(): end\n");
 }
 
 static void __dump_in_desc(volatile USB_IN_Desc_t *in)
 {
-	printk("\nUSB_IN_Desc at 0x%08lx\n", (unsigned long)in);
-	printk("  sw_len  : 0x%04x (%d)\n", in->sw_len, in->sw_len);
-	printk("  command : 0x%04x\n", in->command);
-	printk("  next    : 0x%08lx\n", in->next);
-	printk("  buf     : 0x%08lx\n", in->buf);
-	printk("  hw_len  : 0x%04x (%d)\n", in->hw_len, in->hw_len);
-	printk("  status  : 0x%04x\n\n", in->status);
+	pr_info(PFX "%s(): start\n");
+	pr_info(PFX "USB_IN_Desc at 0x%08lx\n", (unsigned long)in);
+	pr_info(PFX "  sw_len  : 0x%04x (%d)\n", in->sw_len, in->sw_len);
+	pr_info(PFX "  command : 0x%04x\n", in->command);
+	pr_info(PFX "  next    : 0x%08lx\n", in->next);
+	pr_info(PFX "  buf     : 0x%08lx\n", in->buf);
+	pr_info(PFX "  hw_len  : 0x%04x (%d)\n", in->hw_len, in->hw_len);
+	pr_info(PFX "  status  : 0x%04x\n\n", in->status);
+	pr_info(PFX "%s(): end\n");
 }
 
 static void __dump_sb_desc(volatile USB_SB_Desc_t *sb)
@@ -572,32 +574,36 @@ static void __dump_sb_desc(volatile USB_
 		tt_string = "unknown (weird)";
 	}
 
-	printk("\n   USB_SB_Desc at 0x%08lx\n", (unsigned long)sb);
-	printk("     command : 0x%04x\n", sb->command);
-	printk("        rem     : %d\n", (sb->command & 0x3f00) >> 8);
-	printk("        full    : %d\n", (sb->command & 0x40) >> 6);
-	printk("        tt      : %d (%s)\n", tt, tt_string);
-	printk("        intr    : %d\n", (sb->command & 0x8) >> 3);
-	printk("        eot     : %d\n", (sb->command & 0x2) >> 1);
-	printk("        eol     : %d\n", sb->command & 0x1);
-	printk("     sw_len  : 0x%04x (%d)\n", sb->sw_len, sb->sw_len);
-	printk("     next    : 0x%08lx\n", sb->next);
-	printk("     buf     : 0x%08lx\n\n", sb->buf);
+	pr_info(PFX "%s(): start\n");
+	pr_info(PFX "USB_SB_Desc at 0x%08lx\n", (unsigned long)sb);
+	pr_info(PFX "     command : 0x%04x\n", sb->command);
+	pr_info(PFX "        rem     : %d\n", (sb->command & 0x3f00) >> 8);
+	pr_info(PFX "        full    : %d\n", (sb->command & 0x40) >> 6);
+	pr_info(PFX "        tt      : %d (%s)\n", tt, tt_string);
+	pr_info(PFX "        intr    : %d\n", (sb->command & 0x8) >> 3);
+	pr_info(PFX "        eot     : %d\n", (sb->command & 0x2) >> 1);
+	pr_info(PFX "        eol     : %d\n", sb->command & 0x1);
+	pr_info(PFX "     sw_len  : 0x%04x (%d)\n", sb->sw_len, sb->sw_len);
+	pr_info(PFX "     next    : 0x%08lx\n", sb->next);
+	pr_info(PFX "     buf     : 0x%08lx\n\n", sb->buf);
+	pr_info(PFX "%s(): end\n");
 }
 
 
 static void __dump_ep_desc(volatile USB_EP_Desc_t *ep)
 {
-	printk("\nUSB_EP_Desc at 0x%08lx\n", (unsigned long)ep);
-	printk("  command : 0x%04x\n", ep->command);
-	printk("     ep_id   : %d\n", (ep->command & 0x1f00) >> 8);
-	printk("     enable  : %d\n", (ep->command & 0x10) >> 4);
-	printk("     intr    : %d\n", (ep->command & 0x8) >> 3);
-	printk("     eof     : %d\n", (ep->command & 0x2) >> 1);
-	printk("     eol     : %d\n", ep->command & 0x1);
-	printk("  hw_len  : 0x%04x (%d)\n", ep->hw_len, ep->hw_len);
-	printk("  next    : 0x%08lx\n", ep->next);
-	printk("  sub     : 0x%08lx\n\n", ep->sub);
+	pr_info(PFX "%s(): start\n");
+	pr_info(PFX "USB_EP_Desc at 0x%08lx\n", (unsigned long)ep);
+	pr_info(PFX "  command : 0x%04x\n", ep->command);
+	pr_info(PFX "     ep_id   : %d\n", (ep->command & 0x1f00) >> 8);
+	pr_info(PFX "     enable  : %d\n", (ep->command & 0x10) >> 4);
+	pr_info(PFX "     intr    : %d\n", (ep->command & 0x8) >> 3);
+	pr_info(PFX "     eof     : %d\n", (ep->command & 0x2) >> 1);
+	pr_info(PFX "     eol     : %d\n", ep->command & 0x1);
+	pr_info(PFX "  hw_len  : 0x%04x (%d)\n", ep->hw_len, ep->hw_len);
+	pr_info(PFX "  next    : 0x%08lx\n", ep->next);
+	pr_info(PFX "  sub     : 0x%08lx\n\n", ep->sub);
+	pr_info(PFX "%s(): end\n");
 }
 
 static inline void __dump_ep_list(int pipe_type)
@@ -626,7 +632,7 @@ static inline void __dump_ep_list(int pi
 	}
 	ep = first_ep;
 
-	printk("\n\nDumping EP list...\n\n");
+	pr_info(PFX "Dumping EP list...\n");
 
 	do {
 		__dump_ep_desc(ep);
@@ -647,7 +653,7 @@ static inline void __dump_ept_data(int e
 	__u32 r_usb_ept_data;
 
 	if (epid < 0 || epid > 31) {
-		printk("Cannot dump ept data for invalid epid %d\n", epid);
+		printk(KERN_ERR PFX "cannot dump ept data for invalid epid %d\n", epid);
 		return;
 	}
 
@@ -658,30 +664,33 @@ static inline void __dump_ept_data(int e
 	r_usb_ept_data = *R_USB_EPT_DATA;
 	restore_flags(flags);
 
-	printk("\nR_USB_EPT_DATA = 0x%x for epid %d :\n", r_usb_ept_data, epid);
+	pr_info(PFX "%s(): start\n");
+	pr_info(PFX "R_USB_EPT_DATA = 0x%x for epid %d :\n", r_usb_ept_data, epid);
 	if (r_usb_ept_data == 0) {
+		pr_info(PFX "epid %d empty\n", epid);
 		/* No need for more detailed printing. */
-		return;
+		goto out;
 	}
-	printk("  valid           : %d\n", (r_usb_ept_data & 0x80000000) >> 31);
-	printk("  hold            : %d\n", (r_usb_ept_data & 0x40000000) >> 30);
-	printk("  error_count_in  : %d\n", (r_usb_ept_data & 0x30000000) >> 28);
-	printk("  t_in            : %d\n", (r_usb_ept_data & 0x08000000) >> 27);
-	printk("  low_speed       : %d\n", (r_usb_ept_data & 0x04000000) >> 26);
-	printk("  port            : %d\n", (r_usb_ept_data & 0x03000000) >> 24);
-	printk("  error_code      : %d\n", (r_usb_ept_data & 0x00c00000) >> 22);
-	printk("  t_out           : %d\n", (r_usb_ept_data & 0x00200000) >> 21);
-	printk("  error_count_out : %d\n", (r_usb_ept_data & 0x00180000) >> 19);
-	printk("  max_len         : %d\n", (r_usb_ept_data & 0x0003f800) >> 11);
-	printk("  ep              : %d\n", (r_usb_ept_data & 0x00000780) >> 7);
-	printk("  dev             : %d\n", (r_usb_ept_data & 0x0000003f));
+	pr_info(PFX "  valid           : %d\n", (r_usb_ept_data & 0x80000000) >> 31);
+	pr_info(PFX "  hold            : %d\n", (r_usb_ept_data & 0x40000000) >> 30);
+	pr_info(PFX "  error_count_in  : %d\n", (r_usb_ept_data & 0x30000000) >> 28);
+	pr_info(PFX "  t_in            : %d\n", (r_usb_ept_data & 0x08000000) >> 27);
+	pr_info(PFX "  low_speed       : %d\n", (r_usb_ept_data & 0x04000000) >> 26);
+	pr_info(PFX "  port            : %d\n", (r_usb_ept_data & 0x03000000) >> 24);
+	pr_info(PFX "  error_code      : %d\n", (r_usb_ept_data & 0x00c00000) >> 22);
+	pr_info(PFX "  t_out           : %d\n", (r_usb_ept_data & 0x00200000) >> 21);
+	pr_info(PFX "  error_count_out : %d\n", (r_usb_ept_data & 0x00180000) >> 19);
+	pr_info(PFX "  max_len         : %d\n", (r_usb_ept_data & 0x0003f800) >> 11);
+	pr_info(PFX "  ep              : %d\n", (r_usb_ept_data & 0x00000780) >> 7);
+	pr_info(PFX "  dev             : %d\n", (r_usb_ept_data & 0x0000003f));
+out:	pr_info(PFX "%s(): end\n");
 }
 
 static inline void __dump_ept_data_list(void)
 {
 	int i;
 
-	printk("Dumping the whole R_USB_EPT_DATA list\n");
+	pr_info(PFX "dumping the whole R_USB_EPT_DATA list\n");
 
 	for (i = 0; i < 32; i++) {
 		__dump_ept_data(i);
@@ -1334,7 +1343,7 @@ static int etrax_usb_submit_urb(struct u
 	DBFEXIT;
 
         if (ret != 0)
-          printk("Submit URB error %d\n", ret);
+          printk(KERN_ERR PFX "submit URB error %d\n", ret);
 
 	return ret;
 }
@@ -1869,7 +1878,7 @@ static irqreturn_t etrax_usb_rx_interrup
 		epid = IO_EXTRACT(USB_IN_status, epid, myNextRxDesc->status);
 		urb = urb_list_first(epid);
 
-		//printk("eop for epid %d, first urb 0x%lx\n", epid, (unsigned long)urb);
+		//printk(KERN_DEBUG "eop for epid %d, first urb 0x%lx\n", epid, (unsigned long)urb);
 
 		if (!urb) {
 			err("No urb for epid %d in rx interrupt", epid);

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 6/13] pxa27x-ohci: Clean up printk()'s in drivers/usb/host/ohci-pxa27x.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (3 preceding siblings ...)
  2005-03-05 23:37 ` [PATCH 5/13] hc_crisv10: Clean up printk()'s in drivers/usb/host/hc_crisv10.c James Nelson
@ 2005-03-05 23:37 ` James Nelson
  2005-03-05 23:37 ` [PATCH 7/13] hidcore: Clean up printk()'s in drivers/usb/input/hid-core.c James Nelson
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Add KERN_ constants to printk()s missing them, and add driver prefixes in
drivers/usb/host/ohci-pxa27x.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/host/ohci-pxa27x.c linux-2.6.11-mm1/drivers/usb/host/ohci-pxa27x.c
--- linux-2.6.11-mm1-original/drivers/usb/host/ohci-pxa27x.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/host/ohci-pxa27x.c	2005-03-05 15:30:00.000000000 -0500
@@ -24,6 +24,7 @@
 #include <asm/hardware.h>
 #include <asm/arch/pxa-regs.h>
 
+#define PFX "pxa27x-ohci: "
 
 #define PMM_NPS_MODE           1
 #define PMM_GLOBAL_MODE        2
@@ -64,8 +65,8 @@ static int pxa27x_ohci_select_pmm( int m
 		UHCRHDB |= (0x7<<17);
 		break;
 	default:
-		printk( KERN_ERR
-			"Invalid mode %d, set to non-power switch mode.\n", 
+		printk( KERN_ERR PFX
+			"invalid mode %d, set to non-power switch mode\n", 
 			mode );
 
 		pxa27x_ohci_pmm_state = PMM_NPS_MODE;
@@ -172,7 +173,7 @@ int usb_hcd_pxa27x_probe (const struct h
 	struct usb_hcd *hcd;
 
 	if (dev->resource[1].flags != IORESOURCE_IRQ) {
-		pr_debug ("resource[1] is not IORESOURCE_IRQ");
+		pr_debug (PFX "resource[1] is not IORESOURCE_IRQ\n");
 		return -ENOMEM;
 	}
 
@@ -183,14 +184,14 @@ int usb_hcd_pxa27x_probe (const struct h
 	hcd->rsrc_len = dev->resource[0].end - dev->resource[0].start + 1;
 
 	if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, hcd_name)) {
-		pr_debug("request_mem_region failed");
+		pr_debug(PFX "request_mem_region failed\n");
 		retval = -EBUSY;
 		goto err1;
 	}
 
 	hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
 	if (!hcd->regs) {
-		pr_debug("ioremap failed");
+		pr_debug(PFX "ioremap failed\n");
 		retval = -ENOMEM;
 		goto err2;
 	}
@@ -202,13 +203,13 @@ int usb_hcd_pxa27x_probe (const struct h
 
 	/* If choosing PMM_PERPORT_MODE, we should set the port power before we use it. */
 	if (pxa27x_ohci_set_port_power(1) < 0)
-		printk(KERN_ERR "Setting port 1 power failed.\n");
+		printk(KERN_ERR PFX "setting port 1 power failed\n");
 
 	if (pxa27x_ohci_clear_port_power(2) < 0)
-		printk(KERN_ERR "Setting port 2 power failed.\n");
+		printk(KERN_ERR PFX "setting port 2 power failed\n");
 
 	if (pxa27x_ohci_clear_port_power(3) < 0)
-		printk(KERN_ERR "Setting port 3 power failed.\n");
+		printk(KERN_ERR PFX"etting port 3 power failed\n");
 
 	ohci_hcd_init(hcd_to_ohci(hcd));
 
@@ -319,7 +320,7 @@ static int ohci_hcd_pxa27x_drv_probe(str
 	struct platform_device *pdev = to_platform_device(dev);
 	int ret;
 
-	pr_debug ("In ohci_hcd_pxa27x_drv_probe");
+	pr_debug (PFX "%s(): start\n", __FUNCTION__);
 
 	if (usb_disabled())
 		return -ENODEV;
@@ -341,7 +342,7 @@ static int ohci_hcd_pxa27x_drv_suspend(s
 {
 //	struct platform_device *pdev = to_platform_device(dev);
 //	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	printk("%s: not implemented yet\n", __FUNCTION__);
+	printk(KERN_ERR "%s: not implemented yet\n", __FUNCTION__);
 
 	return 0;
 }
@@ -350,7 +351,7 @@ static int ohci_hcd_pxa27x_drv_resume(st
 {
 //	struct platform_device *pdev = to_platform_device(dev);
 //	struct usb_hcd *hcd = dev_get_drvdata(dev);
-	printk("%s: not implemented yet\n", __FUNCTION__);
+	printk(KERN_ERR "%s: not implemented yet\n", __FUNCTION__);
 
 	return 0;
 }
@@ -368,7 +369,7 @@ static struct device_driver ohci_hcd_pxa
 static int __init ohci_hcd_pxa27x_init (void)
 {
 	pr_debug (DRIVER_INFO " (pxa27x)");
-	pr_debug ("block sizes: ed %d td %d\n",
+	pr_debug (PFX "block sizes: ed %d td %d\n",
 		sizeof (struct ed), sizeof (struct td));
 
 	return driver_register(&ohci_hcd_pxa27x_driver);

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 7/13] hidcore: Clean up printk()'s in drivers/usb/input/hid-core.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (4 preceding siblings ...)
  2005-03-05 23:37 ` [PATCH 6/13] pxa27x-ohci: Clean up printk()'s in drivers/usb/host/ohci-pxa27x.c James Nelson
@ 2005-03-05 23:37 ` James Nelson
  2005-03-05 23:37 ` [PATCH 8/13] powermate: Clean up printk()'s in drivers/usb/input/powermate.c James Nelson
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Add a KERN_ERR constant and a driver prefix to printk()s needing them in
drivers/usb/input/hid-core.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/input/hid-core.c linux-2.6.11-mm1/drivers/usb/input/hid-core.c
--- linux-2.6.11-mm1-original/drivers/usb/input/hid-core.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/input/hid-core.c	2005-03-05 15:45:44.000000000 -0500
@@ -1758,12 +1758,12 @@ static int hid_probe(struct usb_interfac
 	usb_set_intfdata(intf, hid);
 
 	if (!hid->claimed) {
-		printk ("HID device not claimed by input or hiddev\n");
+		printk (KERN_ERR "HID device not claimed by input or hiddev\n");
 		hid_disconnect(intf);
 		return -EIO;
 	}
 
-	printk(KERN_INFO);
+	printk(KERN_INFO "usbhid: ");
 
 	if (hid->claimed & HID_CLAIMED_INPUT)
 		printk("input");

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 8/13] powermate: Clean up printk()'s in drivers/usb/input/powermate.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (5 preceding siblings ...)
  2005-03-05 23:37 ` [PATCH 7/13] hidcore: Clean up printk()'s in drivers/usb/input/hid-core.c James Nelson
@ 2005-03-05 23:37 ` James Nelson
  2005-03-05 23:38 ` [PATCH 9/13] vicam: Clean up printk()'s in drivers/usb/media/vicam.c James Nelson
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:37 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Add newlines and KERN_ constants to printk()s neeeding them in
drivers/usb/input/powermate.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/input/powermate.c linux-2.6.11-mm1/drivers/usb/input/powermate.c
--- linux-2.6.11-mm1-original/drivers/usb/input/powermate.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/input/powermate.c	2005-03-05 15:46:40.000000000 -0500
@@ -170,7 +170,7 @@ static void powermate_sync_state(struct 
 		pm->configcr->wIndex = cpu_to_le16( pm->static_brightness );
 		pm->requires_update &= ~UPDATE_STATIC_BRIGHTNESS;
 	}else{
-		printk(KERN_ERR "powermate: unknown update required");
+		printk(KERN_ERR "powermate: unknown update required\n");
 		pm->requires_update = 0; /* fudge the bug */
 		return;
 	}
@@ -188,7 +188,7 @@ static void powermate_sync_state(struct 
 	pm->config->transfer_flags |= URB_NO_SETUP_DMA_MAP;
 
 	if (usb_submit_urb(pm->config, GFP_ATOMIC))
-		printk(KERN_ERR "powermate: usb_submit_urb(config) failed");
+		printk(KERN_ERR "powermate: usb_submit_urb(config) failed\n");
 }
 
 /* Called when our asynchronous control message completes. We may need to issue another immediately */
@@ -357,7 +357,7 @@ static int powermate_probe(struct usb_in
 	maxp = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
 
 	if(maxp < POWERMATE_PAYLOAD_SIZE_MIN || maxp > POWERMATE_PAYLOAD_SIZE_MAX){
-		printk("powermate: Expected payload of %d--%d bytes, found %d bytes!\n",
+		printk(KERN_WARNING "powermate: Expected payload of %d--%d bytes, found %d bytes!\n",
 			POWERMATE_PAYLOAD_SIZE_MIN, POWERMATE_PAYLOAD_SIZE_MAX, maxp);
 		maxp = POWERMATE_PAYLOAD_SIZE_MAX;
 	}

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 9/13] vicam: Clean up printk()'s in drivers/usb/media/vicam.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (6 preceding siblings ...)
  2005-03-05 23:37 ` [PATCH 8/13] powermate: Clean up printk()'s in drivers/usb/input/powermate.c James Nelson
@ 2005-03-05 23:38 ` James Nelson
  2005-03-05 23:38 ` [PATCH 10/13] uss720: Clean up printk()'s in drivers/usb/misc/uss720.c James Nelson
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Fix confusing debugging macro and add KERN_ constants, nwelines, and driver prefixes
where needed in drivers/usb/media/vicam.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/media/vicam.c linux-2.6.11-mm1/drivers/usb/media/vicam.c
--- linux-2.6.11-mm1-original/drivers/usb/media/vicam.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/media/vicam.c	2005-03-05 15:56:17.000000000 -0500
@@ -34,6 +34,11 @@
  *    camera controls and wrote the first generation driver.
  */
 
+#define PFX "vicam: "
+#ifdef CONFIG_USB_DEBUG
+#define DEBUG
+#endif /*CONFIG_USB_DEBUG*/
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/init.h>
@@ -44,14 +49,7 @@
 #include <linux/proc_fs.h>
 #include "usbvideo.h"
 
-// #define VICAM_DEBUG
-
-#ifdef VICAM_DEBUG
-#define ADBG(lineno,fmt,args...) printk(fmt, jiffies, __FUNCTION__, lineno, ##args)
-#define DBG(fmt,args...) ADBG((__LINE__),KERN_DEBUG __FILE__"(%ld):%s (%d):"fmt,##args)
-#else
-#define DBG(fmn,args...) do {} while(0)
-#endif
+#define DBG(fmt,args...) pr_debug(PFX "(%ld):%s (%d):" fmt, jiffies, __FUNCTION__, __LINE__, ##args )
 
 #define DRIVER_AUTHOR           "Joe Burks, jburks@wavicle.org"
 #define DRIVER_DESC             "ViCam WebCam Driver"
@@ -446,7 +444,7 @@ static int __send_control_msg(struct vic
 	status = min(status, 0);
 
 	if (status < 0) {
-		printk(KERN_INFO "Failed sending control message, error %d.\n",
+		printk(KERN_INFO PFX "failed sending control message, error %d\n",
 		       status);
 	}
 
@@ -691,7 +689,8 @@ vicam_ioctl(struct inode *inode, struct 
 				break;
 			}
 
-			DBG("VIDIOCMCAPTURE frame=%d, height=%d, width=%d, format=%d.\n",vm.frame,vm.width,vm.height,vm.format);
+			DBG("VIDIOCMCAPTURE frame=%d, height=%d, width=%d, format=%d\n",
+				vm.frame,vm.width,vm.height,vm.format);
 
 			if ( vm.frame >= VICAM_FRAMES || vm.format != VIDEO_PALETTE_RGB24 )
 				retval = -EINVAL;
@@ -761,8 +760,7 @@ vicam_open(struct inode *inode, struct f
 	DBG("open\n");
 
 	if (!cam) {
-		printk(KERN_ERR
-		       "vicam video_device improperly initialized");
+		printk(KERN_ERR PFX "device improperly initialized\n");
 	}
 
 	/* the videodev_lock held above us protects us from
@@ -771,8 +769,8 @@ vicam_open(struct inode *inode, struct f
 	 */
 
 	if (cam->open_count > 0) {
-		printk(KERN_INFO
-		       "vicam_open called on already opened camera");
+		printk(KERN_INFO PFX "%s(): called on already opened camera\n",
+			__FUNCTION__);
 		return -EBUSY;
 	}
 
@@ -969,8 +967,7 @@ read_frame(struct vicam_camera *cam, int
 	n = __send_control_msg(cam, 0x51, 0x80, 0, request, 16);
 
 	if (n < 0) {
-		printk(KERN_ERR
-		       " Problem sending frame capture control message");
+		printk(KERN_ERR PFX "problem sending frame capture control message\n");
 		goto done;
 	}
 
@@ -980,7 +977,7 @@ read_frame(struct vicam_camera *cam, int
 			 512 * 242 + 128, &actual_length, 10000);
 
 	if (n < 0) {
-		printk(KERN_ERR "Problem during bulk read of frame data: %d\n",
+		printk(KERN_ERR PFX "problem during bulk read of frame data: %d\n",
 		       n);
 	}
 
@@ -993,7 +990,7 @@ vicam_read( struct file *file, char __us
 {
 	struct vicam_camera *cam = file->private_data;
 
-	DBG("read %d bytes.\n", (int) count);
+	DBG("read %d bytes\n", (int) count);
 
 	if (*ppos >= VICAM_MAX_FRAME_SIZE) {
 		*ppos = 0;
@@ -1035,7 +1032,7 @@ vicam_mmap(struct file *file, struct vm_
 	if (!cam)
 		return -ENODEV;
 
-	DBG("vicam_mmap: %ld\n", size);
+	DBG("size = %ld\n", size);
 
 	/* We let mmap allocate as much as it wants because Linux was adding 2048 bytes
 	 * to the size the application requested for mmap and it was screwing apps up.
@@ -1153,8 +1150,7 @@ vicam_create_proc_root(void)
 	if (vicam_proc_root)
 		vicam_proc_root->owner = THIS_MODULE;
 	else
-		printk(KERN_ERR
-		       "could not create /proc entry for vicam!");
+		printk(KERN_ERR PFX "could not create /proc entry for vicam\n");
 }
 
 static void
@@ -1170,11 +1166,10 @@ vicam_create_proc_entry(struct vicam_cam
 	char name[64];
 	struct proc_dir_entry *ent;
 
-	DBG(KERN_INFO "vicam: creating proc entry\n");
+	DBG("creating proc entry\n");
 
 	if (!vicam_proc_root || !cam) {
-		printk(KERN_INFO
-		       "vicam: could not create proc entry, %s pointer is null.\n",
+		printk(KERN_INFO PFX "could not create proc entry, %s pointer is null.\n",
 		       (!cam ? "camera" : "root"));
 		return;
 	}
@@ -1281,11 +1276,11 @@ vicam_probe( struct usb_interface *intf,
 	const struct usb_endpoint_descriptor *endpoint;
 	struct vicam_camera *cam;
 	
-	printk(KERN_INFO "ViCam based webcam connected\n");
+	printk(KERN_INFO PFX "webcam connected\n");
 
 	interface = intf->cur_altsetting;
 
-	DBG(KERN_DEBUG "Interface %d. has %u. endpoints!\n",
+	DBG("interface %d has %u endpoints\n",
 	       interface->desc.bInterfaceNumber, (unsigned) (interface->desc.bNumEndpoints));
 	endpoint = &interface->endpoint[0].desc;
 
@@ -1294,13 +1289,12 @@ vicam_probe( struct usb_interface *intf,
 		/* we found a bulk in endpoint */
 		bulkEndpoint = endpoint->bEndpointAddress;
 	} else {
-		printk(KERN_ERR
-		       "No bulk in endpoint was found ?! (this is bad)\n");
+		printk(KERN_ERR PFX "no bulk in endpoint was found\n");
 	}
 
 	if ((cam =
 	     kmalloc(sizeof (struct vicam_camera), GFP_KERNEL)) == NULL) {
-		printk(KERN_WARNING
+		printk(KERN_WARNING PFX
 		       "could not allocate kernel memory for vicam_camera struct\n");
 		return -ENOMEM;
 	}
@@ -1320,13 +1314,13 @@ vicam_probe( struct usb_interface *intf,
 
 	if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) == -1) {
 		kfree(cam);
-		printk(KERN_WARNING "video_register_device failed\n");
+		printk(KERN_WARNING PFX "video_register_device failed\n");
 		return -EIO;
 	}
 
 	vicam_create_proc_entry(cam);
 
-	printk(KERN_INFO "ViCam webcam driver now controlling video device %d\n",cam->vdev.minor);
+	printk(KERN_INFO PFX "now controlling video device %d\n",cam->vdev.minor);
 
 	usb_set_intfdata (intf, cam);
 	
@@ -1374,7 +1368,7 @@ vicam_disconnect(struct usb_interface *i
 		kfree(cam);
 	}
 
-	printk(KERN_DEBUG "ViCam-based WebCam disconnected\n");
+	printk(KERN_DEBUG PFX "webcam disconnected\n");
 }
 
 /*
@@ -1383,19 +1377,18 @@ static int __init
 usb_vicam_init(void)
 {
 	int retval;
-	DBG(KERN_INFO "ViCam-based WebCam driver startup\n");
+	DBG("driver startup\n");
 	vicam_create_proc_root();
 	retval = usb_register(&vicam_driver);
 	if (retval)
-		printk(KERN_WARNING "usb_register failed!\n");
+		printk(KERN_WARNING PFX "usb_register failed!\n");
 	return retval;
 }
 
 static void __exit
 usb_vicam_exit(void)
 {
-	DBG(KERN_INFO
-	       "ViCam-based WebCam driver shutdown\n");
+	DBG("driver shutdown\n");
 
 	usb_deregister(&vicam_driver);
 	vicam_destroy_proc_root();

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 10/13] uss720: Clean up printk()'s in drivers/usb/misc/uss720.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (7 preceding siblings ...)
  2005-03-05 23:38 ` [PATCH 9/13] vicam: Clean up printk()'s in drivers/usb/media/vicam.c James Nelson
@ 2005-03-05 23:38 ` James Nelson
  2005-03-05 23:38 ` [PATCH 11/13] safe_serial: Clean up printk()'s in drivers/usb/serial/safe_serial.c James Nelson
  2005-03-06  5:56 ` [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c Greg KH
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Add a KERN_ constant and fix two driver prefixes in the printk()s in
drivers/usb/misc/uss720.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/misc/uss720.c linux-2.6.11-mm1/drivers/usb/misc/uss720.c
--- linux-2.6.11-mm1-original/drivers/usb/misc/uss720.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/misc/uss720.c	2005-03-05 15:58:13.000000000 -0500
@@ -564,7 +564,7 @@ static int uss720_probe(struct usb_inter
 	if (!(priv = kmalloc(sizeof(struct parport_uss720_private), GFP_KERNEL)))
 		return -ENOMEM;
 	if (!(pp = parport_register_port(0, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, &parport_uss720_ops))) {
-		printk(KERN_WARNING "usb-uss720: could not register parport\n");
+		printk(KERN_WARNING "uss720: could not register parport\n");
 		goto probe_abort;
 	}
 
@@ -578,7 +578,7 @@ static int uss720_probe(struct usb_inter
 	set_1284_register(pp, 2, 0x0c);
 	/* debugging */
 	get_1284_register(pp, 0, NULL);
-	printk("uss720: reg: %02x %02x %02x %02x %02x %02x %02x\n",
+	printk(KERN_DEBUG "uss720: reg: %02x %02x %02x %02x %02x %02x %02x\n",
 	       priv->reg[0], priv->reg[1], priv->reg[2], priv->reg[3], priv->reg[4], priv->reg[5], priv->reg[6]);
 
 	endpoint = &interface->endpoint[2];
@@ -589,7 +589,7 @@ static int uss720_probe(struct usb_inter
 				  uss720_irq, endpoint->bInterval,
 				  pp, &priv->irqhandle);
 	if (i) {
-		printk (KERN_WARNING "usb-uss720: usb_request_irq failed (0x%x)\n", i);
+		printk (KERN_WARNING "uss720: usb_request_irq failed (0x%x)\n", i);
 		goto probe_abort_port;
 	}
 #endif

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 11/13] safe_serial: Clean up printk()'s in drivers/usb/serial/safe_serial.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (8 preceding siblings ...)
  2005-03-05 23:38 ` [PATCH 10/13] uss720: Clean up printk()'s in drivers/usb/misc/uss720.c James Nelson
@ 2005-03-05 23:38 ` James Nelson
  2005-03-06  5:56 ` [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c Greg KH
  10 siblings, 0 replies; 14+ messages in thread
From: James Nelson @ 2005-03-05 23:38 UTC (permalink / raw)
  To: linux-kernel; +Cc: akpm, James Nelson

Fix missing KERN_ constants in buffer dump loops in drivers/usb/serial/safe_serial.c

Signed-off-by: James Nelson <james4765@gmail.com>

diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/serial/safe_serial.c linux-2.6.11-mm1/drivers/usb/serial/safe_serial.c
--- linux-2.6.11-mm1-original/drivers/usb/serial/safe_serial.c	2005-03-05 13:29:48.000000000 -0500
+++ linux-2.6.11-mm1/drivers/usb/serial/safe_serial.c	2005-03-05 16:04:23.000000000 -0500
@@ -227,7 +227,10 @@ static void safe_read_bulk_callback (str
 		unsigned char *cp = port->read_urb->transfer_buffer;
 		for (i = 0; i < port->read_urb->actual_length; i++) {
 			if ((i % 32) == 0) {
-				printk ("\nru[%02x] ", i);
+				if (i == 0)
+					printk (KERN_DEBUG "start");
+				printk ("\n")
+				printk (KERN_DEBUG "ru[%02x] ", i);
 			}
 			printk ("%02x ", *cp++);
 		}
@@ -345,7 +348,10 @@ static int safe_write (struct usb_serial
 		unsigned char *cp = port->write_urb->transfer_buffer;
 		for (i = 0; i < port->write_urb->transfer_buffer_length; i++) {
 			if ((i % 32) == 0) {
-				printk ("\nsu[%02x] ", i);
+				if (i ==0)
+					printk (KERN_DEBUG "start");
+				printk ("\n");
+				printk (KERN_DEBUG "su[%02x] ", i);
 			}
 			printk ("%02x ", *cp++);
 		}

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c
  2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
                   ` (9 preceding siblings ...)
  2005-03-05 23:38 ` [PATCH 11/13] safe_serial: Clean up printk()'s in drivers/usb/serial/safe_serial.c James Nelson
@ 2005-03-06  5:56 ` Greg KH
  2005-03-06 12:18   ` Jim Nelson
  10 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2005-03-06  5:56 UTC (permalink / raw)
  To: James Nelson; +Cc: linux-kernel, akpm

On Sat, Mar 05, 2005 at 05:37:13PM -0600, James Nelson wrote:
> Add a KERN_WARNING constant to a printk() that is missing it, and add a driver
> prefix to another two in drivers/usb/atm/speedtch.c

Please CC: usb patches to the usb maintainer, it makes it a bit hard for
him to apply them otherwise :)

> Signed-off-by: James Nelson <james4765@gmail.com>
> 
> diff -Nurp -x dontdiff-osdl --exclude='*~' linux-2.6.11-mm1-original/drivers/usb/atm/speedtch.c linux-2.6.11-mm1/drivers/usb/atm/speedtch.c
> --- linux-2.6.11-mm1-original/drivers/usb/atm/speedtch.c	2005-03-05 13:29:48.000000000 -0500
> +++ linux-2.6.11-mm1/drivers/usb/atm/speedtch.c	2005-03-05 13:36:44.000000000 -0500
> @@ -192,8 +192,8 @@ static int speedtch_set_swbuff(struct sp
>  			      0x32, 0x40, state ? 0x01 : 0x00,
>  			      0x00, NULL, 0, 100);
>  	if (ret < 0) {
> -		printk("Warning: %sabling SW buffering: usb_control_msg returned %d\n",
> -		     state ? "En" : "Dis", ret);
> +		printk(KERN_WARNING "%s: %sabling SW buffering: usb_control_msg returned %d\n",
> +		     speedtch_driver_name, state ? "En" : "Dis", ret);

No, please, if you are going to convert anything like this, use the
dev_dbg(), dev_warn(), and assorted macros instead.  Or if nothing else,
the usb subsystem has it's own dbg(), err() and warn() macros that
should be gotten rid of, but that's a lot of changes...

These comments pretty much go for all of your patches in this series,
please rework them all.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c
  2005-03-06  5:56 ` [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c Greg KH
@ 2005-03-06 12:18   ` Jim Nelson
  2005-03-07 23:21     ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Jim Nelson @ 2005-03-06 12:18 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Greg KH wrote:
| On Sat, Mar 05, 2005 at 05:37:13PM -0600, James Nelson wrote:
|
|>Add a KERN_WARNING constant to a printk() that is missing it, and add a driver
|>prefix to another two in drivers/usb/atm/speedtch.c
|
|
| Please CC: usb patches to the usb maintainer, it makes it a bit hard for
| him to apply them otherwise :)
|

Sorry, screwed up with my patchbomb script...

|
|>Signed-off-by: James Nelson <james4765@gmail.com>
|>
|>diff -Nurp -x dontdiff-osdl --exclude='*~'
linux-2.6.11-mm1-original/drivers/usb/atm/speedtch.c
linux-2.6.11-mm1/drivers/usb/atm/speedtch.c
|>--- linux-2.6.11-mm1-original/drivers/usb/atm/speedtch.c	2005-03-05
13:29:48.000000000 -0500
|>+++ linux-2.6.11-mm1/drivers/usb/atm/speedtch.c	2005-03-05 13:36:44.000000000 -0500
|>@@ -192,8 +192,8 @@ static int speedtch_set_swbuff(struct sp
|> 			      0x32, 0x40, state ? 0x01 : 0x00,
|> 			      0x00, NULL, 0, 100);
|> 	if (ret < 0) {
|>-		printk("Warning: %sabling SW buffering: usb_control_msg returned %d\n",
|>-		     state ? "En" : "Dis", ret);
|>+		printk(KERN_WARNING "%s: %sabling SW buffering: usb_control_msg returned %d\n",
|>+		     speedtch_driver_name, state ? "En" : "Dis", ret);
|
|
| No, please, if you are going to convert anything like this, use the
| dev_dbg(), dev_warn(), and assorted macros instead.  Or if nothing else,
| the usb subsystem has it's own dbg(), err() and warn() macros that
| should be gotten rid of, but that's a lot of changes...
|

Okay.  A bit more work, but it makes sense.

| These comments pretty much go for all of your patches in this series,
| please rework them all.
|

Any other tips on how the usb printk()s should be formatted to maintain
consistency?  Or some driver that I could use as an example?

| thanks,
|
| greg k-h
|

Jim

- --
GPG Public key at pgp.mit.edu

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFCKvUhevfmjTWdv3MRAnkvAJ99aKDoqxVsblwktEyrAm26fymAogCfXhkm
7zsxDwAjbqEZZksxgfJKg1k=
=m+mZ
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c
  2005-03-06 12:18   ` Jim Nelson
@ 2005-03-07 23:21     ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2005-03-07 23:21 UTC (permalink / raw)
  To: Jim Nelson; +Cc: linux-kernel

On Sun, Mar 06, 2005 at 07:18:41AM -0500, Jim Nelson wrote:
> Any other tips on how the usb printk()s should be formatted to maintain
> consistency?  Or some driver that I could use as an example?

Use dev_dbg() and friends.  That is the proper consistency.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-03-08  3:03 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-05 23:37 [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c James Nelson
2005-03-05 23:37 ` [PATCH 2/13] usbaudio: Clean up printk()'s in drivers/usb/class/audio.c James Nelson
2005-03-05 23:37 ` [PATCH 3/13] usb: Clean up printk()'s in drivers/usb/gadget/ether.c James Nelson
2005-03-05 23:37 ` [PATCH 4/13] lh7a40x_udc: Clean up printk()'s in drivers/usb/gadget/lh7a40x_udc.c James Nelson
2005-03-05 23:37 ` [PATCH 5/13] hc_crisv10: Clean up printk()'s in drivers/usb/host/hc_crisv10.c James Nelson
2005-03-05 23:37 ` [PATCH 6/13] pxa27x-ohci: Clean up printk()'s in drivers/usb/host/ohci-pxa27x.c James Nelson
2005-03-05 23:37 ` [PATCH 7/13] hidcore: Clean up printk()'s in drivers/usb/input/hid-core.c James Nelson
2005-03-05 23:37 ` [PATCH 8/13] powermate: Clean up printk()'s in drivers/usb/input/powermate.c James Nelson
2005-03-05 23:38 ` [PATCH 9/13] vicam: Clean up printk()'s in drivers/usb/media/vicam.c James Nelson
2005-03-05 23:38 ` [PATCH 10/13] uss720: Clean up printk()'s in drivers/usb/misc/uss720.c James Nelson
2005-03-05 23:38 ` [PATCH 11/13] safe_serial: Clean up printk()'s in drivers/usb/serial/safe_serial.c James Nelson
2005-03-06  5:56 ` [PATCH 1/13] speedtch: Clean up printk()'s in drivers/usb/atm/speedtch.c Greg KH
2005-03-06 12:18   ` Jim Nelson
2005-03-07 23:21     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox