All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c
@ 2011-10-18 13:12 Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 15/20] Staging: comedi: fix printk issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-18 13:12 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcimdda.c file that fixes up a printk warning
found by the checkpatch.pl tool
Converted printks to dev_printk.
Removed unnecessary printk statement.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcimdda.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdda.c b/drivers/staging/comedi/drivers/cb_pcimdda.c
index 8c981a8..6f8ba18 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdda.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdda.c
@@ -300,7 +300,8 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		return err;
 
 /* Output some info */
-	printk("comedi%d: %s: ", dev->minor, thisboard->name);
+	dev_dbg(dev->hw_dev, "comedi%d: %s: attached\n", dev->minor,
+		thisboard->name);
 
 /*
  * Initialize dev->board_name.  Note that we can use the "thisboard"
@@ -341,7 +342,7 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			break;
 		case DIO_INTERNAL:
 		default:
-			printk("DIO_INTERNAL not implemented yet!\n");
+			dev_err(dev->hw_dev, "DIO_INTERNAL not implemented yet!\n");
 			return -ENXIO;
 			break;
 		}
@@ -351,8 +352,6 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	devpriv->attached_successfully = 1;
 
-	printk("attached\n");
-
 	return 1;
 }
 
@@ -381,8 +380,8 @@ static int detach(struct comedi_device *dev)
 		}
 
 		if (devpriv->attached_successfully && thisboard)
-			printk("comedi%d: %s: detached\n", dev->minor,
-			       thisboard->name);
+			dev_dbg(dev->hw_dev, "comedi%d: %s: detached\n",
+				dev->minor, thisboard->name);
 
 	}
 
@@ -503,7 +502,6 @@ static int probe(struct comedi_device *dev, const struct comedi_devconfig *it)
 		}
 	}
 
-	printk("cb_pcimdda: No supported ComputerBoards/MeasurementComputing "
-	       "card found at the requested position\n");
+	dev_err(dev->hw_dev, "No supported ComputerBoards/MeasurementComputing card found at the requested position\n");
 	return -ENODEV;
 }
-- 
1.7.6.4


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

* [PATCH 15/20] Staging: comedi: fix printk issue in contec_pci_dio.c
  2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-18 13:12 ` Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 16/20] Staging: comedi: fix printk issue in amplc_pci230.c Ravishankar Karkala Mallikarjunayya
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-18 13:12 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the contec_pci_dio.c file that fixes up a printk
warning found by the checkpatch.pl tool
converted printks to dev_printk.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/contec_pci_dio.c |   24 ++++++++--------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/comedi/drivers/contec_pci_dio.c b/drivers/staging/comedi/drivers/contec_pci_dio.c
index 871f109..f2b4cc4 100644
--- a/drivers/staging/comedi/drivers/contec_pci_dio.c
+++ b/drivers/staging/comedi/drivers/contec_pci_dio.c
@@ -106,8 +106,6 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	struct pci_dev *pcidev = NULL;
 	struct comedi_subdevice *s;
 
-	printk("comedi%d: contec: ", dev->minor);
-
 	dev->board_name = thisboard->name;
 
 	if (alloc_private(dev, sizeof(struct contec_private)) < 0)
@@ -128,12 +126,11 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			}
 			devpriv->pci_dev = pcidev;
 			if (comedi_pci_enable(pcidev, "contec_pci_dio")) {
-				printk
-				    ("error enabling PCI device and request regions!\n");
+				dev_err(dev->hw_dev, "error enabling PCI device and request regions!\n");
 				return -EIO;
 			}
 			dev->iobase = pci_resource_start(pcidev, 0);
-			printk(" base addr %lx ", dev->iobase);
+			dev_dbg(dev->hw_dev, "base addr %lx\n", dev->iobase);
 
 			dev->board_ptr = contec_boards + 0;
 
@@ -154,20 +151,17 @@ static int contec_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 			s->range_table = &range_digital;
 			s->insn_bits = contec_do_insn_bits;
 
-			printk("attached\n");
-
 			return 1;
 		}
 	}
 
-	printk("card not present!\n");
+	dev_err(dev->hw_dev, "card not present!\n");
 
 	return -EIO;
 }
 
 static int contec_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: contec: remove\n", dev->minor);
 
 	if (devpriv && devpriv->pci_dev) {
 		if (dev->iobase)
@@ -197,8 +191,8 @@ static int contec_do_insn_bits(struct comedi_device *dev,
 			       struct comedi_insn *insn, unsigned int *data)
 {
 
-	printk("contec_do_insn_bits called\n");
-	printk(" data: %d %d\n", data[0], data[1]);
+	dev_dbg(dev->hw_dev, "contec_do_insn_bits called\n");
+	dev_dbg(dev->hw_dev, "data: %d %d\n", data[0], data[1]);
 
 	if (insn->n != 2)
 		return -EINVAL;
@@ -206,8 +200,8 @@ static int contec_do_insn_bits(struct comedi_device *dev,
 	if (data[0]) {
 		s->state &= ~data[0];
 		s->state |= data[0] & data[1];
-		printk("  out: %d on %lx\n", s->state,
-		       dev->iobase + thisboard->out_offs);
+		dev_dbg(dev->hw_dev, "out: %d on %lx\n", s->state,
+			dev->iobase + thisboard->out_offs);
 		outw(s->state, dev->iobase + thisboard->out_offs);
 	}
 	return 2;
@@ -218,8 +212,8 @@ static int contec_di_insn_bits(struct comedi_device *dev,
 			       struct comedi_insn *insn, unsigned int *data)
 {
 
-	printk("contec_di_insn_bits called\n");
-	printk(" data: %d %d\n", data[0], data[1]);
+	dev_dbg(dev->hw_dev, "contec_di_insn_bits called\n");
+	dev_dbg(dev->hw_dev, "data: %d %d\n", data[0], data[1]);
 
 	if (insn->n != 2)
 		return -EINVAL;
-- 
1.7.6.4


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

* [PATCH 16/20] Staging: comedi: fix printk issue in amplc_pci230.c
  2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 15/20] Staging: comedi: fix printk issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-18 13:12 ` Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 17/20] Staging: comedi: fix printk issue in adv_pci_dio.c Ravishankar Karkala Mallikarjunayya
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-18 13:12 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

Converted printks to dev_printk.
Removed unnecessary printk statement.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/amplc_pci230.c |   34 +++++++++----------------
 1 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/comedi/drivers/amplc_pci230.c b/drivers/staging/comedi/drivers/amplc_pci230.c
index 7edeb11..a21653e 100644
--- a/drivers/staging/comedi/drivers/amplc_pci230.c
+++ b/drivers/staging/comedi/drivers/amplc_pci230.c
@@ -767,9 +767,6 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	struct pci_dev *pci_dev = NULL;
 	int i = 0, irq_hdl, rc;
 
-	printk("comedi%d: amplc_pci230: attach %s %d,%d\n", dev->minor,
-	       thisboard->name, it->options[0], it->options[1]);
-
 	/* Allocate the private structure area using alloc_private().
 	 * Macro defined in comedidev.h - memsets struct fields to 0. */
 	if ((alloc_private(dev, sizeof(struct pci230_private))) < 0)
