linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c
@ 2011-10-20  6:18 Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 02/24] Staging: comedi: fix printk coding style issue in Ravishankar Karkala Mallikarjunayya
                   ` (23 more replies)
  0 siblings, 24 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the das6402.c file that fixes up a printk warning
found by the checkpatch.pl tool.
Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted printks to dev_printk.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/das6402.c |   36 ++++++++++-------------------
 1 files changed, 13 insertions(+), 23 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das6402.c b/drivers/staging/comedi/drivers/das6402.c
index 6328f52..b6b235d 100644
--- a/drivers/staging/comedi/drivers/das6402.c
+++ b/drivers/staging/comedi/drivers/das6402.c
@@ -38,6 +38,8 @@ Devices: [Keithley Metrabyte] DAS6402 (das6402)
 This driver has suffered bitrot.
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/interrupt.h>
 #include "../comedidev.h"
 
@@ -171,24 +173,20 @@ static irqreturn_t intr_handler(int irq, void *d)
 	struct comedi_subdevice *s = dev->subdevices;
 
 	if (!dev->attached || devpriv->das6402_ignoreirq) {
-		printk("das6402: BUG: spurious interrupt\n");
+		dev_warn(dev->hw_dev, "BUG: spurious interrupt\n");
 		return IRQ_HANDLED;
 	}
-#ifdef DEBUG
-	printk("das6402: interrupt! das6402_irqcount=%i\n",
-	       devpriv->das6402_irqcount);
-	printk("das6402: iobase+2=%i\n", inw_p(dev->iobase + 2));
-#endif
+	dev_dbg(dev->hw_dev, "interrupt! das6402_irqcount=%i\n",
+		devpriv->das6402_irqcount);
+	dev_dbg(dev->hw_dev, "iobase+2=%i\n", inw_p(dev->iobase + 2));
 
 	das6402_ai_fifo_dregs(dev, s);
 
 	if (s->async->buf_write_count >= devpriv->ai_bytes_to_read) {
 		outw_p(SCANL, dev->iobase + 2);	/* clears the fifo */
 		outb(0x07, dev->iobase + 8);	/* clears all flip-flops */
-#ifdef DEBUG
-		printk("das6402: Got %i samples\n\n",
-		       devpriv->das6402_wordsread - diff);
-#endif
+		dev_dbg(dev->hw_dev, "Got %i samples\n\n",
+			devpriv->das6402_wordsread - diff);
 		s->async->events |= COMEDI_CB_EOA;
 		comedi_event(dev, s);
 	}
@@ -228,9 +226,7 @@ static int das6402_ai_cancel(struct comedi_device *dev,
 	 */
 
 	devpriv->das6402_ignoreirq = 1;
-#ifdef DEBUG
-	printk("das6402: Stopping acquisition\n");
-#endif
+	dev_dbg(dev->hw_dev, "Stopping acquisition\n");
 	devpriv->das6402_ignoreirq = 1;
 	outb_p(0x02, dev->iobase + 10);	/* disable external trigging */
 	outw_p(SCANL, dev->iobase + 2);	/* resets the card fifo */
@@ -247,9 +243,7 @@ static int das6402_ai_mode2(struct comedi_device *dev,
 {
 	devpriv->das6402_ignoreirq = 1;
 
-#ifdef DEBUG
-	printk("das6402: Starting acquisition\n");
-#endif
+	dev_dbg(dev->hw_dev, "Starting acquisition\n");
 	outb_p(0x03, dev->iobase + 10);	/* enable external trigging */
 	outw_p(SCANL, dev->iobase + 2);	/* resets the card fifo */
 	outb_p(IRQ | CONVSRC | BURSTEN | INTE, dev->iobase + 9);
@@ -329,10 +323,8 @@ static int das6402_attach(struct comedi_device *dev,
 	if (iobase == 0)
 		iobase = 0x300;
 
-	printk("comedi%d: das6402: 0x%04lx", dev->minor, iobase);
-
 	if (!request_region(iobase, DAS6402_SIZE, "das6402")) {
-		printk(" I/O port conflict\n");
+		dev_err(dev->hw_dev, "I/O port conflict\n");
 		return -EIO;
 	}
 	dev->iobase = iobase;
@@ -340,12 +332,10 @@ static int das6402_attach(struct comedi_device *dev,
 	/* should do a probe here */
 
 	irq = it->options[0];
-	printk(" ( irq = %u )", irq);
+	dev_dbg(dev->hw_dev, "( irq = %u )\n", irq);
 	ret = request_irq(irq, intr_handler, 0, "das6402", dev);
-	if (ret < 0) {
-		printk("irq conflict\n");
+	if (ret < 0)
 		return ret;
-	}
 	dev->irq = irq;
 
 	ret = alloc_private(dev, sizeof(struct das6402_private));
-- 
1.7.6.4


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

* [PATCH 02/24] Staging: comedi: fix printk coding style issue in
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-23  8:19   ` Greg KH
  2011-10-20  6:18 ` [PATCH 03/24] Staging: comedi: fix warning issue in pcl818.c Ravishankar Karkala Mallikarjunayya
                   ` (22 subsequent siblings)
  23 siblings, 1 reply; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the serial2002.c file that fixes up a printk warning
found by the checkpatch.pl tool.
Converted printks to pr_<level>.

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

diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
index ade2202..6bd07ec 100644
--- a/drivers/staging/comedi/drivers/serial2002.c
+++ b/drivers/staging/comedi/drivers/serial2002.c
@@ -431,7 +431,8 @@ static int serial_2002_open(struct comedi_device *dev)
 		}
 
 		tty_setspeed(devpriv->tty, devpriv->speed);
