public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] Staging: comedi: drivers: replaced printk with dev_dbg
@ 2012-11-19 15:14 Arpith Easow Alexander
  2012-11-19 15:20 ` Joe Perches
  0 siblings, 1 reply; 2+ messages in thread
From: Arpith Easow Alexander @ 2012-11-19 15:14 UTC (permalink / raw)
  To: abbotti, fmhess, gregkh, hsweeten, dan.carpenter; +Cc: devel, linux-kernel

This is a patch to the vmk80xx.c file that replaces the printk with dev_dbg.
This fixes the warnings found by the checkpatch.pl tool.

Signed-off-by: Arpith Easow Alexander <arpith99@gmail.com>
---
 drivers/staging/comedi/drivers/vmk80xx.c |   30 ++++++++++++++++++------------
 1 file changed, 18 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c
index df277aa..6eb5361 100644
--- a/drivers/staging/comedi/drivers/vmk80xx.c
+++ b/drivers/staging/comedi/drivers/vmk80xx.c
@@ -131,10 +131,10 @@ static int dbgcm = 1;
 static int dbgcm;
 #endif
 
-#define dbgcm(fmt, arg...)                     \
+#define dbgcm(dev, fmt, arg...)                     \
 do {                                           \
 	if (dbgcm)                             \
-		printk(KERN_DEBUG fmt, ##arg); \
+		dev_dbg(dev, fmt, ##arg); \
 } while (0)
 
 enum vmk80xx_model {
@@ -213,8 +213,9 @@ static void vmk80xx_tx_callback(struct urb *urb)
 
 	if (stat && !(stat == -ENOENT
 		      || stat == -ECONNRESET || stat == -ESHUTDOWN))
-		dbgcm("comedi#: vmk80xx: %s - nonzero urb status (%d)\n",
-		      __func__, stat);
+		dbgcm(&(dev->udev->dev),
+			"comedi#: vmk80xx: %s - nonzero urb status (%d)\n",
+			__func__, stat);
 
 	if (!test_bit(TRANS_OUT_BUSY, &dev->flags))
 		return;
@@ -237,7 +238,8 @@ static void vmk80xx_rx_callback(struct urb *urb)
 	case -ESHUTDOWN:
 		break;
 	default:
-		dbgcm("comedi#: vmk80xx: %s - nonzero urb status (%d)\n",
+		dbgcm(&(dev->udev->dev),
+		      "comedi#: vmk80xx: %s - nonzero urb status (%d)\n",
 		      __func__, stat);
 		goto resubmit;
 	}
@@ -1371,14 +1373,16 @@ static int vmk80xx_usb_probe(struct usb_interface *intf,
 
 	if (dev->board.model == VMK8061_MODEL) {
 		vmk80xx_read_eeprom(dev, IC3_VERSION);
-		printk(KERN_INFO "comedi#: vmk80xx: %s\n", dev->fw.ic3_vers);
+		dev_dbg(&(dev->udev->dev),
+			"comedi#: vmk80xx: %s\n", dev->fw.ic3_vers);
 
 		if (vmk80xx_check_data_link(dev)) {
 			vmk80xx_read_eeprom(dev, IC6_VERSION);
-			printk(KERN_INFO "comedi#: vmk80xx: %s\n",
+			dev_dbg(&(dev->udev->dev), "comedi#: vmk80xx: %s\n",
 			       dev->fw.ic6_vers);
 		} else {
-			dbgcm("comedi#: vmk80xx: no conn. to CPU\n");
+			dbgcm(&(dev->udev->dev),
+				"comedi#: vmk80xx: no conn. to CPU\n");
 		}
 	}
 
@@ -1387,8 +1391,9 @@ static int vmk80xx_usb_probe(struct usb_interface *intf,
 
 	dev->probed = 1;
 
-	printk(KERN_INFO "comedi#: vmk80xx: board #%d [%s] now attached\n",
-	       dev->count, dev->board.name);
+	dev_dbg(&(dev->udev->dev),
+		"comedi#: vmk80xx: board #%d [%s] now attached\n",
+		dev->count, dev->board.name);
 
 	mutex_unlock(&glb_mutex);
 
@@ -1422,8 +1427,9 @@ static void vmk80xx_usb_disconnect(struct usb_interface *intf)
 	kfree(dev->usb_rx_buf);
 	kfree(dev->usb_tx_buf);
 
-	printk(KERN_INFO "comedi#: vmk80xx: board #%d [%s] now detached\n",
-	       dev->count, dev->board.name);
+	dev_dbg(&(dev->udev->dev),
+		"comedi#: vmk80xx: board #%d [%s] now detached\n",
+		dev->count, dev->board.name);
 
 	up(&dev->limit_sem);
 	mutex_unlock(&glb_mutex);
-- 
1.7.9.5


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

* Re: [PATCH v2 1/2] Staging: comedi: drivers: replaced printk with dev_dbg
  2012-11-19 15:14 [PATCH v2 1/2] Staging: comedi: drivers: replaced printk with dev_dbg Arpith Easow Alexander
@ 2012-11-19 15:20 ` Joe Perches
  0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2012-11-19 15:20 UTC (permalink / raw)
  To: Arpith Easow Alexander
  Cc: abbotti, fmhess, gregkh, hsweeten, dan.carpenter, devel,
	linux-kernel

On Mon, 2012-11-19 at 20:44 +0530, Arpith Easow Alexander wrote:
> This is a patch to the vmk80xx.c file that replaces the printk with dev_dbg.
> This fixes the warnings found by the checkpatch.pl tool.

The commit message is missing description of why
some printk(KERN_INFO are converted to dev_dbg

Also, it'd be better to remove the dbgcm macro
altogether and just use dev_dbg.

> diff --git a/drivers/staging/comedi/drivers/vmk80xx.c b/drivers/staging/comedi/drivers/vmk80xx.c
[]
> @@ -131,10 +131,10 @@ static int dbgcm = 1;
>  static int dbgcm;
>  #endif
>  
> -#define dbgcm(fmt, arg...)                     \
> +#define dbgcm(dev, fmt, arg...)                     \
>  do {                                           \
>  	if (dbgcm)                             \
> -		printk(KERN_DEBUG fmt, ##arg); \
> +		dev_dbg(dev, fmt, ##arg); \
>  } while (0)

The dbgcm variable and macro isn't really necessary
because dynamic_debug has all the same capability.

> @@ -1371,14 +1373,16 @@ static int vmk80xx_usb_probe(struct usb_interface *intf,
>  
>  	if (dev->board.model == VMK8061_MODEL) {
>  		vmk80xx_read_eeprom(dev, IC3_VERSION);
> -		printk(KERN_INFO "comedi#: vmk80xx: %s\n", dev->fw.ic3_vers);
> +		dev_dbg(&(dev->udev->dev),
> +			"comedi#: vmk80xx: %s\n", dev->fw.ic3_vers);

This likely should not be dev_dbg.



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

end of thread, other threads:[~2012-11-19 15:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-19 15:14 [PATCH v2 1/2] Staging: comedi: drivers: replaced printk with dev_dbg Arpith Easow Alexander
2012-11-19 15:20 ` Joe Perches

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