Skip to contentSkip to conversation

staging/comedi: Use dev_ printks in drivers/adl_pci8164.c

PATCH In review YAMANE Toshiaki 2 participants 4 messages Oct 5, 2012 – Oct 6, 2012 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging/comedi: Use dev_ printks in drivers/adl_pci8164.c

fixed below checkpatch warning.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
 drivers/staging/comedi/drivers/adl_pci8164.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/comedi/drivers/adl_pci8164.c +6 -6
index 05e06e7..6dbe465 100644
@@ -89,9 +89,9 @@ static void adl_pci8164_insn_read(struct comedi_device *dev,
 	}
 
 	data[0] = inw(dev->iobase + axis_reg + offset);
-	printk(KERN_DEBUG "comedi: pci8164 %s read -> "
-						  "%04X:%04X on axis %s\n",
-				action, data[0], data[1], axisname);
+	dev_dbg(dev->class_dev,
+		  "comedi: pci8164 %s read -> %04X:%04X on axis %s\n",
+		  action, data[0], data[1], axisname);
 }
 
 static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
@@ -170,9 +170,9 @@ static void adl_pci8164_insn_out(struct comedi_device *dev,
 
 	outw(data[0], dev->iobase + axis_reg + offset);
 
-	printk(KERN_DEBUG "comedi: pci8164 %s write -> "
-						"%04X:%04X on axis %s\n",
-				action, data[0], data[1], axisname);
+	dev_dbg(dev->class_dev,
+		  "comedi: pci8164 %s write -> %04X:%04X on axis %s\n",
+		  action, data[0], data[1], axisname);
 
 }
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 13 lines · YAMANE Toshiaki

fixed below checkpatch warning.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
  drivers/staging/comedi/drivers/adl_pci8164.c |   12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/comedi/drivers/adl_pci8164.c +0 -0
index 05e06e7..6dbe465 100644

drivers/staging/comedi/drivers/adl_pci8164.c static void adl_pci8164_insn_read(struct comedi_device *dev, · line 95

Quoted 10 lines
drivers/staging/comedi/drivers/adl_pci8164.c +3 -3
@@ -89,9 +89,9 @@ static void adl_pci8164_insn_read(struct comedi_device *dev,
  	}
 
  	data[0] = inw(dev->iobase + axis_reg + offset);
-	printk(KERN_DEBUG "comedi: pci8164 %s read -> "
-						  "%04X:%04X on axis %s\n",
-				action, data[0], data[1], axisname);
+	dev_dbg(dev->class_dev,
+		  "comedi: pci8164 %s read -> %04X:%04X on axis %s\n",
+		  action, data[0], data[1], axisname);
  }

The "comedi: " prefix is superfluous, so should be removed. The dev_dbg() call will emit the word "comedi" twice already without the extra prefix.

Quoted 4 lines
drivers/staging/comedi/drivers/adl_pci8164.c +0 -0
  static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