-		poll_channel(devpriv->tty, 31);	/*  Start reading configuration */
+		/* Start reading configuration */
+		poll_channel(devpriv->tty, 31);
 		while (1) {
 			struct serial_data data;
 
@@ -824,7 +825,7 @@ static int serial2002_attach(struct comedi_device *dev,
 {
 	struct comedi_subdevice *s;
 
-	printk("comedi%d: serial2002: ", dev->minor);
+	pr_debug("comedi%d: serial2002: attached\n", dev->minor);
 	dev->board_name = thisboard->name;
 	if (alloc_private(dev, sizeof(struct serial2002_private)) < 0)
 		return -ENOMEM;
@@ -832,7 +833,7 @@ static int serial2002_attach(struct comedi_device *dev,
 	dev->close = serial_2002_close;
 	devpriv->port = it->options[0];
 	devpriv->speed = it->options[1];
-	printk("/dev/ttyS%d @ %d\n", devpriv->port, devpriv->speed);
+	pr_debug("/dev/ttyS%d @ %d\n", devpriv->port, devpriv->speed);
 
 	if (alloc_subdevices(dev, 5) < 0)
 		return -ENOMEM;
@@ -891,7 +892,7 @@ static int serial2002_detach(struct comedi_device *dev)
 	struct comedi_subdevice *s;
 	int i;
 
-	printk("comedi%d: serial2002: remove\n", dev->minor);
+	pr_debug("comedi%d: serial2002: remove\n", dev->minor);
 	for (i = 0; i < 5; i++) {
 		s = &dev->subdevices[i];
 		kfree(s->maxdata_list);
-- 
1.7.6.4


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

* [PATCH 03/24] Staging: comedi: fix warning issue in pcl818.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 02/24] Staging: comedi: fix printk coding style issue in Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-23  8:20   ` Greg KH
  2011-10-20  6:18 ` [PATCH 04/24] Staging: comedi: fix code cleanup issue in pcmuio.c Ravishankar Karkala Mallikarjunayya
                   ` (21 subsequent siblings)
  23 siblings, 1 reply; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the pcl818.c file that fixes up a warning
found by the checkpatch.pl tool.
Fix brace coding style and NULL initilization issue.
Converted printks to dev_printk.
Removed unnecessary printk statements.

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

diff --git a/drivers/staging/comedi/drivers/pcl818.c b/drivers/staging/comedi/drivers/pcl818.c
index b45a9bd..65eff4f 100644
--- a/drivers/staging/comedi/drivers/pcl818.c
+++ b/drivers/staging/comedi/drivers/pcl818.c
@@ -252,8 +252,8 @@ static int pcl818_attach(struct comedi_device *dev,
 static int pcl818_detach(struct comedi_device *dev);
 
 #ifdef unused
-static int RTC_lock = 0;	/* RTC lock */
-static int RTC_timer_lock = 0;	/* RTC int lock */
+static int RTC_lock;	/* RTC lock */
+static int RTC_timer_lock;	/* RTC int lock */
 #endif
 
 struct pcl818_board {
@@ -463,10 +463,8 @@ static int pcl818_ao_insn_read(struct comedi_device *dev,
 	int n;
 	int chan = CR_CHAN(insn->chanspec);
 
-	for (n = 0; n < insn->n; n++) {
+	for (n = 0; n < insn->n; n++)
 		data[n] = devpriv->ao_readback[chan];
-	}
-
 	return n;
 }
 
@@ -571,9 +569,8 @@ conv_finish:
 		return IRQ_HANDLED;
 	}
 	devpriv->act_chanlist_pos++;
-	if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len) {
+	if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len)
 		devpriv->act_chanlist_pos = 0;
-	}
 	s->async->cur_chan++;
 	if (s->async->cur_chan >= devpriv->ai_n_chan) {
 		/*  printk("E"); */
@@ -620,7 +617,7 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d)
 		release_dma_lock(flags);
 		enable_dma(devpriv->dma);
 	}
-	printk("comedi: A/D mode1/3 IRQ \n");
+	printk("comedi: A/D mode1/3 IRQ\n");
 
 	devpriv->dma_runs_to_end--;
 	outb(0, dev->iobase + PCL818_CLRINT);	/* clear INT request */
@@ -645,9 +642,8 @@ static irqreturn_t interrupt_pcl818_ai_mode13_dma(int irq, void *d)
 		comedi_buf_put(s->async, ptr[bufptr++] >> 4);	/*  get one sample */
 
 		devpriv->act_chanlist_pos++;
-		if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len) {
+		if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len)
 			devpriv->act_chanlist_pos = 0;
-		}
 		s->async->cur_chan++;
 		if (s->async->cur_chan >= devpriv->ai_n_chan) {
 			s->async->cur_chan = 0;
@@ -805,11 +801,10 @@ static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d)
 		return IRQ_HANDLED;
 	}
 
-	if (lo & 2) {
+	if (lo & 2)
 		len = 512;
-	} else {
+	else
 		len = 0;
-	}
 
 	for (i = 0; i < len; i++) {
 		lo = inb(dev->iobase + PCL818_FI_DATALO);
@@ -827,9 +822,8 @@ static irqreturn_t interrupt_pcl818_ai_mode13_fifo(int irq, void *d)
 		comedi_buf_put(s->async, (lo >> 4) | (inb(dev->iobase + PCL818_FI_DATAHI) << 4));	/*  get one sample */
 
 		devpriv->act_chanlist_pos++;
-		if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len) {
+		if (devpriv->act_chanlist_pos >= devpriv->act_chanlist_len)
 			devpriv->act_chanlist_pos = 0;
-		}
 		s->async->cur_chan++;
 		if (s->async->cur_chan >= devpriv->ai_n_chan) {
 			s->async->cur_chan = 0;
@@ -1309,11 +1303,9 @@ static void setup_channel_list(struct comedi_device *dev,
 */
 static int check_single_ended(unsigned int port)
 {
-	if (inb(port + PCL818_STATUS) & 0x20) {
+	if (inb(port + PCL818_STATUS) & 0x20)
 		return 1;
-	} else {
-		return 0;
-	}
+	return 0;
 }
 
 /*
@@ -1352,9 +1344,8 @@ static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
 	if (!cmd->stop_src || tmp != cmd->stop_src)
 		err++;
 
-	if (err) {
+	if (err)
 		return 1;
-	}
 
 	/* step 2: make sure trigger sources are unique and mutually compatible */
 
@@ -1377,9 +1368,8 @@ static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
 	if (cmd->stop_src != TRIG_NONE && cmd->stop_src != TRIG_COUNT)
 		err++;
 
-	if (err) {
+	if (err)
 		return 2;
-	}
 
 	/* step 3: make sure arguments are trivially compatible */
 
@@ -1421,9 +1411,8 @@ static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
 		}
 	}
 
-	if (err) {
+	if (err)
 		return 3;
-	}
 
 	/* step 4: fix up any arguments */
 
@@ -1438,9 +1427,8 @@ static int ai_cmdtest(struct comedi_device *dev, struct comedi_subdevice *s,
 			err++;
 	}
 
-	if (err) {
+	if (err)
 		return 4;
-	}
 
 	/* step 5: complain about special chanlist considerations */
 
@@ -1461,7 +1449,7 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	struct comedi_cmd *cmd = &s->async->cmd;
 	int retval;
 
-	printk("pcl818_ai_cmd()\n");
+	dev_dbg(dev->hw_dev, "pcl818_ai_cmd()\n");
 	devpriv->ai_n_chan = cmd->chanlist_len;
 	devpriv->ai_chanlist = cmd->chanlist;
 	devpriv->ai_flags = cmd->flags;
@@ -1470,17 +1458,16 @@ static int ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	devpriv->ai_timer1 = 0;
 	devpriv->ai_timer2 = 0;
 
-	if (cmd->stop_src == TRIG_COUNT) {
+	if (cmd->stop_src == TRIG_COUNT)
 		devpriv->ai_scans = cmd->stop_arg;
-	} else {
+	else
 		devpriv->ai_scans = 0;
-	}
 
 	if (cmd->scan_begin_src == TRIG_FOLLOW) {	/*  mode 1, 3 */
 		if (cmd->convert_src == TRIG_TIMER) {	/*  mode 1 */
 			devpriv->ai_timer1 = cmd->convert_arg;
 			retval = pcl818_ai_cmd_mode(1, dev, s);
-			printk("pcl818_ai_cmd() end\n");
+			dev_dbg(dev->hw_dev, "pcl818_ai_cmd() end\n");
 			return retval;
 		}
 		if (cmd->convert_src == TRIG_EXT) {	/*  mode 3 */
@@ -1499,7 +1486,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev,
 			    struct comedi_subdevice *s)
 {
 	if (devpriv->irq_blocked > 0) {
-		printk("pcl818_ai_cancel()\n");
+		dev_dbg(dev->hw_dev, "pcl818_ai_cancel()\n");
 		devpriv->irq_was_now_closed = 1;
 
 		switch (devpriv->ai_mode) {
@@ -1549,7 +1536,7 @@ static int pcl818_ai_cancel(struct comedi_device *dev,
 	}
 
 end:
-	printk("pcl818_ai_cancel() end\n");
+	dev_dbg(dev->hw_dev, "pcl818_ai_cancel() end\n");
 	return 0;
 }
 
@@ -1633,11 +1620,10 @@ static int set_rtc_irq_bit(unsigned char bit)
 	save_flags(flags);
 	cli();
 	val = CMOS_READ(RTC_CONTROL);
-	if (bit) {
+	if (bit)
 		val |= RTC_PIE;
-	} else {
+	else
 		val &= ~RTC_PIE;
-	}
 	CMOS_WRITE(val, RTC_CONTROL);
 	CMOS_READ(RTC_INTR_FLAGS);
 	restore_flags(flags);
@@ -1754,22 +1740,20 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	/* claim our I/O space */
 	iobase = it->options[0];
-	printk("comedi%d: pcl818:  board=%s, ioport=0x%03lx",
-	       dev->minor, this_board->name, iobase);
 	devpriv->io_range = this_board->io_range;
 	if ((this_board->fifo) && (it->options[2] == -1)) {	/*  we've board with FIFO and we want to use FIFO */
 		devpriv->io_range = PCLx1xFIFO_RANGE;
 		devpriv->usefifo = 1;
 	}
 	if (!request_region(iobase, devpriv->io_range, "pcl818")) {
-		printk("I/O port conflict\n");
+		dev_err(dev->hw_dev, "I/O port conflict\n");
 		return -EIO;
 	}
 
 	dev->iobase = iobase;
 
 	if (pcl818_check(iobase)) {
-		printk(", I can't detect board. FAIL!\n");
+		dev_err(dev->hw_dev, "I can't detect board. FAIL!\n");
 		return -EIO;
 	}
 
@@ -1781,31 +1765,27 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		irq = it->options[1];
 		if (irq) {	/* we want to use IRQ */
 			if (((1 << irq) & this_board->IRQbits) == 0) {
-				printk
-				    (", IRQ %u is out of allowed range, DISABLING IT",
-				     irq);
+				dev_dbg(dev->hw_dev, "IRQ %u is out of allowed range, DISABLING IT\n",
+					irq);
 				irq = 0;	/* Bad IRQ */
 			} else {
 				if (request_irq
 				    (irq, interrupt_pcl818, 0, "pcl818", dev)) {
-					printk
-					    (", unable to allocate IRQ %u, DISABLING IT",
-					     irq);
+					dev_dbg(dev->hw_dev, "unable to allocate IRQ %u, DISABLING IT\n",
+						irq);
 					irq = 0;	/* Can't use IRQ */
 				} else {
-					printk(", irq=%u", irq);
+					dev_dbg(dev->hw_dev, "irq=%u\n", irq);
 				}
 			}
 		}
 	}
 
 	dev->irq = irq;
-	if (irq) {
-		devpriv->irq_free = 1;
-	} /* 1=we have allocated irq */
-	else {
+	if (irq)
+		devpriv->irq_free = 1;  /* 1=we have allocated irq */
+	else
 		devpriv->irq_free = 0;
-	}
 	devpriv->irq_blocked = 0;	/* number of subdevice which use IRQ */
 	devpriv->ai_mode = 0;	/* mode of irq */
 
@@ -1825,7 +1805,7 @@ static int pcl818_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 				 "pcl818 DMA (RTC)", dev)) {
 			devpriv->dma_rtc = 1;
 			devpriv->rtc_irq = RTC_IRQ;
-			printk(", dma_irq=%u", devpriv->rtc_irq);
+			dev_dbg(dev->hw_dev, "dma_irq=%u\n", devpriv->rtc_irq);
 		} else {
 			RTC_lock--;
 			if (RTC_lock == 0) {
@@ -1850,20 +1830,20 @@ no_rtc:
 		if (dma < 1)
 			goto no_dma;	/* DMA disabled */
 		if (((1 << dma) & this_board->DMAbits) == 0) {
-			printk(", DMA is out of allowed range, FAIL!\n");
+			dev_err(dev->hw_dev, "DMA is out of allowed range, FAIL!\n");
 			return -EINVAL;	/* Bad DMA */
 		}
 		ret = request_dma(dma, "pcl818");
 		if (ret) {
-			printk(", unable to allocate DMA %u, FAIL!\n", dma);
+			dev_warn(dev->hw_dev, "unable to allocate DMA %u, FAIL!\n", dma);
 			return -EBUSY;	/* DMA isn't free */
 		}
 		devpriv->dma = dma;
-		printk(", dma=%u", dma);
+		dev_dbg(dev->hw_dev, "dma=%u\n", dma);
 		pages = 2;	/* we need 16KB */
 		devpriv->dmabuf[0] = __get_dma_pages(GFP_KERNEL, pages);
 		if (!devpriv->dmabuf[0]) {
-			printk(", unable to allocate DMA buffer, FAIL!\n");
+			dev_warn(dev->hw_dev, "unable to allocate DMA buffer, FAIL!\n");
 			/* maybe experiment with try_to_free_pages() will help .... */
 			return -EBUSY;	/* no buffer :-( */
 		}
@@ -1874,8 +1854,7 @@ no_rtc:
 		if (devpriv->dma_rtc == 0) {	/*  we must do duble buff :-( */
 			devpriv->dmabuf[1] = __get_dma_pages(GFP_KERNEL, pages);
 			if (!devpriv->dmabuf[1]) {
-				printk
-				    (", unable to allocate DMA buffer, FAIL!\n");
+				dev_warn(dev->hw_dev, "unable to allocate DMA buffer, FAIL!\n");
 				return -EBUSY;
 			}
 			devpriv->dmapages[1] = pages;
@@ -1901,11 +1880,11 @@ no_dma:
 		if (check_single_ended(dev->iobase)) {
 			s->n_chan = this_board->n_aichan_se;
 			s->subdev_flags |= SDF_COMMON | SDF_GROUND;
-			printk(", %dchans S.E. DAC", s->n_chan);
+			dev_dbg(dev->hw_dev, "%dchans S.E. DAC", s->n_chan);
 		} else {
 			s->n_chan = this_board->n_aichan_diff;
 			s->subdev_flags |= SDF_DIFF;
-			printk(", %dchans DIFF DAC", s->n_chan);
+			dev_dbg(dev->hw_dev, "%dchans DIFF DAC", s->n_chan);
 		}
 		s->maxdata = this_board->ai_maxdata;
 		s->len_chanlist = s->n_chan;
@@ -2017,11 +1996,10 @@ no_dma:
 	}
 
 	/* select 1/10MHz oscilator */
-	if ((it->options[3] == 0) || (it->options[3] == 10)) {
+	if ((it->options[3] == 0) || (it->options[3] == 10))
 		devpriv->i8253_osc_base = 100;
-	} else {
+	else
 		devpriv->i8253_osc_base = 1000;
-	}
 
 	/* max sampling speed */
 	devpriv->ns_min = this_board->ns_min;
@@ -2033,8 +2011,6 @@ no_dma:
 
 	pcl818_reset(dev);
 
-	printk("\n");
-
 	return 0;
 }
 
-- 
1.7.6.4


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

* [PATCH 04/24] Staging: comedi: fix code cleanup issue in pcmuio.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 02/24] Staging: comedi: fix printk coding style issue in Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 03/24] Staging: comedi: fix warning issue in pcl818.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 05/24] Staging: comedi: fix printk issue in c6xdigio.c Ravishankar Karkala Mallikarjunayya
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the pcmuio.c file that fixes up a brace coding style
and printk warning found by the checkpatch.pl tool.
Converted printk to pr_<levels>.
Removed unnecessary printk statements.

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

diff --git a/drivers/staging/comedi/drivers/pcmuio.c b/drivers/staging/comedi/drivers/pcmuio.c
index b2c2c89..adf27de 100644
--- a/drivers/staging/comedi/drivers/pcmuio.c
+++ b/drivers/staging/comedi/drivers/pcmuio.c
@@ -295,15 +295,12 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	irq[0] = it->options[1];
 	irq[1] = it->options[2];
 
-	printk("comedi%d: %s: io: %lx ", dev->minor, driver.driver_name,
-	       iobase);
-
 	dev->iobase = iobase;
 
 	if (!iobase || !request_region(iobase,
 				       thisboard->num_asics * ASIC_IOSIZE,
 				       driver.driver_name)) {
-		printk("I/O port conflict\n");
+		pr_err("I/O port conflict\n");
 		return -EIO;
 	}
 
@@ -317,10 +314,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  * Allocate the private structure area.  alloc_private() is a
  * convenient macro defined in comedidev.h.
  */
-	if (alloc_private(dev, sizeof(struct pcmuio_private)) < 0) {
-		printk("cannot allocate private data structure\n");
+	if (alloc_private(dev, sizeof(struct pcmuio_private)) < 0)
 		return -ENOMEM;
-	}
 
 	for (asic = 0; asic < MAX_ASICS; ++asic) {
 		devpriv->asics[asic].num = asic;
@@ -336,10 +331,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	devpriv->sprivs =
 	    kcalloc(n_subdevs, sizeof(struct pcmuio_subdev_private),
 		    GFP_KERNEL);
-	if (!devpriv->sprivs) {
-		printk("cannot allocate subdevice private data structures\n");
+	if (!devpriv->sprivs)
 		return -ENOMEM;
-	}
 	/*
 	 * Allocate the subdevice structures.  alloc_subdevice() is a
 	 * convenient macro defined in comedidev.h.
@@ -347,11 +340,8 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	 * Allocate 2 subdevs (32 + 16 DIO lines) or 3 32 DIO subdevs for the
 	 * 96-channel version of the board.
 	 */
-	if (alloc_subdevices(dev, n_subdevs) < 0) {
-		printk("cannot allocate subdevice data structures\n");
+	if (alloc_subdevices(dev, n_subdevs) < 0)
 		return -ENOMEM;
-	}
-
 	port = 0;
 	asic = 0;
 	for (sdev_no = 0; sdev_no < (int)dev->n_subdevices; ++sdev_no) {
@@ -436,15 +426,13 @@ static int pcmuio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 				   irqs.. */
 
 	if (irq[0]) {
-		printk("irq: %u ", irq[0]);
+		pr_debug("irq: %u\n", irq[0]);
 		if (irq[1] && thisboard->num_asics == 2)
-			printk("second ASIC irq: %u ", irq[1]);
+			pr_debug("second ASIC irq: %u\n", irq[1]);
 	} else {
-		printk("(IRQ mode disabled) ");
+		pr_debug("(IRQ mode disabled)\n");
 	}
 
-	printk("attached\n");
-
 	return 1;
 }
 
@@ -460,7 +448,6 @@ static int pcmuio_detach(struct comedi_device *dev)
 {
 	int i;
 
-	printk("comedi%d: %s: remove\n", dev->minor, driver.driver_name);
 	if (dev->iobase)
 		release_region(dev->iobase, ASIC_IOSIZE * thisboard->num_asics);
 
@@ -499,16 +486,12 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
 	/* The insn data is a mask in data[0] and the new data
 	 * in data[1], each channel cooresponding to a bit. */
 
-#ifdef DAMMIT_ITS_BROKEN
-	/* DEBUG */
-	printk("write mask: %08x  data: %08x\n", data[0], data[1]);
-#endif
-
+	pr_debug("write mask: %08x  data: %08x\n", data[0], data[1]);
 	s->state = 0;
 
 	for (byte_no = 0; byte_no < s->n_chan / CHANS_PER_PORT; ++byte_no) {
 		/* address of 8-bit port */
-		unsigned long ioaddr = subpriv->iobases[byte_no],
+		int ioaddr = subpriv->iobases[byte_no],
 		    /* bit offset of port in 32-bit doubleword */
 		    offset = byte_no * 8;
 		/* this 8-bit port's data */
@@ -520,13 +503,9 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
 
 		byte = inb(ioaddr);	/* read all 8-bits for this port */
 
-#ifdef DAMMIT_ITS_BROKEN
-		/* DEBUG */
-		printk
-		    ("byte %d wmb %02x db %02x offset %02d io %04x, data_in %02x ",
-		     byte_no, (unsigned)write_mask_byte, (unsigned)data_byte,
-		     offset, ioaddr, (unsigned)byte);
-#endif
+		pr_debug("byte %d wmb %02x db %02x offset %02d io %04d, data_in %02x\n",
+			 byte_no, (unsigned)write_mask_byte, (unsigned)data_byte,
+			 offset, ioaddr, (unsigned)byte);
 
 		if (write_mask_byte) {
 			/* this byte has some write_bits -- so set the output lines */
@@ -535,10 +514,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
 			/* Write out the new digital output state */
 			outb(byte, ioaddr);
 		}
-#ifdef DAMMIT_ITS_BROKEN
-		/* DEBUG */
-		printk("data_out_byte %02x\n", (unsigned)byte);
-#endif
+		pr_debug("data_out_byte %02x\n", (unsigned)byte);
 		/* save the digital input lines for this byte.. */
 		s->state |= ((unsigned int)byte) << offset;
 	}
@@ -546,11 +522,7 @@ static int pcmuio_dio_insn_bits(struct comedi_device *dev,
 	/* now return the DIO lines to data[1] - note they came inverted! */
 	data[1] = ~s->state;
 
-#ifdef DAMMIT_ITS_BROKEN
-	/* DEBUG */
-	printk("s->state %08x data_out %08x\n", s->state, data[1]);
-#endif
-
+	pr_debug("s->state %08x data_out %08x\n", s->state, data[1]);
 	return 2;
 }
 
@@ -951,15 +923,12 @@ pcmuio_inttrig_start_intr(struct comedi_device *dev, struct comedi_subdevice *s,
 
 	spin_lock_irqsave(&subpriv->intr.spinlock, flags);
 	s->async->inttrig = 0;
-	if (subpriv->intr.active) {
+	if (subpriv->intr.active)
 		event = pcmuio_start_intr(dev, s);
-	}
 	spin_unlock_irqrestore(&subpriv->intr.spinlock, flags);
 
-	if (event) {
+	if (event)
 		comedi_event(dev, s);
-	}
-
 	return 1;
 }
 
@@ -1000,10 +969,8 @@ static int pcmuio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	}
 	spin_unlock_irqrestore(&subpriv->intr.spinlock, flags);
 
-	if (event) {
+	if (event)
 		comedi_event(dev, s);
-	}
-
 	return 0;
 }
 
-- 
1.7.6.4


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

* [PATCH 05/24] Staging: comedi: fix printk issue in c6xdigio.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (2 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 04/24] Staging: comedi: fix code cleanup issue in pcmuio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 06/24] Staging: comedi: fix printk issue in ni_pcimio.c Ravishankar Karkala Mallikarjunayya
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the c6xdigio.c file that fixes up a printk warning
found by the checkpatch.pl tool
Converted embedded function names to "%s", __func__ as Joe Perches
suggested and printk to pr_<level>.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/c6xdigio.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/comedi/drivers/c6xdigio.c b/drivers/staging/comedi/drivers/c6xdigio.c
index e0ac825..a372a64 100644
--- a/drivers/staging/comedi/drivers/c6xdigio.c
+++ b/drivers/staging/comedi/drivers/c6xdigio.c
@@ -343,7 +343,7 @@ static int c6xdigio_pwmo_insn_read(struct comedi_device *dev,
 				   struct comedi_subdevice *s,
 				   struct comedi_insn *insn, unsigned int *data)
 {
-	printk("c6xdigio_pwmo_insn_read %x\n", insn->n);
+	pr_debug("%s: %x\n", __func__, insn->n);
 	return insn->n;
 }
 
@@ -439,9 +439,8 @@ static int c6xdigio_attach(struct comedi_device *dev,
 	struct comedi_subdevice *s;
 
 	iobase = it->options[0];
-	printk("comedi%d: c6xdigio: 0x%04lx\n", dev->minor, iobase);
 	if (!request_region(iobase, C6XDIGIO_SIZE, "c6xdigio")) {
-		printk("comedi%d: I/O port conflict\n", dev->minor);
+		pr_err("comedi%d: I/O port conflict\n", dev->minor);
 		return -EIO;
 	}
 	dev->iobase = iobase;
@@ -456,9 +455,9 @@ static int c6xdigio_attach(struct comedi_device *dev,
 
 	irq = it->options[1];
 	if (irq > 0)
-		printk("comedi%d: irq = %u ignored\n", dev->minor, irq);
+		pr_debug("comedi%d: irq = %u ignored\n", dev->minor, irq);
 	else if (irq == 0)
-		printk("comedi%d: no irq\n", dev->minor);
+		pr_debug("comedi%d: no irq\n", dev->minor);
 
 	s = dev->subdevices + 0;
 	/* pwm output subdevice */
@@ -503,8 +502,6 @@ static int c6xdigio_detach(struct comedi_device *dev)
 {
 	/* board_halt(dev);  may not need this */
 
-	printk("comedi%d: c6xdigio: remove\n", dev->minor);
-
 	if (dev->iobase)
 		release_region(dev->iobase, C6XDIGIO_SIZE);
 
-- 
1.7.6.4


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

* [PATCH 06/24] Staging: comedi: fix printk issue in ni_pcimio.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (3 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 05/24] Staging: comedi: fix printk issue in c6xdigio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 7/24] Staging: comedi: fix printk issue in ni_labpc_cs.c Ravishankar Karkala Mallikarjunayya
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the ni_pcimio.c file that fixes up a printk
warning found by the checkpatch.pl tool.
converted printks to pr_<level>.
Remove unnecessary printks.
Fixed a brace warning issue.

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

diff --git a/drivers/staging/comedi/drivers/ni_pcimio.c b/drivers/staging/comedi/drivers/ni_pcimio.c
index 9148abd..ae76f57 100644
--- a/drivers/staging/comedi/drivers/ni_pcimio.c
+++ b/drivers/staging/comedi/drivers/ni_pcimio.c
@@ -1470,8 +1470,8 @@ static void m_series_stc_writew(struct comedi_device *dev, uint16_t data,
 		/* FIXME: DIO_Output_Register (16 bit reg) is replaced by M_Offset_Static_Digital_Output (32 bit)
 		   and M_Offset_SCXI_Serial_Data_Out (8 bit) */
 	default:
-		printk("%s: bug! unhandled register=0x%x in switch.\n",
-		       __func__, reg);
+		pr_err("%s: bug! unhandled register=0x%x in switch.\n",
+			__func__, reg);
 		BUG();
 		return;
 		break;
@@ -1505,8 +1505,8 @@ static uint16_t m_series_stc_readw(struct comedi_device *dev, int reg)
 		offset = M_Offset_G01_Status;
 		break;
 	default:
-		printk("%s: bug! unhandled register=0x%x in switch.\n",
-		       __func__, reg);
+		pr_err("%s: bug! unhandled register=0x%x in switch.\n",
+			__func__, reg);
 		BUG();
 		return 0;
 		break;
@@ -1547,8 +1547,8 @@ static void m_series_stc_writel(struct comedi_device *dev, uint32_t data,
 		offset = M_Offset_G1_Load_B;
 		break;
 	default:
-		printk("%s: bug! unhandled register=0x%x in switch.\n",
-		       __func__, reg);
+		pr_err("%s: bug! unhandled register=0x%x in switch.\n",
+			__func__, reg);
 		BUG();
 		return;
 		break;
@@ -1573,8 +1573,8 @@ static uint32_t m_series_stc_readl(struct comedi_device *dev, int reg)
 		offset = M_Offset_G1_Save;
 		break;
 	default:
-		printk("%s: bug! unhandled register=0x%x in switch.\n",
-		       __func__, reg);
+		pr_err("%s: bug! unhandled register=0x%x in switch.\n",
+			__func__, reg);
 		BUG();
 		return 0;
 		break;
@@ -1632,9 +1632,8 @@ static void m_series_init_eeprom_buffer(struct comedi_device *dev)
 	}
 	devpriv->serial_number = be32_to_cpu(devpriv->serial_number);
 
-	for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i) {
+	for (i = 0; i < M_SERIES_EEPROM_SIZE; ++i)
 		devpriv->eeprom_buffer[i] = ni_readb(Start_Cal_EEPROM + i);
-	}
 
 	writel(old_iodwbsr1_bits, devpriv->mite->mite_io_addr + MITE_IODWBSR_1);
 	writel(old_iodwbsr_bits, devpriv->mite->mite_io_addr + MITE_IODWBSR);
@@ -1665,9 +1664,8 @@ static void init_6143(struct comedi_device *dev)
 static int pcimio_detach(struct comedi_device *dev)
 {
 	mio_common_detach(dev);
-	if (dev->irq) {
+	if (dev->irq)
 		free_irq(dev->irq, dev);
-	}
 	if (dev->private) {
 		mite_free_ring(devpriv->ai_mite_ring);
 		mite_free_ring(devpriv->ao_mite_ring);
@@ -1684,9 +1682,6 @@ static int pcimio_detach(struct comedi_device *dev)
 static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 {
 	int ret;
-
-	printk("comedi%d: ni_pcimio:", dev->minor);
-
 	ret = ni_alloc_private(dev);
 	if (ret < 0)
 		return ret;
@@ -1695,7 +1690,7 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	if (ret < 0)
 		return ret;
 
-	printk(" %s", boardtype.name);
+	pr_debug("%s\n", boardtype.name);
 	dev->board_name = boardtype.name;
 
 	if (boardtype.reg_type & ni_reg_m_series_mask) {
@@ -1712,7 +1707,7 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	ret = mite_setup(devpriv->mite);
 	if (ret < 0) {
-		printk(" error setting up mite\n");
+		pr_err("error setting up mite\n");
 		return ret;
 	}
 	comedi_set_hw_dev(dev, &devpriv->mite->pcidev->dev);
@@ -1740,13 +1735,13 @@ static int pcimio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	dev->irq = mite_irq(devpriv->mite);
 
 	if (dev->irq == 0) {
-		printk(" unknown irq (bad)\n");
+		pr_debug("unknown irq (bad)\n");
 	} else {
-		printk(" ( irq = %u )", dev->irq);
+		pr_debug("( irq = %u )\n", dev->irq);
 		ret = request_irq(dev->irq, ni_E_interrupt, NI_E_IRQ_FLAGS,
 				  DRV_NAME, dev);
 		if (ret < 0) {
-			printk(" irq not available\n");
+			pr_debug("irq not available\n");
 			dev->irq = 0;
 		}
 	}
@@ -1787,7 +1782,7 @@ static int pcimio_find_device(struct comedi_device *dev, int bus, int slot)
 			}
 		}
 	}
-	printk("no device found\n");
+	pr_err("no device found\n");
 	mite_list_devices();
 	return -EIO;
 }
-- 
1.7.6.4


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

* [PATCH 7/24] Staging: comedi: fix printk issue in ni_labpc_cs.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (4 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 06/24] Staging: comedi: fix printk issue in ni_pcimio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 08/24] Staging: comedi: fix printk issue in das800.c Ravishankar Karkala Mallikarjunayya
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the ni_labpc_cs.c file that fixes up a printk warning
found by the checkpatch.pl tool.
converted printk to pr_<level>.

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

diff --git a/drivers/staging/comedi/drivers/ni_labpc_cs.c b/drivers/staging/comedi/drivers/ni_labpc_cs.c
index 832a517..49f004c 100644
--- a/drivers/staging/comedi/drivers/ni_labpc_cs.c
+++ b/drivers/staging/comedi/drivers/ni_labpc_cs.c
@@ -145,7 +145,7 @@ static int labpc_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		irq = link->irq;
 		break;
 	default:
-		printk("bug! couldn't determine board type\n");
+		pr_err("bug! couldn't determine board type\n");
 		return -EINVAL;
 		break;
 	}
-- 
1.7.6.4


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

* [PATCH 08/24]  Staging: comedi: fix printk issue in das800.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (5 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 7/24] Staging: comedi: fix printk issue in ni_labpc_cs.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 9/24] Staging: comedi: fix warning issue in dt3000.c Ravishankar Karkala Mallikarjunayya
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the das800.c file that fixes up a printk found by
the checkpatch.pl tool.
Converted printks to pr_<level>.
Removed unnecessary uses of printks.

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

diff --git a/drivers/staging/comedi/drivers/das800.c b/drivers/staging/comedi/drivers/das800.c
index 96d41ad..a589698 100644
--- a/drivers/staging/comedi/drivers/das800.c
+++ b/drivers/staging/comedi/drivers/das800.c
@@ -466,42 +466,40 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	unsigned long irq_flags;
 	int board;
 
-	printk("comedi%d: das800: io 0x%lx", dev->minor, iobase);
 	if (irq)
-		printk(", irq %u", irq);
-	printk("\n");
+		pr_debug("irq %u\n", irq);
 
 	/* allocate and initialize dev->private */
 	if (alloc_private(dev, sizeof(struct das800_private)) < 0)
 		return -ENOMEM;
 
 	if (iobase == 0) {
-		printk("io base address required for das800\n");
+		pr_err("io base address required for das800\n");
 		return -EINVAL;
 	}
 
 	/* check if io addresses are available */
 	if (!request_region(iobase, DAS800_SIZE, "das800")) {
-		printk("I/O port conflict\n");
+		pr_err("I/O port conflict\n");
 		return -EIO;
 	}
 	dev->iobase = iobase;
 
 	board = das800_probe(dev);
 	if (board < 0) {
-		printk("unable to determine board type\n");
+		pr_err("unable to determine board type\n");
 		return -ENODEV;
 	}
 	dev->board_ptr = das800_boards + board;
 
 	/* grab our IRQ */
 	if (irq == 1 || irq > 7) {
-		printk("irq out of range\n");
+		pr_err("irq out of range\n");
 		return -EINVAL;
 	}
 	if (irq) {
 		if (request_irq(irq, das800_interrupt, 0, "das800", dev)) {
-			printk("unable to allocate irq %u\n", irq);
+			pr_err("unable to allocate irq %u\n", irq);
 			return -EINVAL;
 		}
 	}
@@ -557,7 +555,6 @@ static int das800_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 static int das800_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: das800: remove\n", dev->minor);
 
 	/* only free stuff if it has been allocated by _attach */
 	if (dev->iobase)
-- 
1.7.6.4


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

* [PATCH 9/24] Staging: comedi: fix warning issue in dt3000.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (6 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 08/24] Staging: comedi: fix printk issue in das800.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 10/24] Staging: comedi: fix printk issue in cb_pcidas64.c Ravishankar Karkala Mallikarjunayya
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt.
Converted printks to pr_<level> and dev_printk.
Removed unneccessary printks.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/dt3000.c |   51 +++++++++++++++----------------
 1 files changed, 25 insertions(+), 26 deletions(-)

diff --git a/drivers/staging/comedi/drivers/dt3000.c b/drivers/staging/comedi/drivers/dt3000.c
index 6170f7b..1d2c1a1 100644
--- a/drivers/staging/comedi/drivers/dt3000.c
+++ b/drivers/staging/comedi/drivers/dt3000.c
@@ -57,6 +57,9 @@ AO commands are not supported.
    you the docs without one, also.
 */
 
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #define DEBUG 1
 
 #include <linux/interrupt.h>
@@ -161,7 +164,7 @@ static const struct dt3k_boardtype dt3k_boardtypes[] = {
 	 },
 };
 
-#define n_dt3k_boards sizeof(dt3k_boardtypes)/sizeof(struct dt3k_boardtype)
+#define n_dt3k_boards (sizeof(dt3k_boardtypes)/sizeof(struct dt3k_boardtype))
 #define this_board ((const struct dt3k_boardtype *)dev->board_ptr)
 
 static DEFINE_PCI_DEVICE_TABLE(dt3k_pci_table) = {
@@ -352,7 +355,7 @@ static int dt3k_send_cmd(struct comedi_device *dev, unsigned int cmd)
 	if ((status & DT3000_COMPLETION_MASK) == DT3000_NOERROR)
 		return 0;
 
-	printk("dt3k_send_cmd() timeout/error status=0x%04x\n", status);
+	pr_err("%s: timeout/error status=0x%04x\n", __func__, status);
 
 	return -ETIME;
 }
@@ -383,7 +386,7 @@ static void dt3k_writesingle(struct comedi_device *dev, unsigned int subsys,
 	dt3k_send_cmd(dev, CMD_WRITESINGLE);
 }
 
-static int debug_n_ints = 0;
+static int debug_n_ints;
 
 /* FIXME! Assumes shared interrupt is for this card. */
 /* What's this debug_n_ints stuff? Obviously needs some work... */
@@ -420,7 +423,6 @@ static irqreturn_t dt3k_interrupt(int irq, void *d)
 	return IRQ_HANDLED;
 }
 
-#ifdef DEBUG
 static char *intr_flags[] = {
 	"AdFull", "AdSwError", "AdHwError", "DaEmpty",
 	"DaSwError", "DaHwError", "CtDone", "CmDone",
@@ -429,14 +431,12 @@ static char *intr_flags[] = {
 static void debug_intr_flags(unsigned int flags)
 {
 	int i;
-	printk("dt3k: intr_flags:");
+	pr_debug("intr_flags:\n");
 	for (i = 0; i < 8; i++) {
 		if (flags & (1 << i))
-			printk(" %s", intr_flags[i]);
+			pr_debug("%s\n", intr_flags[i]);
 	}
-	printk("\n");
 }
-#endif
 
 static void dt3k_ai_empty_fifo(struct comedi_device *dev,
 			       struct comedi_subdevice *s)
@@ -452,7 +452,7 @@ static void dt3k_ai_empty_fifo(struct comedi_device *dev,
 	if (count < 0)
 		count += AI_FIFO_DEPTH;
 
-	printk("reading %d samples\n", count);
+	pr_debug("reading %d samples\n", count);
 
 	rear = devpriv->ai_rear;
 
@@ -504,7 +504,9 @@ static int dt3k_ai_cmdtest(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 (err)
 		return 2;
@@ -640,7 +642,7 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	int ret;
 	unsigned int mode;
 
-	printk("dt3k_ai_cmd:\n");
+	dev_dbg(dev->hw_dev, "dt3k_ai_cmd:\n");
 	for (i = 0; i < cmd->chanlist_len; i++) {
 		chan = CR_CHAN(cmd->chanlist[i]);
 		range = CR_RANGE(cmd->chanlist[i]);
@@ -651,15 +653,15 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 	aref = CR_AREF(cmd->chanlist[0]);
 
 	writew(cmd->scan_end_arg, devpriv->io_addr + DPR_Params(0));
-	printk("param[0]=0x%04x\n", cmd->scan_end_arg);
+	dev_dbg(dev->hw_dev, "param[0]=0x%04x\n", cmd->scan_end_arg);
 
 	if (cmd->convert_src == TRIG_TIMER) {
 		divider = dt3k_ns_to_timer(50, &cmd->convert_arg,
 					   cmd->flags & TRIG_ROUND_MASK);
 		writew((divider >> 16), devpriv->io_addr + DPR_Params(1));
-		printk("param[1]=0x%04x\n", divider >> 16);
+		dev_dbg(dev->hw_dev, "param[1]=0x%04x\n", divider >> 16);
 		writew((divider & 0xffff), devpriv->io_addr + DPR_Params(2));
-		printk("param[2]=0x%04x\n", divider & 0xffff);
+		dev_dbg(dev->hw_dev, "param[2]=0x%04x\n", divider & 0xffff);
 	} else {
 		/* not supported */
 	}
@@ -668,21 +670,21 @@ static int dt3k_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 		tscandiv = dt3k_ns_to_timer(100, &cmd->scan_begin_arg,
 					    cmd->flags & TRIG_ROUND_MASK);
 		writew((tscandiv >> 16), devpriv->io_addr + DPR_Params(3));
-		printk("param[3]=0x%04x\n", tscandiv >> 16);
+		dev_dbg(dev->hw_dev, "param[3]=0x%04x\n", tscandiv >> 16);
 		writew((tscandiv & 0xffff), devpriv->io_addr + DPR_Params(4));
-		printk("param[4]=0x%04x\n", tscandiv & 0xffff);
+		dev_dbg(dev->hw_dev, "param[4]=0x%04x\n", tscandiv & 0xffff);
 	} else {
 		/* not supported */
 	}
 
 	mode = DT3000_AD_RETRIG_INTERNAL | 0 | 0;
 	writew(mode, devpriv->io_addr + DPR_Params(5));
-	printk("param[5]=0x%04x\n", mode);
+	dev_dbg(dev->hw_dev, "param[5]=0x%04x\n", mode);
 	writew(aref == AREF_DIFF, devpriv->io_addr + DPR_Params(6));
-	printk("param[6]=0x%04x\n", aref == AREF_DIFF);
+	dev_dbg(dev->hw_dev, "param[6]=0x%04x\n", aref == AREF_DIFF);
 
 	writew(AI_FIFO_DEPTH / 2, devpriv->io_addr + DPR_Params(7));
-	printk("param[7]=0x%04x\n", AI_FIFO_DEPTH / 2);
+	dev_dbg(dev->hw_dev, "param[7]=0x%04x\n", AI_FIFO_DEPTH / 2);
 
 	writew(SUBS_AI, devpriv->io_addr + DPR_SubSys);
 	ret = dt3k_send_cmd(dev, CMD_CONFIG);
@@ -848,7 +850,6 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	int bus, slot;
 	int ret = 0;
 
-	printk("dt3000:");
 	bus = it->options[0];
 	slot = it->options[1];
 
@@ -860,7 +861,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	if (ret < 0)
 		return ret;
 	if (ret == 0) {
-		printk(" no DT board found\n");
+		pr_err("no DT board found\n");
 		return -ENODEV;
 	}
 
@@ -868,7 +869,7 @@ static int dt3000_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	if (request_irq(devpriv->pci_dev->irq, dt3k_interrupt, IRQF_SHARED,
 			"dt3000", dev)) {
-		printk(" unable to allocate IRQ %u\n", devpriv->pci_dev->irq);
+		pr_err("unable to allocate IRQ %u\n", devpriv->pci_dev->irq);
 		return -EINVAL;
 	}
 	dev->irq = devpriv->pci_dev->irq;
@@ -998,10 +999,8 @@ static int setup_pci(struct comedi_device *dev)
 	devpriv->io_addr = ioremap(devpriv->phys_addr, DT3000_SIZE);
 	if (!devpriv->io_addr)
 		return -ENOMEM;
-#if DEBUG
-	printk("0x%08llx mapped to %p, ",
-	       (unsigned long long)devpriv->phys_addr, devpriv->io_addr);
-#endif
+	pr_debug("0x%08llx mapped to %p,\n",
+		(unsigned long long)devpriv->phys_addr, devpriv->io_addr);
 
 	return 0;
 }
-- 
1.7.6.4


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

* [PATCH 10/24] Staging: comedi: fix printk issue in cb_pcidas64.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (7 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 9/24] Staging: comedi: fix warning issue in dt3000.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 11/24] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidas64.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt.
Converted printks to dev_printk.
Removed unnecessary printk statement.

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

diff --git a/drivers/staging/comedi/drivers/cb_pcidas64.c b/drivers/staging/comedi/drivers/cb_pcidas64.c
index 3dc68ef..51c48e3 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas64.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas64.c
@@ -83,6 +83,8 @@ TODO:
 	make ao fifo size adjustable like ai fifo
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "../comedidev.h"
 #include <linux/delay.h>
 #include <linux/interrupt.h>
@@ -1739,8 +1741,6 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	uint32_t local_range, local_decode;
 	int retval;
 
-	pr_info("comedi%d: cb_pcidas64\n", dev->minor);
-
 /*
  * Allocate the private structure area.
  */
@@ -1776,17 +1776,15 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	}
 
 	if (dev->board_ptr == NULL) {
-		printk
-		    ("No supported ComputerBoards/MeasurementComputing card found\n");
+		dev_err(dev->hw_dev, "No supported ComputerBoards/MeasurementComputing card found\n");
 		return -EIO;
 	}
 
-	printk("Found %s on bus %i, slot %i\n", board(dev)->name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_dbg(dev->hw_dev,  "Found %s on bus %i, slot %i\n", board(dev)->name,
+		pcidev->bus->number, PCI_SLOT(pcidev->devfn));
 
 	if (comedi_pci_enable(pcidev, driver_cb_pcidas.driver_name)) {
-		printk(KERN_WARNING
-		       " 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;
 	}
 	pci_set_master(pcidev);
@@ -1814,7 +1812,7 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	if (!priv(dev)->plx9080_iobase || !priv(dev)->main_iobase
 	    || !priv(dev)->dio_counter_iobase) {
-		printk(" failed to remap io memory\n");
+		dev_err(dev->hw_dev, "failed to remap io memory\n");
 		return -ENOMEM;
 	}
 
@@ -1850,17 +1848,19 @@ static int attach(struct comedi_device *dev, struct comedi_devconfig *it)
 
 	priv(dev)->hw_revision =
 	    hw_revision(dev, readw(priv(dev)->main_iobase + HW_STATUS_REG));
-	printk(" stc hardware revision %i\n", priv(dev)->hw_revision);
+	dev_dbg(dev->hw_dev, "stc hardware revision %i\n",
+		priv(dev)->hw_revision);
 	init_plx9080(dev);
 	init_stc_registers(dev);
 	/*  get irq */
 	if (request_irq(pcidev->irq, handle_interrupt, IRQF_SHARED,
 			"cb_pcidas64", dev)) {
-		printk(" unable to allocate irq %u\n", pcidev->irq);
+		dev_err(dev->hw_dev, "unable to allocate irq %u\n",
+			pcidev->irq);
 		return -EINVAL;
 	}
 	dev->irq = pcidev->irq;
-	printk(" irq %u\n", dev->irq);
+	dev_dbg(dev->hw_dev, "irq %u\n", dev->irq);
 
 	retval = setup_subdevices(dev);
 	if (retval < 0)
@@ -1882,8 +1882,6 @@ static int detach(struct comedi_device *dev)
 {
 	unsigned int i;
 
-	printk("comedi%d: cb_pcidas: remove\n", dev->minor);
-
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 	if (priv(dev)) {
@@ -2093,7 +2091,8 @@ static int ai_config_calibration_source(struct comedi_device *dev,
 	else
 		num_calibration_sources = 8;
 	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;
 	}
 
@@ -2924,7 +2923,7 @@ static void pio_drain_ai_fifo_16(struct comedi_device *dev)
 		}
 
 		if (num_samples < 0) {
-			printk(" cb_pcidas64: bug! num_samples < 0\n");
+			dev_err(dev->hw_dev, "bug! num_samples < 0\n");
 			break;
 		}
 
-- 
1.7.6.4


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

* [PATCH 11/24] Staging: comedi: fix printk issue in cb_pcidda.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (8 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 10/24] Staging: comedi: fix printk issue in cb_pcidas64.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 12/24] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidda.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt.
converted printks to dev_printk level.
Removed unnecessary printk statements.

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

diff --git a/drivers/staging/comedi/drivers/cb_pcidda.c b/drivers/staging/comedi/drivers/cb_pcidda.c
index 49102b3..68bea4d 100644
--- a/drivers/staging/comedi/drivers/cb_pcidda.c
+++ b/drivers/staging/comedi/drivers/cb_pcidda.c
@@ -46,11 +46,14 @@ Please report success/failure with other different cards to
 <comedi@comedi.org>.
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include "../comedidev.h"
 
 #include "comedi_pci.h"
 #include "8255.h"
 
+
 #define PCI_VENDOR_ID_CB	0x1307	/*  PCI vendor number of ComputerBoards */
 #define EEPROM_SIZE	128	/*  number of entries in eeprom */
 #define MAX_AO_CHANNELS 8	/*  maximum number of ao channels for supported boards */
@@ -282,7 +285,6 @@ static int cb_pcidda_attach(struct comedi_device *dev,
 	struct pci_dev *pcidev = NULL;
 	int index;
 
-	printk("comedi%d: cb_pcidda: ", dev->minor);
 
 /*
  * Allocate the private structure area.
@@ -293,7 +295,6 @@ static int cb_pcidda_attach(struct comedi_device *dev,
 /*
  * Probe the device to determine what device in the series it is.
  */
-	printk("\n");
 
 	for_each_pci_dev(pcidev) {
 		if (pcidev->vendor == PCI_VENDOR_ID_CB) {
@@ -312,22 +313,22 @@ static int cb_pcidda_attach(struct comedi_device *dev,
 		}
 	}
 	if (!pcidev) {
-		printk
-		    ("Not a ComputerBoards/MeasurementComputing card on requested position\n");
+		dev_err(dev->hw_dev,
+			"Not a ComputerBoards/MeasurementComputing card on requested position\n");
 		return -EIO;
 	}
 found:
 	devpriv->pci_dev = pcidev;
 	dev->board_ptr = cb_pcidda_boards + index;
 	/*  "thisboard" macro can be used from here. */
-	printk("Found %s at requested position\n", thisboard->name);
+	dev_dbg(dev->hw_dev, "Found %s at requested position\n",
+		thisboard->name);
 
 	/*
 	 * Enable PCI device and request regions.
 	 */
 	if (comedi_pci_enable(pcidev, thisboard->name)) {
-		printk
-		    ("cb_pcidda: 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;
 	}
 
@@ -377,12 +378,11 @@ found:
 	s = dev->subdevices + 2;
 	subdev_8255_init(dev, s, NULL, devpriv->digitalio + PORT2A);
 
-	printk(" eeprom:");
+	dev_dbg(dev->hw_dev, "eeprom:\n");
 	for (index = 0; index < EEPROM_SIZE; index++) {
 		devpriv->eeprom_data[index] = cb_pcidda_read_eeprom(dev, index);
-		printk(" %i:0x%x ", index, devpriv->eeprom_data[index]);
+		dev_dbg(dev->hw_dev, "%i:0x%x\n", index, devpriv->eeprom_data[index]);
 	}
-	printk("\n");
 
 	/*  set calibrations dacs */
 	for (index = 0; index < thisboard->ao_chans; index++)
@@ -417,8 +417,6 @@ static int cb_pcidda_detach(struct comedi_device *dev)
 		subdev_8255_cleanup(dev, dev->subdevices + 2);
 	}
 
-	printk("comedi%d: cb_pcidda: remove\n", dev->minor);
-
 	return 0;
 }
 
-- 
1.7.6.4


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

* [PATCH 12/24]  Staging: comedi: fix printk issue in cb_pcidio.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (9 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 11/24] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:18 ` [PATCH 13/24] Staging: comedi: fix printk issue in cb_pcimdas.c Ravishankar Karkala Mallikarjunayya
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcidio.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Converted printks to dev_<level>.
Removed unnecessary printk statement.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcidio.c |   23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcidio.c b/drivers/staging/comedi/drivers/cb_pcidio.c
index 79477a5..ef025e0 100644
--- a/drivers/staging/comedi/drivers/cb_pcidio.c
+++ b/drivers/staging/comedi/drivers/cb_pcidio.c
@@ -39,6 +39,8 @@ Configuration Options:
 Passing a zero for an option is the same as leaving it unspecified.
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 /*------------------------------ HEADER FILES ---------------------------------*/
 #include "../comedidev.h"
 #include "comedi_pci.h"
@@ -184,8 +186,6 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 	int index;
 	int i;
 
-	printk("comedi%d: cb_pcidio: \n", dev->minor);
-
 /*
  * Allocate the private structure area.  alloc_private() is a
  * convenient macro defined in comedidev.h.
@@ -223,8 +223,8 @@ static int pcidio_attach(struct comedi_device *dev, struct comedi_devconfig *it)
 		}
 	}
 
-	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:
@@ -236,12 +236,11 @@ found:
 	dev->board_name = thisboard->name;
 
 	devpriv->pci_dev = pcidev;
-	printk("Found %s on bus %i, slot %i\n", thisboard->name,
-	       devpriv->pci_dev->bus->number,
-	       PCI_SLOT(devpriv->pci_dev->devfn));
+	dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n", thisboard->name,
+		devpriv->pci_dev->bus->number,
+		PCI_SLOT(devpriv->pci_dev->devfn));
 	if (comedi_pci_enable(pcidev, thisboard->name)) {
-		printk
-		    ("cb_pcidio: 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;
 	}
 	devpriv->dio_reg_base
@@ -259,11 +258,10 @@ found:
 	for (i = 0; i < thisboard->n_8255; i++) {
 		subdev_8255_init(dev, dev->subdevices + i,
 				 NULL, devpriv->dio_reg_base + i * 4);
-		printk(" subdev %d: base = 0x%lx\n", i,
-		       devpriv->dio_reg_base + i * 4);
+		dev_dbg(dev->hw_dev, "subdev %d: base = 0x%lx\n", i,
+			devpriv->dio_reg_base + i * 4);
 	}
 
-	printk("attached\n");
 	return 1;
 }
 
@@ -277,7 +275,6 @@ found:
  */
 static int pcidio_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: cb_pcidio: remove\n", dev->minor);
 	if (devpriv) {
 		if (devpriv->pci_dev) {
 			if (devpriv->dio_reg_base)
-- 
1.7.6.4


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

* [PATCH 13/24] Staging: comedi: fix printk issue in cb_pcimdas.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (10 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 12/24] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:18 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 14/24] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:18 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the cb_pcimdas.c file that fixes up a printk
warning found by the checkpatch.pl tool.
Converted printks to dev_<level>.
Removed unnecessary printk statement.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/cb_pcimdas.c |   48 +++++++++++---------------
 1 files changed, 20 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/comedi/drivers/cb_pcimdas.c b/drivers/staging/comedi/drivers/cb_pcimdas.c
index b1b832b..9aae302 100644
--- a/drivers/staging/comedi/drivers/cb_pcimdas.c
+++ b/drivers/staging/comedi/drivers/cb_pcimdas.c
@@ -212,8 +212,6 @@ static int cb_pcimdas_attach(struct comedi_device *dev,
 	int index;
 	/* int i; */
 
-	printk("comedi%d: cb_pcimdas: ", dev->minor);
-
 /*
  * Allocate the private structure area.
  */
@@ -223,7 +221,6 @@ static int cb_pcimdas_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? */
@@ -248,26 +245,27 @@ static int cb_pcimdas_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_pcimdas_boards[index].name,
-	       pcidev->bus->number, PCI_SLOT(pcidev->devfn));
+	dev_dbg(dev->hw_dev, "Found %s on bus %i, slot %i\n",
+		cb_pcimdas_boards[index].name,
+		pcidev->bus->number, PCI_SLOT(pcidev->devfn));
 
 	/*  Warn about non-tested features */
 	switch (thisboard->device_id) {
 	case 0x56:
 		break;
 	default:
-		printk("THIS CARD IS UNSUPPORTED.\n"
-		       "PLEASE REPORT USAGE TO <mocelet@sucs.org>\n");
+		dev_err(dev->hw_dev, "THIS CARD IS UNSUPPORTED.\n"
+			 "PLEASE REPORT USAGE TO <mocelet@sucs.org>\n");
 	}
 
 	if (comedi_pci_enable(pcidev, "cb_pcimdas")) {
-		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;
 	}
 
@@ -277,13 +275,11 @@ found:
 	devpriv->BADR3 = pci_resource_start(devpriv->pci_dev, 3);
 	devpriv->BADR4 = pci_resource_start(devpriv->pci_dev, 4);
 
-#ifdef CBPCIMDAS_DEBUG
-	printk("devpriv->BADR0 = 0x%lx\n", devpriv->BADR0);
-	printk("devpriv->BADR1 = 0x%lx\n", devpriv->BADR1);
-	printk("devpriv->BADR2 = 0x%lx\n", devpriv->BADR2);
-	printk("devpriv->BADR3 = 0x%lx\n", devpriv->BADR3);
-	printk("devpriv->BADR4 = 0x%lx\n", devpriv->BADR4);
-#endif
+	dev_dbg(dev->hw_dev, "devpriv->BADR0 = 0x%lx\n", devpriv->BADR0);
+	dev_dbg(dev->hw_dev, "devpriv->BADR1 = 0x%lx\n", devpriv->BADR1);
+	dev_dbg(dev->hw_dev, "devpriv->BADR2 = 0x%lx\n", devpriv->BADR2);
+	dev_dbg(dev->hw_dev, "devpriv->BADR3 = 0x%lx\n", devpriv->BADR3);
+	dev_dbg(dev->hw_dev, "devpriv->BADR4 = 0x%lx\n", devpriv->BADR4);
 
 /* Dont support IRQ yet */
 /*  get irq */
@@ -333,8 +329,6 @@ found:
 	else
 		s->type = COMEDI_SUBD_UNUSED;
 
-	printk("attached\n");
-
 	return 1;
 }
 
@@ -348,16 +342,14 @@ found:
  */
 static int cb_pcimdas_detach(struct comedi_device *dev)
 {
-#ifdef CBPCIMDAS_DEBUG
 	if (devpriv) {
-		printk("devpriv->BADR0 = 0x%lx\n", devpriv->BADR0);
-		printk("devpriv->BADR1 = 0x%lx\n", devpriv->BADR1);
-		printk("devpriv->BADR2 = 0x%lx\n", devpriv->BADR2);
-		printk("devpriv->BADR3 = 0x%lx\n", devpriv->BADR3);
-		printk("devpriv->BADR4 = 0x%lx\n", devpriv->BADR4);
+		dev_dbg(dev->hw_dev, "devpriv->BADR0 = 0x%lx\n", devpriv->BADR0);
+		dev_dbg(dev->hw_dev, "devpriv->BADR1 = 0x%lx\n", devpriv->BADR1);
+		dev_dbg(dev->hw_dev, "devpriv->BADR2 = 0x%lx\n", devpriv->BADR2);
+		dev_dbg(dev->hw_dev, "devpriv->BADR3 = 0x%lx\n", devpriv->BADR3);
+		dev_dbg(dev->hw_dev, "devpriv->BADR4 = 0x%lx\n", devpriv->BADR4);
 	}
-#endif
-	printk("comedi%d: cb_pcimdas: remove\n", dev->minor);
+	
 	if (dev->irq)
 		free_irq(dev->irq, dev);
 	if (devpriv) {
@@ -425,7 +417,7 @@ static int cb_pcimdas_ai_rinsn(struct comedi_device *dev,
 				break;
 		}
 		if (i == TIMEOUT) {
-			printk("timeout\n");
+			dev_err(dev->hw_dev, "timeout\n");
 			return -ETIMEDOUT;
 		}
 		/* read data */
-- 
1.7.6.4


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

* [PATCH 14/24] Staging: comedi: fix printk issue in cb_pcimdda.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (11 preceding siblings ...)
  2011-10-20  6:18 ` [PATCH 13/24] Staging: comedi: fix printk issue in cb_pcimdas.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 15/24] Staging: comedi: fix printk issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 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.

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] 27+ messages in thread

* [PATCH 15/24] Staging: comedi: fix printk issue in contec_pci_dio.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (12 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 14/24] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 16/24] Staging: comedi: fix printk issue in amplc_pci230.c Ravishankar Karkala Mallikarjunayya
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 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] 27+ messages in thread

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

This is a patch to the amplc_pci230.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/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] 27+ messages in thread

* [PATCH 17/24] Staging: comedi: fix printk issue in adv_pci_dio.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (14 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 16/24] Staging: comedi: fix printk issue in amplc_pci230.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 18/24] Staging: comedi: fix printk issue in ni_at_a2150.c Ravishankar Karkala Mallikarjunayya
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 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] 27+ messages in thread

* [PATCH 18/24] Staging: comedi: fix printk issue in ni_at_a2150.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (15 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 17/24] Staging: comedi: fix printk issue in adv_pci_dio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 19/24] Staging: comedi: fix warning issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 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] 27+ messages in thread

* [PATCH 19/24] Staging: comedi: fix warning issue in contec_pci_dio.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (16 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 18/24] Staging: comedi: fix printk issue in ni_at_a2150.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 20/24] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 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] 27+ messages in thread

* [PATCH 20/24] Staging: comedi: fix printk issue in cb_pcidas.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (17 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 19/24] Staging: comedi: fix warning issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 21/24] Staging: comedi: fix warning issue in cb_das16_cs.c Ravishankar Karkala Mallikarjunayya
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 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] 27+ messages in thread

* [PATCH 21/24] Staging: comedi: fix warning issue in cb_das16_cs.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (18 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 20/24] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 22/24] Staging: comedi: fix printk issue in das1800.c Ravishankar Karkala Mallikarjunayya
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt.
converted printks to dev_printk.
Removed unnecessary printk statements.
Fixed line over 80 character and NULL initilization issue.

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

diff --git a/drivers/staging/comedi/drivers/cb_das16_cs.c b/drivers/staging/comedi/drivers/cb_das16_cs.c
index 8a1b8a7..71676d8 100644
--- a/drivers/staging/comedi/drivers/cb_das16_cs.c
+++ b/drivers/staging/comedi/drivers/cb_das16_cs.c
@@ -31,6 +31,8 @@ Status: experimental
 
 */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/interrupt.h>
 #include <linux/slab.h>
 #include "../comedidev.h"
@@ -99,7 +101,7 @@ static struct comedi_driver driver_das16cs = {
 	.detach = das16cs_detach,
 };
 
-static struct pcmcia_device *cur_dev = NULL;
+static struct pcmcia_device *cur_dev;
 
 static const struct comedi_lrange das16cs_ai_range = { 4, {
 							   RANGE(-10, 10),
@@ -150,7 +152,7 @@ static const struct das16cs_board *das16cs_probe(struct comedi_device *dev,
 			return das16cs_boards + i;
 	}
 
-	printk("unknown board!\n");
+	dev_dbg(dev->hw_dev, "unknown board!\n");
 
 	return NULL;
 }
@@ -163,20 +165,17 @@ static int das16cs_attach(struct comedi_device *dev,
 	int ret;
 	int i;
 
-	printk("comedi%d: cb_das16_cs: ", dev->minor);
 
 	link = cur_dev;		/* XXX hack */
 	if (!link)
 		return -EIO;
 
 	dev->iobase = link->resource[0]->start;
-	printk("I/O base=0x%04lx ", dev->iobase);
+	dev_dbg(dev->hw_dev, "I/O base=0x%04lx\n", dev->iobase);
 
-	printk("fingerprint:\n");
+	dev_dbg(dev->hw_dev, "fingerprint:\n");
 	for (i = 0; i < 48; i += 2)
-		printk("%04x ", inw(dev->iobase + i));
-
-	printk("\n");
+		dev_dbg(dev->hw_dev, "%04x\n", inw(dev->iobase + i));
 
 	ret = request_irq(link->irq, das16cs_interrupt,
 			  IRQF_SHARED, "cb_das16_cs", dev);
@@ -185,7 +184,7 @@ static int das16cs_attach(struct comedi_device *dev,
 
 	dev->irq = link->irq;
 
-	printk("irq=%u ", dev->irq);
+	dev_dbg(dev->hw_dev, "irq=%u\n", dev->irq);
 
 	dev->board_ptr = das16cs_probe(dev, link);
 	if (!dev->board_ptr)
@@ -252,14 +251,11 @@ static int das16cs_attach(struct comedi_device *dev,
 		s->type = COMEDI_SUBD_UNUSED;
 	}
 
-	printk("attached\n");
-
 	return 1;
 }
 
 static int das16cs_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: das16cs: remove\n", dev->minor);
 
 	if (dev->irq)
 		free_irq(dev->irq, dev);
@@ -312,7 +308,7 @@ static int das16cs_ai_rinsn(struct comedi_device *dev,
 				break;
 		}
 		if (to == TIMEOUT) {
-			printk("cb_das16_cs: ai timeout\n");
+			dev_err(dev->hw_dev, "ai timeout\n");
 			return -ETIME;
 		}
 		data[i] = (unsigned short)inw(dev->iobase + 0);
@@ -370,7 +366,9 @@ static int das16cs_ai_cmdtest(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
+	 */
 
 	/* note that mutual compatibility is not an issue here */
 	if (cmd->scan_begin_src != TRIG_TIMER &&
-- 
1.7.6.4


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

* [PATCH 22/24] Staging: comedi: fix printk issue in das1800.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (19 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 21/24] Staging: comedi: fix warning issue in cb_das16_cs.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 23/24] Staging: comedi: fix printk issue in adv_pci1710.c Ravishankar Karkala Mallikarjunayya
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the das1800.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/das1800.c |   90 +++++++++++++-----------------
 1 files changed, 39 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/comedi/drivers/das1800.c b/drivers/staging/comedi/drivers/das1800.c
index a6df30b..354ddc7 100644
--- a/drivers/staging/comedi/drivers/das1800.c
+++ b/drivers/staging/comedi/drivers/das1800.c
@@ -573,22 +573,23 @@ static int das1800_init_dma(struct comedi_device *dev, unsigned int dma0,
 			devpriv->dma_bits |= DMA_CH7_CH5;
 			break;
 		default:
-			printk(" only supports dma channels 5 through 7\n"
-			       " Dual dma only allows the following combinations:\n"
-			       " dma 5,6 / 6,7 / or 7,5\n");
+			dev_err(dev->hw_dev, " only supports dma channels 5 through 7\n"
+				" Dual dma only allows the following combinations:\n"
+				" dma 5,6 / 6,7 / or 7,5\n");
 			return -EINVAL;
 			break;
 		}
 		if (request_dma(dma0, driver_das1800.driver_name)) {
-			printk(" failed to allocate dma channel %i\n", dma0);
+			dev_err(dev->hw_dev, "failed to allocate dma channel %i\n",
+				dma0);
 			return -EINVAL;
 		}
 		devpriv->dma0 = dma0;
 		devpriv->dma_current = dma0;
 		if (dma1) {
 			if (request_dma(dma1, driver_das1800.driver_name)) {
-				printk(" failed to allocate dma channel %i\n",
-				       dma1);
+				dev_err(dev->hw_dev, "failed to allocate dma channel %i\n",
+					dma1);
 				return -EINVAL;
 			}
 			devpriv->dma1 = dma1;
@@ -631,35 +632,31 @@ static int das1800_attach(struct comedi_device *dev,
 	if (alloc_private(dev, sizeof(struct das1800_private)) < 0)
 		return -ENOMEM;
 
-	printk("comedi%d: %s: io 0x%lx", dev->minor, driver_das1800.driver_name,
-	       iobase);
 	if (irq) {
-		printk(", irq %u", irq);
+		dev_dbg(dev->hw_dev, "irq %u\n", irq);
 		if (dma0) {
-			printk(", dma %u", dma0);
+			dev_dbg(dev->hw_dev, "dma %u\n", dma0);
 			if (dma1)
-				printk(" and %u", dma1);
+				dev_dbg(dev->hw_dev, "and %u\n", dma1);
 		}
 	}
-	printk("\n");
 
 	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, DAS1800_SIZE, driver_das1800.driver_name)) {
-		printk
-		    (" I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
-		     iobase, iobase + DAS1800_SIZE - 1);
+		dev_err(dev->hw_dev, "I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
+			iobase, iobase + DAS1800_SIZE - 1);
 		return -EIO;
 	}
 	dev->iobase = iobase;
 
 	board = das1800_probe(dev);
 	if (board < 0) {
-		printk(" unable to determine board type\n");
+		dev_err(dev->hw_dev, "unable to determine board type\n");
 		return -ENODEV;
 	}
 
@@ -671,9 +668,8 @@ static int das1800_attach(struct comedi_device *dev,
 		iobase2 = iobase + IOBASE2;
 		if (!request_region(iobase2, DAS1800_SIZE,
 				    driver_das1800.driver_name)) {
-			printk
-			    (" I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
-			     iobase2, iobase2 + DAS1800_SIZE - 1);
+			dev_err(dev->hw_dev, "I/O port conflict: failed to allocate ports 0x%lx to 0x%lx\n",
+				iobase2, iobase2 + DAS1800_SIZE - 1);
 			return -EIO;
 		}
 		devpriv->iobase2 = iobase2;
@@ -683,7 +679,8 @@ static int das1800_attach(struct comedi_device *dev,
 	if (irq) {
 		if (request_irq(irq, das1800_interrupt, 0,
 				driver_das1800.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;
 		}
 	}
@@ -712,7 +709,7 @@ static int das1800_attach(struct comedi_device *dev,
 		devpriv->irq_dma_bits |= 0x38;
 		break;
 	default:
-		printk(" irq out of range\n");
+		dev_err(dev->hw_dev, "irq out of range\n");
 		return -EINVAL;
 		break;
 	}
@@ -813,9 +810,6 @@ static int das1800_detach(struct comedi_device *dev)
 		kfree(devpriv->ai_buf1);
 	}
 
-	printk("comedi%d: %s: remove\n", dev->minor,
-	       driver_das1800.driver_name);
-
 	return 0;
 };
 
@@ -833,69 +827,63 @@ static int das1800_probe(struct comedi_device *dev)
 	case 0x3:
 		if (board == das1801st_da || board == das1802st_da ||
 		    board == das1701st_da || board == das1702st_da) {
-			printk(" Board model: %s\n",
-			       das1800_boards[board].name);
+			dev_dbg(dev->hw_dev, "Board model: %s\n",
+				das1800_boards[board].name);
 			return board;
 		}
-		printk
-		    (" Board model (probed, not recommended): das-1800st-da series\n");
+		dev_dbg(dev->hw_dev, "Board model (probed, not recommended): das-1800st-da series\n");
 		return das1801st;
 		break;
 	case 0x4:
 		if (board == das1802hr_da || board == das1702hr_da) {
-			printk(" Board model: %s\n",
-			       das1800_boards[board].name);
+			dev_dbg(dev->hw_dev, "Board model: %s\n",
+				das1800_boards[board].name);
 			return board;
 		}
-		printk
-		    (" Board model (probed, not recommended): das-1802hr-da\n");
+		dev_dbg(dev->hw_dev, "Board model (probed, not recommended): das-1802hr-da\n");
 		return das1802hr;
 		break;
 	case 0x5:
 		if (board == das1801ao || board == das1802ao ||
 		    board == das1701ao || board == das1702ao) {
-			printk(" Board model: %s\n",
-			       das1800_boards[board].name);
+			dev_dbg(dev->hw_dev, "Board model: %s\n",
+				das1800_boards[board].name);
 			return board;
 		}
-		printk
-		    (" Board model (probed, not recommended): das-1800ao series\n");
+		dev_dbg(dev->hw_dev, "Board model (probed, not recommended): das-1800ao series\n");
 		return das1801ao;
 		break;
 	case 0x6:
 		if (board == das1802hr || board == das1702hr) {
-			printk(" Board model: %s\n",
-			       das1800_boards[board].name);
+			dev_dbg(dev->hw_dev, "Board model: %s\n",
+				das1800_boards[board].name);
 			return board;
 		}
-		printk(" Board model (probed, not recommended): das-1802hr\n");
+		dev_dbg(dev->hw_dev, "Board model (probed, not recommended): das-1802hr\n");
 		return das1802hr;
 		break;
 	case 0x7:
 		if (board == das1801st || board == das1802st ||
 		    board == das1701st || board == das1702st) {
-			printk(" Board model: %s\n",
-			       das1800_boards[board].name);
+			dev_dbg(dev->hw_dev, "Board model: %s\n",
+				das1800_boards[board].name);
 			return board;
 		}
-		printk
-		    (" Board model (probed, not recommended): das-1800st series\n");
+		dev_dbg(dev->hw_dev, "Board model (probed, not recommended): das-1800st series\n");
 		return das1801st;
 		break;
 	case 0x8:
 		if (board == das1801hc || board == das1802hc) {
-			printk(" Board model: %s\n",
-			       das1800_boards[board].name);
+			dev_dbg(dev->hw_dev, "Board model: %s\n",
+				das1800_boards[board].name);
 			return board;
 		}
-		printk
-		    (" Board model (probed, not recommended): das-1800hc series\n");
+		dev_dbg(dev->hw_dev, "Board model (probed, not recommended): das-1800hc series\n");
 		return das1801hc;
 		break;
 	default:
-		printk
-		    (" Board model: probe returned 0x%x (unknown, please report)\n",
-		     id);
+		dev_dbg(dev->hw_dev, "Board model: probe returned 0x%x (unknown, please report)\n",
+			id);
 		return board;
 		break;
 	}
-- 
1.7.6.4


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

* [PATCH 23/24] Staging: comedi: fix printk issue in adv_pci1710.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (20 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 22/24] Staging: comedi: fix printk issue in das1800.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-20  6:19 ` [PATCH 24/24] Staging: comedi: fix code cleanup in daqboard2000.c Ravishankar Karkala Mallikarjunayya
  2011-10-23  8:18 ` [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Greg KH
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the adv_pci1710.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/adv_pci1710.c |   31 +++++++++----------------
 1 files changed, 11 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c
index da2b75b..b6efb85 100644
--- a/drivers/staging/comedi/drivers/adv_pci1710.c
+++ b/drivers/staging/comedi/drivers/adv_pci1710.c
@@ -1382,16 +1382,12 @@ static int pci1710_attach(struct comedi_device *dev,
 	int i;
 	int board_index;
 
-	printk("comedi%d: adv_pci1710: ", dev->minor);
-
 	opt_bus = it->options[0];
 	opt_slot = it->options[1];
 
 	ret = alloc_private(dev, sizeof(struct pci1710_private));
-	if (ret < 0) {
-		printk(" - Allocation failed!\n");
+	if (ret < 0)
 		return -ENOMEM;
-	}
 
 	/* Look for matching PCI device */
 	errstr = "not found!";
@@ -1436,10 +1432,10 @@ static int pci1710_attach(struct comedi_device *dev,
 
 	if (!pcidev) {
 		if (opt_bus || opt_slot) {
-			printk(" - Card at b:s %d:%d %s\n",
-			       opt_bus, opt_slot, errstr);
+			dev_dbg(dev->hw_dev, "Card at b:s %d:%d %s\n",
+				opt_bus, opt_slot, errstr);
 		} else {
-			printk(" - Card %s\n", errstr);
+			dev_dbg(dev->hw_dev, "Card %s\n", errstr);
 		}
 		return -EIO;
 	}
@@ -1450,8 +1446,8 @@ static int pci1710_attach(struct comedi_device *dev,
 	irq = pcidev->irq;
 	iobase = pci_resource_start(pcidev, 2);
 
-	printk(", b:s:f=%d:%d:%d, io=0x%4lx", pci_bus, pci_slot, pci_func,
-	       iobase);
+	dev_dbg(dev->hw_dev, "b:s:f=%d:%d:%d, io=0x%4lx", pci_bus, pci_slot,
+		pci_func, iobase);
 
 	dev->iobase = iobase;
 
@@ -1471,10 +1467,8 @@ static int pci1710_attach(struct comedi_device *dev,
 		n_subdevices++;
 
 	ret = alloc_subdevices(dev, n_subdevices);
-	if (ret < 0) {
-		printk(" - Allocation failed!\n");
+	if (ret < 0)
 		return ret;
-	}
 
 	pci1710_reset(dev);
 
@@ -1483,15 +1477,14 @@ static int pci1710_attach(struct comedi_device *dev,
 			if (request_irq(irq, interrupt_service_pci1710,
 					IRQF_SHARED, "Advantech PCI-1710",
 					dev)) {
-				printk
-				    (", unable to allocate IRQ %d, DISABLING IT",
-				     irq);
+				dev_dbg(dev->hw_dev, "unable to allocate IRQ %d, DISABLING IT\n",
+					irq);
 				irq = 0;	/* Can't use IRQ */
 			} else {
-				printk(", irq=%u", irq);
+				dev_dbg(dev->hw_dev, "irq=%u\n", irq);
 			}
 		} else {
-			printk(", IRQ disabled");
+			dev_dbg(dev->hw_dev, "IRQ disabled\n");
 		}
 	} else {
 		irq = 0;
@@ -1499,8 +1492,6 @@ static int pci1710_attach(struct comedi_device *dev,
 
 	dev->irq = irq;
 
-	printk(".\n");
-
 	subdev = 0;
 
 	if (this_board->n_aichan) {
-- 
1.7.6.4


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

* [PATCH 24/24] Staging: comedi: fix code cleanup in daqboard2000.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (21 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 23/24] Staging: comedi: fix printk issue in adv_pci1710.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-20  6:19 ` Ravishankar Karkala Mallikarjunayya
  2011-10-23  8:18 ` [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Greg KH
  23 siblings, 0 replies; 27+ messages in thread
From: Ravishankar Karkala Mallikarjunayya @ 2011-10-20  6:19 UTC (permalink / raw)
  To: gregkh, wfp5p; +Cc: devel, linux-kernel, Ravishankar Karkala Mallikarjunayya

This is a patch to the daqboard2000.c file that fixes up a
warning found by the checkpatch.pl tool.
Converted function name to "%s", __func__.
Converted printks to dev_printk.
Fixed brace coding style issue.
Removed unnecessary printk statements.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
---
 drivers/staging/comedi/drivers/daqboard2000.c |   74 +++++++++----------------
 1 files changed, 26 insertions(+), 48 deletions(-)

diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c
index 82be77d..43a2007 100644
--- a/drivers/staging/comedi/drivers/daqboard2000.c
+++ b/drivers/staging/comedi/drivers/daqboard2000.c
@@ -430,16 +430,14 @@ static int daqboard2000_ai_insn_read(struct comedi_device *dev,
 		/* Enable reading from the scanlist FIFO */
 		fpga->acqControl = DAQBOARD2000_SeqStartScanList;
 		for (timeout = 0; timeout < 20; timeout++) {
-			if (fpga->acqControl & DAQBOARD2000_AcqConfigPipeFull) {
+			if (fpga->acqControl & DAQBOARD2000_AcqConfigPipeFull)
 				break;
-			}
 			/* udelay(2); */
 		}
 		fpga->acqControl = DAQBOARD2000_AdcPacerEnable;
 		for (timeout = 0; timeout < 20; timeout++) {
-			if (fpga->acqControl & DAQBOARD2000_AcqLogicScanning) {
+			if (fpga->acqControl & DAQBOARD2000_AcqLogicScanning)
 				break;
-			}
 			/* udelay(2); */
 		}
 		for (timeout = 0; timeout < 20; timeout++) {
@@ -465,9 +463,8 @@ static int daqboard2000_ao_insn_read(struct comedi_device *dev,
 	int i;
 	int chan = CR_CHAN(insn->chanspec);
 
-	for (i = 0; i < insn->n; i++) {
+	for (i = 0; i < insn->n; i++)
 		data[i] = devpriv->ao_readback[chan];
-	}
 
 	return i;
 }
@@ -490,9 +487,8 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev,
 		/* fpga->dacControl = (chan + 2) * 0x0010 | 0x0001; udelay(1000); */
 		fpga->dacSetting[chan] = data[i];
 		for (timeout = 0; timeout < 20; timeout++) {
-			if ((fpga->dacControl & ((chan + 1) * 0x0010)) == 0) {
+			if ((fpga->dacControl & ((chan + 1) * 0x0010)) == 0)
 				break;
-			}
 			/* udelay(2); */
 		}
 		devpriv->ao_readback[chan] = data[i];
@@ -507,7 +503,7 @@ static int daqboard2000_ao_insn_write(struct comedi_device *dev,
 
 static void daqboard2000_resetLocalBus(struct comedi_device *dev)
 {
-	printk("daqboard2000_resetLocalBus\n");
+	dev_dbg(dev->hw_dev, "%s\n", __func__);
 	writel(DAQBOARD2000_SECRLocalBusHi, devpriv->plx + 0x6c);
 	udelay(10000);
 	writel(DAQBOARD2000_SECRLocalBusLo, devpriv->plx + 0x6c);
@@ -516,7 +512,7 @@ static void daqboard2000_resetLocalBus(struct comedi_device *dev)
 
 static void daqboard2000_reloadPLX(struct comedi_device *dev)
 {
-	printk("daqboard2000_reloadPLX\n");
+	dev_dbg(dev->hw_dev, "%s\n", __func__);
 	writel(DAQBOARD2000_SECRReloadLo, devpriv->plx + 0x6c);
 	udelay(10000);
 	writel(DAQBOARD2000_SECRReloadHi, devpriv->plx + 0x6c);
@@ -527,7 +523,7 @@ static void daqboard2000_reloadPLX(struct comedi_device *dev)
 
 static void daqboard2000_pulseProgPin(struct comedi_device *dev)
 {
-	printk("daqboard2000_pulseProgPin 1\n");
+	dev_dbg(dev->hw_dev, "%s\n", __func__);
 	writel(DAQBOARD2000_SECRProgPinHi, devpriv->plx + 0x6c);
 	udelay(10000);
 	writel(DAQBOARD2000_SECRProgPinLo, devpriv->plx + 0x6c);
@@ -578,17 +574,12 @@ static int initialize_daqboard2000(struct comedi_device *dev,
 	/* Check to make sure the serial eeprom is present on the board */
 	secr = readl(devpriv->plx + 0x6c);
 	if (!(secr & DAQBOARD2000_EEPROM_PRESENT)) {
-#ifdef DEBUG_EEPROM
-		printk("no serial eeprom\n");
-#endif
+		dev_dbg(dev->hw_dev, "no serial eeprom\n");
 		return -EIO;
 	}
 
 	for (retry = 0; retry < 3; retry++) {
-#ifdef DEBUG_EEPROM
-		printk("Programming EEPROM try %x\n", retry);
-#endif
-
+		dev_dbg(dev->hw_dev, "Programming EEPROM try %x\n", retry);
 		daqboard2000_resetLocalBus(dev);
 		daqboard2000_reloadPLX(dev);
 		daqboard2000_pulseProgPin(dev);
@@ -596,23 +587,19 @@ static int initialize_daqboard2000(struct comedi_device *dev,
 			for (i = 0; i < len; i++) {
 				if (cpld_array[i] == 0xff
 				    && cpld_array[i + 1] == 0x20) {
-#ifdef DEBUG_EEPROM
-					printk("Preamble found at %d\n", i);
-#endif
+					dev_dbg(dev->hw_dev, "Preamble found at %d\n",
+						i);
 					break;
 				}
 			}
 			for (; i < len; i += 2) {
 				int data =
 				    (cpld_array[i] << 8) + cpld_array[i + 1];
-				if (!daqboard2000_writeCPLD(dev, data)) {
+				if (!daqboard2000_writeCPLD(dev, data))
 					break;
-				}
 			}
 			if (i >= len) {
-#ifdef DEBUG_EEPROM
-				printk("Programmed\n");
-#endif
+				dev_dbg(dev->hw_dev, "Programmed\n");
 				daqboard2000_resetLocalBus(dev);
 				daqboard2000_reloadPLX(dev);
 				result = 0;
@@ -658,9 +645,8 @@ static void daqboard2000_activateReferenceDacs(struct comedi_device *dev)
 	/*  Set the + reference dac value in the FPGA */
 	fpga->refDacs = 0x80 | DAQBOARD2000_PosRefDacSelect;
 	for (timeout = 0; timeout < 20; timeout++) {
-		if ((fpga->dacControl & DAQBOARD2000_RefBusy) == 0) {
+		if ((fpga->dacControl & DAQBOARD2000_RefBusy) == 0)
 			break;
-		}
 		udelay(2);
 	}
 /*  printk("DAQBOARD2000_PosRefDacSelect %d\n", timeout);*/
@@ -668,9 +654,8 @@ static void daqboard2000_activateReferenceDacs(struct comedi_device *dev)
 	/*  Set the - reference dac value in the FPGA */
 	fpga->refDacs = 0x80 | DAQBOARD2000_NegRefDacSelect;
 	for (timeout = 0; timeout < 20; timeout++) {
-		if ((fpga->dacControl & DAQBOARD2000_RefBusy) == 0) {
+		if ((fpga->dacControl & DAQBOARD2000_RefBusy) == 0)
 			break;
-		}
 		udelay(2);
 	}
 /*  printk("DAQBOARD2000_NegRefDacSelect %d\n", timeout);*/
@@ -737,15 +722,12 @@ static int daqboard2000_attach(struct comedi_device *dev,
 	unsigned int aux_len;
 	int bus, slot;
 
-	printk("comedi%d: daqboard2000:", dev->minor);
-
 	bus = it->options[0];
 	slot = it->options[1];
 
 	result = alloc_private(dev, sizeof(struct daqboard2000_private));
-	if (result < 0) {
+	if (result < 0)
 		return -ENOMEM;
-	}
 	for (card = pci_get_device(0x1616, 0x0409, NULL);
 	     card != NULL; card = pci_get_device(0x1616, 0x0409, card)) {
 		if (bus || slot) {
@@ -759,10 +741,10 @@ static int daqboard2000_attach(struct comedi_device *dev,
 	}
 	if (!card) {
 		if (bus || slot)
-			printk(" no daqboard2000 found at bus/slot: %d/%d\n",
-			       bus, slot);
+			dev_dbg(dev->hw_dev, "no daqboard2000 found at bus/slot: %d/%d\n",
+				bus, slot);
 		else
-			printk(" no daqboard2000 found\n");
+			dev_dbg(dev->hw_dev, "no daqboard2000 found\n");
 		return -EIO;
 	} else {
 		u32 id;
@@ -772,7 +754,8 @@ static int daqboard2000_attach(struct comedi_device *dev,
 		      subsystem_device << 16) | card->subsystem_vendor;
 		for (i = 0; i < n_boardtypes; i++) {
 			if (boardtypes[i].id == id) {
-				printk(" %s", boardtypes[i].name);
+				dev_dbg(dev->hw_dev, "%s\n",
+					boardtypes[i].name);
 				dev->board_ptr = boardtypes + i;
 			}
 		}
@@ -786,7 +769,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
 
 	result = comedi_pci_enable(card, "daqboard2000");
 	if (result < 0) {
-		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;
 	}
 	devpriv->got_regions = 1;
@@ -794,9 +777,8 @@ static int daqboard2000_attach(struct comedi_device *dev,
 	    ioremap(pci_resource_start(card, 0), DAQBOARD2000_PLX_SIZE);
 	devpriv->daq =
 	    ioremap(pci_resource_start(card, 2), DAQBOARD2000_DAQ_SIZE);
-	if (!devpriv->plx || !devpriv->daq) {
+	if (!devpriv->plx || !devpriv->daq)
 		return -ENOMEM;
-	}
 
 	result = alloc_subdevices(dev, 3);
 	if (result < 0)
@@ -817,7 +799,7 @@ static int daqboard2000_attach(struct comedi_device *dev,
 	if (aux_data && aux_len) {
 		result = initialize_daqboard2000(dev, aux_data, aux_len);
 	} else {
-		printk("no FPGA initialization code, aborting\n");
+		dev_dbg(dev->hw_dev, "no FPGA initialization code, aborting\n");
 		result = -EIO;
 	}
 	if (result < 0)
@@ -857,30 +839,26 @@ static int daqboard2000_attach(struct comedi_device *dev,
 	result = subdev_8255_init(dev, s, daqboard2000_8255_cb,
 				  (unsigned long)(dev->iobase + 0x40));
 
-	printk("\n");
 out:
 	return result;
 }
 
 static int daqboard2000_detach(struct comedi_device *dev)
 {
-	printk("comedi%d: daqboard2000: remove\n", dev->minor);
 
 	if (dev->subdevices)
 		subdev_8255_cleanup(dev, dev->subdevices + 2);
 
-	if (dev->irq) {
+	if (dev->irq)
 		free_irq(dev->irq, dev);
-	}
 	if (devpriv) {
 		if (devpriv->daq)
 			iounmap(devpriv->daq);
 		if (devpriv->plx)
 			iounmap(devpriv->plx);
 		if (devpriv->pci_dev) {
-			if (devpriv->got_regions) {
+			if (devpriv->got_regions)
 				comedi_pci_disable(devpriv->pci_dev);
-			}
 			pci_dev_put(devpriv->pci_dev);
 		}
 	}
-- 
1.7.6.4


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

* Re: [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c
  2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
                   ` (22 preceding siblings ...)
  2011-10-20  6:19 ` [PATCH 24/24] Staging: comedi: fix code cleanup in daqboard2000.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-23  8:18 ` Greg KH
  23 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2011-10-23  8:18 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On Thu, Oct 20, 2011 at 11:48:47AM +0530, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the das6402.c file that fixes up a printk warning
> found by the checkpatch.pl tool.
> Added #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Why is this needed?  dev_printk() doesn't use it, right?  So it
shouldn't be needed here, or am I missing something?

greg k-h

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

* Re: [PATCH 02/24] Staging: comedi: fix printk coding style issue in
  2011-10-20  6:18 ` [PATCH 02/24] Staging: comedi: fix printk coding style issue in Ravishankar Karkala Mallikarjunayya
@ 2011-10-23  8:19   ` Greg KH
  0 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2011-10-23  8:19 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On Thu, Oct 20, 2011 at 11:48:48AM +0530, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the serial2002.c file that fixes up a printk warning
> found by the checkpatch.pl tool.
> Converted printks to pr_<level>.
> 
> Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@greenturtles.in>
> ---
>  drivers/staging/comedi/drivers/serial2002.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/serial2002.c b/drivers/staging/comedi/drivers/serial2002.c
> index ade2202..6bd07ec 100644
> --- a/drivers/staging/comedi/drivers/serial2002.c
> +++ b/drivers/staging/comedi/drivers/serial2002.c
> @@ -431,7 +431,8 @@ static int serial_2002_open(struct comedi_device *dev)
>  		}
>  
>  		tty_setspeed(devpriv->tty, devpriv->speed);
> -		poll_channel(devpriv->tty, 31);	/*  Start reading configuration */
> +		/* Start reading configuration */
> +		poll_channel(devpriv->tty, 31);
>  		while (1) {
>  			struct serial_data data;
>  
> @@ -824,7 +825,7 @@ static int serial2002_attach(struct comedi_device *dev,
>  {
>  	struct comedi_subdevice *s;
>  
> -	printk("comedi%d: serial2002: ", dev->minor);
> +	pr_debug("comedi%d: serial2002: attached\n", dev->minor);

You have a device, so use dev_dbg() instead of pr_debug()

>  	dev->board_name = thisboard->name;
>  	if (alloc_private(dev, sizeof(struct serial2002_private)) < 0)
>  		return -ENOMEM;
> @@ -832,7 +833,7 @@ static int serial2002_attach(struct comedi_device *dev,
>  	dev->close = serial_2002_close;
>  	devpriv->port = it->options[0];
>  	devpriv->speed = it->options[1];
> -	printk("/dev/ttyS%d @ %d\n", devpriv->port, devpriv->speed);
> +	pr_debug("/dev/ttyS%d @ %d\n", devpriv->port, devpriv->speed);
>  
>  	if (alloc_subdevices(dev, 5) < 0)
>  		return -ENOMEM;
> @@ -891,7 +892,7 @@ static int serial2002_detach(struct comedi_device *dev)
>  	struct comedi_subdevice *s;
>  	int i;
>  
> -	printk("comedi%d: serial2002: remove\n", dev->minor);
> +	pr_debug("comedi%d: serial2002: remove\n", dev->minor);

Same for the above two as well.

greg k-h

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

* Re: [PATCH 03/24] Staging: comedi: fix warning issue in pcl818.c
  2011-10-20  6:18 ` [PATCH 03/24] Staging: comedi: fix warning issue in pcl818.c Ravishankar Karkala Mallikarjunayya
@ 2011-10-23  8:20   ` Greg KH
  0 siblings, 0 replies; 27+ messages in thread
From: Greg KH @ 2011-10-23  8:20 UTC (permalink / raw)
  To: Ravishankar Karkala Mallikarjunayya; +Cc: gregkh, wfp5p, devel, linux-kernel

On Thu, Oct 20, 2011 at 11:48:49AM +0530, Ravishankar Karkala Mallikarjunayya wrote:
> This is a patch to the pcl818.c file that fixes up a warning
> found by the checkpatch.pl tool.
> Fix brace coding style and NULL initilization issue.
> Converted printks to dev_printk.
> Removed unnecessary printk statements.

That's a lot of different things all at once here.  Please only do one
"change" per patch.  So this should be split up into multiple patches.

Same goes for your other 24 patches, care to break them up as well, as
it's easier to review and verify that you got it correct.

thanks,

greg k-h

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

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

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20  6:18 [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 02/24] Staging: comedi: fix printk coding style issue in Ravishankar Karkala Mallikarjunayya
2011-10-23  8:19   ` Greg KH
2011-10-20  6:18 ` [PATCH 03/24] Staging: comedi: fix warning issue in pcl818.c Ravishankar Karkala Mallikarjunayya
2011-10-23  8:20   ` Greg KH
2011-10-20  6:18 ` [PATCH 04/24] Staging: comedi: fix code cleanup issue in pcmuio.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 05/24] Staging: comedi: fix printk issue in c6xdigio.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 06/24] Staging: comedi: fix printk issue in ni_pcimio.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 7/24] Staging: comedi: fix printk issue in ni_labpc_cs.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 08/24] Staging: comedi: fix printk issue in das800.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 9/24] Staging: comedi: fix warning issue in dt3000.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 10/24] Staging: comedi: fix printk issue in cb_pcidas64.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 11/24] Staging: comedi: fix printk issue in cb_pcidda.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 12/24] Staging: comedi: fix printk issue in cb_pcidio.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:18 ` [PATCH 13/24] Staging: comedi: fix printk issue in cb_pcimdas.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 14/24] Staging: comedi: fix printk issue in cb_pcimdda.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 15/24] Staging: comedi: fix printk issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 16/24] Staging: comedi: fix printk issue in amplc_pci230.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 17/24] Staging: comedi: fix printk issue in adv_pci_dio.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 18/24] Staging: comedi: fix printk issue in ni_at_a2150.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 19/24] Staging: comedi: fix warning issue in contec_pci_dio.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 20/24] Staging: comedi: fix printk issue in cb_pcidas.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 21/24] Staging: comedi: fix warning issue in cb_das16_cs.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 22/24] Staging: comedi: fix printk issue in das1800.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 23/24] Staging: comedi: fix printk issue in adv_pci1710.c Ravishankar Karkala Mallikarjunayya
2011-10-20  6:19 ` [PATCH 24/24] Staging: comedi: fix code cleanup in daqboard2000.c Ravishankar Karkala Mallikarjunayya
2011-10-23  8:18 ` [PATCH 01/24] Staging: comedi: fix printk issue in das6402.c Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).