@@ -842,8 +839,8 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		}
 	}
 	if (!pci_dev) {
-		printk("comedi%d: No %s card found\n", dev->minor,
-		       thisboard->name);
+		dev_err(dev->hw_dev, "comedi%d: No %s card found\n", dev->minor,
+			thisboard->name);
 		return -EIO;
 	}
 	devpriv->pci_dev = pci_dev;
@@ -855,8 +852,8 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	/* Enable PCI device and reserve I/O spaces. */
 	if (comedi_pci_enable(pci_dev, "amplc_pci230") < 0) {
-		printk("comedi%d: failed to enable PCI device "
-		       "and request regions\n", dev->minor);
+		dev_err(dev->hw_dev, "comedi%d: failed to enable PCI device and request regions\n",
+			dev->minor);
 		return -EIO;
 	}
 
@@ -865,8 +862,6 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	iobase1 = pci_resource_start(pci_dev, 2);
 	iobase2 = pci_resource_start(pci_dev, 3);
 
-	printk("comedi%d: %s I/O region 1 0x%04lx I/O region 2 0x%04lx\n",
-	       dev->minor, dev->board_name, iobase1, iobase2);
 
 	devpriv->iobase1 = iobase1;
 	dev->iobase = iobase2;
@@ -881,10 +876,9 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 		devpriv->hwver = inw(dev->iobase + PCI230P_HWVER);
 		if (devpriv->hwver < thisboard->min_hwver) {
-			printk("comedi%d: %s - bad hardware version "
-			       "- got %u, need %u\n", dev->minor,
-			       dev->board_name, devpriv->hwver,
-			       thisboard->min_hwver);
+			dev_err(dev->hw_dev, "comedi%d: %s - bad hardware version - got %u, need %u\n",
+				dev->minor, dev->board_name,
+				devpriv->hwver, thisboard->min_hwver);
 			return -EIO;
 		}
 		if (devpriv->hwver > 0) {
@@ -932,13 +926,12 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	irq_hdl = request_irq(devpriv->pci_dev->irq, pci230_interrupt,
 			      IRQF_SHARED, "amplc_pci230", dev);
 	if (irq_hdl < 0) {
-		printk("comedi%d: unable to register irq, "
-		       "commands will not be available %d\n", dev->minor,
-		       devpriv->pci_dev->irq);
+		dev_dbg(dev->hw_dev, "comedi%d: unable to register irq, commands will not be available %d\n",
+			dev->minor, devpriv->pci_dev->irq);
 	} else {
 		dev->irq = devpriv->pci_dev->irq;
-		printk("comedi%d: registered irq %u\n", dev->minor,
-		       devpriv->pci_dev->irq);
+		dev_dbg(dev->hw_dev, "comedi%d: registered irq %u\n",
+			dev->minor, devpriv->pci_dev->irq);
 	}
 
 	/*
@@ -1001,8 +994,6 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		s->type = COMEDI_SUBD_UNUSED;
 	}
 
-	printk("comedi%d: attached\n", dev->minor);
-
 	return 1;
 }
 
@@ -1016,7 +1007,6 @@ static int pci230_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  */
 static int pci230_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: amplc_pci230: remove\n", dev->minor);
 
 	if (dev->subdevices && thisboard->have_dio)
 		/* Clean up dio subdevice. */
@@ -1205,7 +1195,7 @@ static int pci230_ai_rinsn(struct comedi_device *dev,
 		if (i == TIMEOUT) {
 			/* printk() should be used instead of printk()
 			 * whenever the code can be called from real-time. */
-			printk("timeout\n");
+			dev_err(dev->hw_dev, "timeout\n");
 			return -ETIMEDOUT;
 		}
 
-- 
1.7.6.4


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

* [PATCH 17/20] Staging: comedi: fix printk issue in adv_pci_dio.c
  2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 15/20] Staging: comedi: fix printk issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 16/20] Staging: comedi: fix printk issue in amplc_pci230.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-18 13:12 ` Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 18/20] Staging: comedi: fix printk issue in ni_at_a2150.c Ravishankar Karkala Mallikarjunayya
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-18 13:12 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the contec_pci_dio.c file that fixes up a printk
warning found by the checkpatch.pl tool
converted printks to dev_printk.
Removed unnecessary printk statements.
Fixed NULL initialization issue.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/adv_pci_dio.c |   22 +++++-----------------
 1 files changed, 5 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci_dio.c b/drivers/staging/comedi/drivers/adv_pci_dio.c
index d23799b..ec3abc8 100644
--- a/drivers/staging/comedi/drivers/adv_pci_dio.c
+++ b/drivers/staging/comedi/drivers/adv_pci_dio.c
@@ -422,7 +422,7 @@ struct pci_dio_private {
 	unsigned short IDIFiltrHigh[8];	/*  IDI's filter value high signal */
 };
 
-static struct pci_dio_private *pci_priv = NULL;	/* list of allocated cards */
+static struct pci_dio_private *pci_priv;	/* list of allocated cards */
 
 #define devpriv ((struct pci_dio_private *)dev->private)
 #define this_board ((const struct dio_boardtype *)dev->board_ptr)
@@ -1106,13 +1106,9 @@ static int pci_dio_attach(struct comedi_device *dev,
 	unsigned long iobase;
 	struct pci_dev *pcidev = NULL;
 
-	printk("comedi%d: adv_pci_dio: ", dev->minor);
-
 	ret = alloc_private(dev, sizeof(struct pci_dio_private));
-	if (ret < 0) {
-		printk(", Error: Cann't allocate private memory!\n");
+	if (ret < 0)
 		return -ENOMEM;
-	}
 
 	for_each_pci_dev(pcidev) {
 		/*  loop through cards supported by this driver */
@@ -1140,19 +1136,15 @@ static int pci_dio_attach(struct comedi_device *dev,
 	}
 
 	if (!dev->board_ptr) {
-		printk(", Error: Requested type of the card was not found!\n");
+		dev_err(dev->hw_dev, "Error: Requested type of the card was not found!\n");
 		return -EIO;
 	}
 
 	if (comedi_pci_enable(pcidev, driver_pci_dio.driver_name)) {
-		printk
-		    (", Error: Can't enable PCI device and request regions!\n");
+		dev_err(dev->hw_dev, "Error: Can't enable PCI device and request regions!\n");
 		return -EIO;
 	}
 	iobase = pci_resource_start(pcidev, this_board->main_pci_region);
-	printk(", b:s:f=%d:%d:%d, io=0x%4lx",
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn),
-	       PCI_FUNC(pcidev->devfn), iobase);
 
 	dev->iobase = iobase;
 	dev->board_name = this_board->name;
@@ -1177,12 +1169,8 @@ static int pci_dio_attach(struct comedi_device *dev,
 	}
 
 	ret = alloc_subdevices(dev, n_subdevices);
-	if (ret < 0) {
-		printk(", Error: Cann't allocate subdevice memory!\n");
+	if (ret < 0)
 		return ret;
-	}
-
-	printk(".\n");
 
 	subdev = 0;
 
-- 
1.7.6.4


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

* [PATCH 18/20] Staging: comedi: fix printk issue in ni_at_a2150.c
  2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
                   ` (2 preceding siblings ...)
  2011-10-18 13:12 ` [PATCH 17/20] Staging: comedi: fix printk issue in adv_pci_dio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-18 13:12 ` Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 19/19] Staging: comedi: fix warning issue in das16m1.c Ravishankar Karkala Mallikarjunayya
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-18 13:12 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the ni_at_a2150.c file that fixes up a printk
warning found by the checkpatch.pl tool
converted printks to dev_printk.
Removed unnecessary printk statements.
Fixed brace coding issue.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/ni_at_a2150.c |   43 +++++++++----------------
 1 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c