@@ -170,9 +170,9 @@ static void adl_pci8164_insn_out(struct comedi_device *dev,
 

drivers/staging/comedi/drivers/adl_pci8164.c static void adl_pci8164_insn_out(struct comedi_device *dev, · line 177

Quoted 10 lines
drivers/staging/comedi/drivers/adl_pci8164.c +3 -3
  	outw(data[0], dev->iobase + axis_reg + offset);
 
-	printk(KERN_DEBUG "comedi: pci8164 %s write -> "
-						"%04X:%04X on axis %s\n",
-				action, data[0], data[1], axisname);
+	dev_dbg(dev->class_dev,
+		  "comedi: pci8164 %s write -> %04X:%04X on axis %s\n",
+		  action, data[0], data[1], axisname);
 
  }

Same here.

Signature · 2 lines
-=( Ian Abbott @ MEV Ltd.    E-mail: <[email protected]>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-
#2 lore raw
Quoted 49 lines · Ian Abbott
Quoted 18 lines · YAMANE Toshiaki

fixed below checkpatch warning.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(... to printk(KERN_ERR ...

---
  drivers/staging/comedi/drivers/adl_pci8164.c |   12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/comedi/drivers/adl_pci8164.c +0 -0
index 05e06e7..6dbe465 100644
@@ -89,9 +89,9 @@ static void adl_pci8164_insn_read(struct comedi_device
 *dev,
        }

drivers/staging/comedi/drivers/adl_pci8164.c static void adl_pci8164_insn_read(struct comedi_device · line 97

Quoted 10 lines
drivers/staging/comedi/drivers/adl_pci8164.c +3 -3
 
        data[0] = inw(dev->iobase + axis_reg + offset);
-       printk(KERN_DEBUG "comedi: pci8164 %s read -> "
-                                                 "%04X:%04X on axis
 %s\n",
-                               action, data[0], data[1], axisname);
+       dev_dbg(dev->class_dev,
+                 "comedi: pci8164 %s read -> %04X:%04X on axis %s\n",
+                 action, data[0], data[1], axisname);
  }

The "comedi: " prefix is superfluous, so should be removed. The dev_dbg() call will emit the word "comedi" twice already without the extra prefix.

Quoted 14 lines

static int adl_pci8164_insn_read_msts(struct comedi_device *dev,

drivers/staging/comedi/drivers/adl_pci8164.c +3 -3
@@ -170,9 +170,9 @@ static void adl_pci8164_insn_out(struct comedi_device
 *dev,
 
        outw(data[0], dev->iobase + axis_reg + offset);
 
-       printk(KERN_DEBUG "comedi: pci8164 %s write -> "
-                                               "%04X:%04X on axis %s\n",
-                               action, data[0], data[1], axisname);
+       dev_dbg(dev->class_dev,
+                 "comedi: pci8164 %s write -> %04X:%04X on axis %s\n",
+                 action, data[0], data[1], axisname);
 
Quoted 4 lines

drivers/staging/comedi/drivers/adl_pci8164.c static void adl_pci8164_insn_out(struct comedi_device · line 178

Quoted 1 line
drivers/staging/comedi/drivers/adl_pci8164.c +0 -0
  }

Same here.

Ian-san,

Thank you for pointing out my mistakes.
I will try to fix it.

Signature · 3 lines
Regards,

YAMANE Toshiaki
#3 lore raw

PATCH 1/1 staging/comedi: Use dev_ printks in drivers/adl_pci8164.c

In reply to YAMANE Toshiaki

fixed below checkpatch warning.
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(... to printk(KERN_DEBUG ...

---
 drivers/staging/comedi/drivers/adl_pci8164.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/comedi/drivers/adl_pci8164.c +6 -6
index 05e06e7..5a6d6d2 100644
@@ -89,9 +89,9 @@ static void adl_pci8164_insn_read(struct comedi_device *dev,
 	}
 
 	data[0] = inw(dev->iobase + axis_reg + offset);
-	printk(KERN_DEBUG "comedi: pci8164 %s read -> "
-						  "%04X:%04X on axis %s\n",
-				action, data[0], data[1], axisname);
+	dev_dbg(dev->class_dev,
+		"pci8164 %s read -> %04X:%04X on axis %s\n",
+		action, data[0], data[1], axisname);
 }
 
 static int adl_pci8164_insn_read_msts(struct comedi_device *dev,
@@ -170,9 +170,9 @@ static void adl_pci8164_insn_out(struct comedi_device *dev,
 
 	outw(data[0], dev->iobase + axis_reg + offset);
 
-	printk(KERN_DEBUG "comedi: pci8164 %s write -> "
-						"%04X:%04X on axis %s\n",
-				action, data[0], data[1], axisname);
+	dev_dbg(dev->class_dev,
+		"pci8164 %s write -> %04X:%04X on axis %s\n",
+		action, data[0], data[1], axisname);
 
 }
 
Signature · 1 line
1.7.9.5