index 32e675e..54ddb2b 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -211,17 +211,14 @@ static void __exit driver_a2150_cleanup_module(void)
 module_init(driver_a2150_init_module);
 module_exit(driver_a2150_cleanup_module);
 
-#ifdef A2150_DEBUG
-
 static void ni_dump_regs(struct comedi_device *dev)
 {
-	printk("config bits 0x%x\n", devpriv->config_bits);
-	printk("irq dma bits 0x%x\n", devpriv->irq_dma_bits);
-	printk("status bits 0x%x\n", inw(dev->iobase + STATUS_REG));
+	dev_dbg(dev->hw_dev, "config bits 0x%x\n", devpriv->config_bits);
+	dev_dbg(dev->hw_dev, "irq dma bits 0x%x\n", devpriv->irq_dma_bits);
+	dev_dbg(dev->hw_dev, "status bits 0x%x\n",
+		inw(dev->iobase + STATUS_REG));
 }
 
-#endif
-
 /* interrupt service routine */
 static irqreturn_t a2150_interrupt(int irq, void *d)
 {
@@ -347,8 +344,6 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	static const int timeout = 2000;
 	int i;
 
-	printk("comedi%d: %s: io 0x%lx", dev->minor, driver_a2150.driver_name,
-	       iobase);
 	if (irq) {
 		printk(", irq %u", irq);
 	} else {
@@ -359,20 +354,19 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	} else {
 		printk(", no dma");
 	}
-	printk("\n");
 
 	/* allocate and initialize dev->private */
 	if (alloc_private(dev, sizeof(struct a2150_private)) < 0)
 		return -ENOMEM;
 
 	if (iobase == 0) {
-		printk(" io base address required\n");
+		dev_err(dev->hw_dev, "io base address required\n");
 		return -EINVAL;
 	}
 
 	/* check if io addresses are available */
 	if (!request_region(iobase, A2150_SIZE, driver_a2150.driver_name)) {
-		printk(" I/O port conflict\n");
+		dev_err(dev->hw_dev, "I/O port conflict\n");
 		return -EIO;
 	}
 	dev->iobase = iobase;
@@ -381,12 +375,13 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	if (irq) {
 		/*  check that irq is supported */
 		if (irq < 3 || irq == 8 || irq == 13 || irq > 15) {
-			printk(" invalid irq line %u\n", irq);
+			dev_err(dev->hw_dev, "invalid irq line %u\n", irq);
 			return -EINVAL;
 		}
 		if (request_irq(irq, a2150_interrupt, 0,
 				driver_a2150.driver_name, dev)) {
-			printk("unable to allocate irq %u\n", irq);
+			dev_err(dev->hw_dev, "unable to allocate irq %u\n",
+				irq);
 			return -EINVAL;
 		}
 		devpriv->irq_dma_bits |= IRQ_LVL_BITS(irq);
@@ -395,11 +390,12 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	/*  initialize dma */
 	if (dma) {
 		if (dma == 4 || dma > 7) {
-			printk(" invalid dma channel %u\n", dma);
+			dev_err(dev->hw_dev, "invalid dma channel %u\n", dma);
 			return -EINVAL;
 		}
 		if (request_dma(dma, driver_a2150.driver_name)) {
-			printk(" failed to allocate dma channel %u\n", dma);
+			dev_err(dev->hw_dev, "failed to allocate dma channel %u\n",
+				dma);
 			return -EINVAL;
 		}
 		devpriv->dma = dma;
@@ -466,7 +462,6 @@ static int a2150_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 static int a2150_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: %s: remove\n", dev->minor, driver_a2150.driver_name);
 
 	/* only free stuff if it has been allocated by _attach */
 	if (dev->iobase) {
@@ -731,12 +726,9 @@ static int a2150_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	outw(trigger_bits, dev->iobase + TRIGGER_REG);
 
 	/*  start acquisition for soft trigger */
-	if (cmd->start_src == TRIG_NOW) {
+	if (cmd->start_src == TRIG_NOW)
 		outw(0, dev->iobase + FIFO_START_REG);
-	}
-#ifdef A2150_DEBUG
 	ni_dump_regs(dev);
-#endif
 
 	return 0;
 }
@@ -801,9 +793,7 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
 		ni_dump_regs(dev);
 #endif
 		data[n] = inw(dev->iobase + FIFO_DATA_REG);
-#ifdef A2150_DEBUG
-		printk(" data is %i\n", data[n]);
-#endif
+		dev_dbg(dev->hw_dev, "data is %i\n", data[n]);
 		data[n] ^= 0x8000;
 	}
 
@@ -860,11 +850,10 @@ static int a2150_get_timing(struct comedi_device *dev, unsigned int *period,
 	case TRIG_ROUND_NEAREST:
 	default:
 		/*  if least upper bound is better approximation */
-		if (lub - *period < *period - glb) {
+		if (lub - *period < *period - glb)
 			*period = lub;
-		} else {
+		else
 			*period = glb;
-		}
 		break;
 	case TRIG_ROUND_UP:
 		*period = lub;
-- 
1.7.6.4


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

* [PATCH 19/19] Staging: comedi: fix warning issue in das16m1.c
  2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
                   ` (3 preceding siblings ...)
  2011-10-18 13:12 ` [PATCH 18/20] Staging: comedi: fix printk issue in ni_at_a2150.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-18 13:12 ` Ravishankar Karkala Mallikarjunayya
  2011-10-18 13:12 ` [PATCH 20/20] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
  2011-10-19 20:06 ` [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Greg KH
  6 siblings, 0 replies; 8+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-18 13:12 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

Fixed code bracing style and line over 80 character warning issue.
Converted printks to dev_printk.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/das16m1.c |   71 +++++++++++++++--------------
 1 files changed, 37 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das16m1.c b/drivers/staging/comedi/drivers/das16m1.c
index a5ce3b2..19a655a 100644
--- a/drivers/staging/comedi/drivers/das16m1.c
+++ b/drivers/staging/comedi/drivers/das16m1.c
@@ -250,7 +250,9 @@ static int das16m1_cmd_test(struct comedi_device *dev,
 	if (err)
 		return 1;
 
-	/* step 2: make sure trigger sources are unique and mutually compatible */
+	/*
+	 * step 2: make sure trigger sources are unique and mutually compatible
+	 */
 	if (cmd->stop_src != TRIG_COUNT && cmd->stop_src != TRIG_NONE)
 		err++;
 	if (cmd->start_src != TRIG_NOW && cmd->start_src != TRIG_EXT)
@@ -320,7 +322,10 @@ static int das16m1_cmd_test(struct comedi_device *dev,
 	/*  check chanlist against board's peculiarities */
 	if (cmd->chanlist && cmd->chanlist_len > 1) {
 		for (i = 0; i < cmd->chanlist_len; i++) {
-			/*  even/odd channels must go into even/odd queue addresses */
+			/*
+			 * even/odd channels must go into even/odd queue
+			 * addresses
+			 */
 			if ((i % 2) != (CR_CHAN(cmd->chanlist[i]) % 2)) {
 				comedi_error(dev, "bad chanlist:\n"
 					     " even/odd channels must go have even/odd chanlist indices");
@@ -384,20 +389,18 @@ static int das16m1_cmd_exec(struct comedi_device *dev,
 	byte = 0;
 	/* if we are using external start trigger (also board dislikes having
 	 * both start and conversion triggers external simultaneously) */
-	if (cmd->start_src == TRIG_EXT && cmd->convert_src != TRIG_EXT) {
+	if (cmd->start_src == TRIG_EXT && cmd->convert_src != TRIG_EXT)
 		byte |= EXT_TRIG_BIT;
-	}
 	outb(byte, dev->iobase + DAS16M1_CS);
 	/* clear interrupt bit */
 	outb(0, dev->iobase + DAS16M1_CLEAR_INTR);
 
 	/* enable interrupts and internal pacer */
 	devpriv->control_state &= ~PACER_MASK;
-	if (cmd->convert_src == TRIG_TIMER) {
+	if (cmd->convert_src == TRIG_TIMER)
 		devpriv->control_state |= INT_PACER;
-	} else {
+	else
 		devpriv->control_state |= EXT_PACER;
-	}
 	devpriv->control_state |= INTE;
 	outb(devpriv->control_state, dev->iobase + DAS16M1_INTR_CONTROL);
 
@@ -531,9 +534,8 @@ static void munge_sample_array(short *array, unsigned int num_elements)
 {
 	unsigned int i;
 
-	for (i = 0; i < num_elements; i++) {
+	for (i = 0; i < num_elements; i++)
 		array[i] = munge_sample(array[i]);
-	}
 }
 
 static void das16m1_handler(struct comedi_device *dev, unsigned int status)
@@ -556,12 +558,16 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
 	if (devpriv->adc_count == 0 && hw_counter == devpriv->initial_hw_count) {
 		num_samples = 0;
 	} else {
-		/* The calculation of num_samples looks odd, but it uses the following facts.
-		 * 16 bit hardware counter is initialized with value of zero (which really
-		 * means 0x1000).  The counter decrements by one on each conversion
-		 * (when the counter decrements from zero it goes to 0xffff).  num_samples
-		 * is a 16 bit variable, so it will roll over in a similar fashion to the
-		 * hardware counter.  Work it out, and this is what you get. */
+		/*
+		 * The calculation of num_samples looks odd, but it uses the
+		 * following facts. 16 bit hardware counter is initialized
+		 * with value of zero (which really means 0x1000).  The
+		 * counter decrements by one on each conversion (when the
+		 * counter decrements from zero it goes to 0xffff).
+		 * num_samples is a 16 bit variable, so it will roll over
+		 * in a similar fashion to the hardware counter. Work it
+		 * out, and this is what you get.
+		 */
 		num_samples = -hw_counter - devpriv->adc_count;
 	}
 	/*  check if we only need some of the points */
@@ -579,7 +585,8 @@ static void das16m1_handler(struct comedi_device *dev, unsigned int status)
 	devpriv->adc_count += num_samples;
 
 	if (cmd->stop_src == TRIG_COUNT) {
-		if (devpriv->adc_count >= cmd->stop_arg * cmd->chanlist_len) {	/* end of acquisition */
+		/* end of acquisition */
+		if (devpriv->adc_count >= cmd->stop_arg * cmd->chanlist_len) {
 			das16m1_cancel(dev, s);
 			async->events |= COMEDI_CB_EOA;
 		}
@@ -668,25 +675,23 @@ static int das16m1_attach(struct comedi_device *dev,
 
 	iobase = it->options[0];
 
-	printk("comedi%d: das16m1:", dev->minor);
-
 	ret = alloc_private(dev, sizeof(struct das16m1_private_struct));
 	if (ret < 0)
 		return ret;
 
 	dev->board_name = thisboard->name;
 
-	printk(" io 0x%lx-0x%lx 0x%lx-0x%lx",
-	       iobase, iobase + DAS16M1_SIZE,
-	       iobase + DAS16M1_82C55, iobase + DAS16M1_82C55 + DAS16M1_SIZE2);
+	dev_dbg(dev->hw_dev, "io 0x%lx-0x%lx 0x%lx-0x%lx\n",
+		iobase, iobase + DAS16M1_SIZE,
+		iobase + DAS16M1_82C55, iobase + DAS16M1_82C55 + DAS16M1_SIZE2);
 	if (!request_region(iobase, DAS16M1_SIZE, driver_das16m1.driver_name)) {
-		printk(" I/O port conflict\n");
+		dev_err(dev->hw_dev, "I/O port conflict\n");
 		return -EIO;
 	}
 	if (!request_region(iobase + DAS16M1_82C55, DAS16M1_SIZE2,
 			    driver_das16m1.driver_name)) {
 		release_region(iobase, DAS16M1_SIZE);
-		printk(" I/O port conflict\n");
+		dev_err(dev->hw_dev, "I/O port conflict\n");
 		return -EIO;
 	}
 	dev->iobase = iobase;
@@ -696,18 +701,14 @@ static int das16m1_attach(struct comedi_device *dev,
 	/*  make sure it is valid */
 	if (das16m1_irq_bits(irq) >= 0) {
 		ret = request_irq(irq, das16m1_interrupt, 0,
-				  driver_das16m1.driver_name, dev);
-		if (ret < 0) {
-			printk(", irq unavailable\n");
+				driver_das16m1.driver_name, dev);
+		if (ret < 0)
 			return ret;
-		}
 		dev->irq = irq;
-		printk(", irq %u\n", irq);
+		dev_dbg(dev->hw_dev, "irq %u\n", irq);
 	} else if (irq == 0) {
-		printk(", no irq\n");
-	} else {
-		printk(", invalid irq\n"
-		       " valid irqs are 2, 3, 5, 7, 10, 11, 12, or 15\n");
+		dev_err(dev->hw_dev, "invalid irq\n"
+			" valid irqs are 2, 3, 5, 7, 10, 11, 12, or 15\n");
 		return -EINVAL;
 	}
 
@@ -753,7 +754,10 @@ static int das16m1_attach(struct comedi_device *dev,
 	/* 8255 */
 	subdev_8255_init(dev, s, NULL, dev->iobase + DAS16M1_82C55);
 
-	/*  disable upper half of hardware conversion counter so it doesn't mess with us */
+	/*
+	 * disable upper half of hardware conversion counter so it doesn't
+	 * mess with us
+	 */
 	outb(TOTAL_CLEAR, dev->iobase + DAS16M1_8254_FIRST_CNTRL);
 
 	/*  initialize digital output lines */
@@ -771,7 +775,6 @@ static int das16m1_attach(struct comedi_device *dev,
 
 static int das16m1_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: das16m1: remove\n", dev->minor);
 
 /* das16m1_reset(dev); */
 
-- 
1.7.6.4


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

* [PATCH 20/20] Staging: comedi: fix printk issue in cb_pcidas.c
  2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
                   ` (4 preceding siblings ...)
  2011-10-18 13:12 ` [PATCH 19/19] Staging: comedi: fix warning issue in das16m1.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-18 13:12 ` Ravishankar Karkala Mallikarjunayya
  2011-10-19 20:06 ` [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Greg KH
  6 siblings, 0 replies; 8+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-18 13:12 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidas.c file that fixes up a printk
warning found by the checkpatch.pl tool
converted printks to dev_printk.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidas.c |   49 ++++++++++------------------
 1 files changed, 17 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 9dec153..a0ce1ae 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -565,8 +565,6 @@ static int cb_pcidas_attach(struct comedi_device *dev,
 	int index;
 	int i;
 
-	pr_info("comedi%d: cb_pcidas: ", dev->minor);
-
 /*
  * Allocate the private structure area.
  */
@@ -576,7 +574,6 @@ static int cb_pcidas_attach(struct comedi_device *dev,
 /*
  * Probe the device to determine what device in the series it is.
  */
-	printk("\n");
 
 	for_each_pci_dev(pcidev) {
 		/*  is it not a computer boards card? */
@@ -600,20 +597,17 @@ static int cb_pcidas_attach(struct comedi_device *dev,
 		}
 	}
 
-	printk("No supported ComputerBoards/MeasurementComputing card found on "
-	       "requested position\n");
+	dev_err(dev->hw_dev,
+		"No supported ComputerBoards/MeasurementComputing card found on requested position\n");
 	return -EIO;
 
 found:
 
-	printk("Found %s on bus %i, slot %i\n", cb_pcidas_boards[index].name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
-
 	/*
 	 * Enable PCI device and reserve I/O ports.
 	 */
 	if (comedi_pci_enable(pcidev, "cb_pcidas")) {
-		printk(" Failed to enable PCI device and request regions\n");
+		dev_err(dev->hw_dev, "Failed to enable PCI device and request regions\n");
 		return -EIO;
 	}
 	/*
@@ -639,7 +633,8 @@ found:
 	/*  get irq */
 	if (request_irq(devpriv->pci_dev->irq, cb_pcidas_interrupt,
 			IRQF_SHARED, "cb_pcidas", dev)) {
-		printk(" unable to allocate irq %d\n", devpriv->pci_dev->irq);
+		dev_err(dev->hw_dev, "unable to allocate irq %d\n",
+			devpriv->pci_dev->irq);
 		return -EINVAL;
 	}
 	dev->irq = devpriv->pci_dev->irq;
@@ -768,17 +763,13 @@ found:
  */
 static int cb_pcidas_detach(struct comedi_device *dev)
 {
-	pr_info("comedi%d: cb_pcidas: remove\n", dev->minor);
-
 	if (devpriv) {
 		if (devpriv->s5933_config) {
 			/*  disable and clear interrupts on amcc s5933 */
 			outl(INTCSR_INBOX_INTR_STATUS,
 			     devpriv->s5933_config + AMCC_OP_REG_INTCSR);
-#ifdef CB_PCIDAS_DEBUG
-			printk("detaching, incsr is 0x%x\n",
-			       inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR));
-#endif
+			dev_dbg(dev->hw_dev, "detaching, incsr is 0x%x\n",
+				inl(devpriv->s5933_config + AMCC_OP_REG_INTCSR));
 		}
 	}
 	if (dev->irq)
@@ -858,7 +849,8 @@ static int ai_config_calibration_source(struct comedi_device *dev,
 	unsigned int source = data[1];
 
 	if (source >= num_calibration_sources) {
-		printk("invalid calibration source: %i\n", source);
+		dev_err(dev->hw_dev, "invalid calibration source: %i\n",
+			source);
 		return -EINVAL;
 	}
 
@@ -1278,9 +1270,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 		bits |= PACER_INT;
 	outw(bits, devpriv->control_status + ADCMUX_CONT);
 
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: sent 0x%x to adcmux control\n", bits);
-#endif
+	dev_dbg(dev->hw_dev, "comedi: sent 0x%x to adcmux control\n", bits);
 
 	/*  load counters */
 	if (cmd->convert_src == TRIG_TIMER)
@@ -1305,9 +1295,8 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 	} else {
 		devpriv->adc_fifo_bits |= INT_FHF;	/* interrupt fifo half full */
 	}
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: adc_fifo_bits are 0x%x\n", devpriv->adc_fifo_bits);
-#endif
+	dev_dbg(dev->hw_dev, "comedi: adc_fifo_bits are 0x%x\n",
+		devpriv->adc_fifo_bits);
 	/*  enable (and clear) interrupts */
 	outw(devpriv->adc_fifo_bits | EOAI | INT | LADFUL,
 	     devpriv->control_status + INT_ADCFIFO);
@@ -1331,9 +1320,7 @@ static int cb_pcidas_ai_cmd(struct comedi_device *dev,
 	if (cmd->convert_src == TRIG_NOW && cmd->chanlist_len > 1)
 		bits |= BURSTE;
 	outw(bits, devpriv->control_status + TRIG_CONTSTAT);
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: sent 0x%x to trig control\n", bits);
-#endif
+	dev_dbg(dev->hw_dev, "comedi: sent 0x%x to trig control\n", bits);
 
 	return 0;
 }
@@ -1548,9 +1535,8 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
 	/*  enable dac half-full and empty interrupts */
 	spin_lock_irqsave(&dev->spinlock, flags);
 	devpriv->adc_fifo_bits |= DAEMIE | DAHFIE;
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: adc_fifo_bits are 0x%x\n", devpriv->adc_fifo_bits);
-#endif
+	dev_dbg(dev->hw_dev, "comedi: adc_fifo_bits are 0x%x\n",
+		devpriv->adc_fifo_bits);
 	/*  enable and clear interrupts */
 	outw(devpriv->adc_fifo_bits | DAEMI | DAHFI,
 	     devpriv->control_status + INT_ADCFIFO);
@@ -1558,9 +1544,8 @@ static int cb_pcidas_ao_inttrig(struct comedi_device *dev,
 	/*  start dac */
 	devpriv->ao_control_bits |= DAC_START | DACEN | DAC_EMPTY;
 	outw(devpriv->ao_control_bits, devpriv->control_status + DAC_CSR);
-#ifdef CB_PCIDAS_DEBUG
-	printk("comedi: sent 0x%x to dac control\n", devpriv->ao_control_bits);
-#endif
+	dev_dbg(dev->hw_dev, "comedi: sent 0x%x to dac control\n",
+		devpriv->ao_control_bits);
 	spin_unlock_irqrestore(&dev->spinlock, flags);
 
 	async->inttrig = NULL;
-- 
1.7.6.4


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

* Re: [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c
  2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
                   ` (5 preceding siblings ...)
  2011-10-18 13:12 ` [PATCH 20/20] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-19 20:06 ` Greg KH
  6 siblings, 0 replies; 8+ messages in thread
From: Greg KH @ 2011-10-19 20:06 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On Tue, Oct 18, 2011 at 06:42:09PM +0530, Ravishankar Karkala Mallikarjunayya wrote:

14/20?  I only got the 14 - 20 patches of this series, what happened to
the first 13?

I've dropped all of these now, please start numbering them at 1 :)

greg k-h

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

end of thread, other threads:[~2011-10-19 20:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-18 13:12 [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
2011-10-18 13:12 ` [PATCH 15/20] Staging: comedi: fix printk issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
2011-10-18 13:12 ` [PATCH 16/20] Staging: comedi: fix printk issue in amplc_pci230.c Ravishankar Karkala Mallikarjunayya
2011-10-18 13:12 ` [PATCH 17/20] Staging: comedi: fix printk issue in adv_pci_dio.c Ravishankar Karkala Mallikarjunayya
2011-10-18 13:12 ` [PATCH 18/20] Staging: comedi: fix printk issue in ni_at_a2150.c Ravishankar Karkala Mallikarjunayya
2011-10-18 13:12 ` [PATCH 19/19] Staging: comedi: fix warning issue in das16m1.c Ravishankar Karkala Mallikarjunayya
2011-10-18 13:12 ` [PATCH 20/20] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
2011-10-19 20:06 ` [PATCH 14/20] Staging: comedi: fix printk issue in cb_pcimdda.c Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.