[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1325680806-10917-5-git-send-email-ravishankar.km@greenturtles.in>
Date: Wed, 4 Jan 2012 18:10:00 +0530
From: Ravishankar karkala Mallikarjunayya
<ravishankar.km@...enturtles.in>
To: gregkh@...e.de, wfp5p@...ginia.edu
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
dan.carpenter@...cle.com, rmallon@...il.com, joe@...ches.com,
valdis.kletnieks@...edu,
Ravishankar karkala Mallikarjunayya
<ravishankar.km@...enturtles.in>
Subject: [PATCH 05/11] Staging: comedi: fix printk warning issue in ni_at_a2150.c
This patch fixes a printk warning found by the checkpatch.pl tool.
Convert printk messages to dev_<levels> and removes useless printk
messages.
Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@...enturtles.in>
---
drivers/staging/comedi/drivers/ni_at_a2150.c | 51 ++++++--------------------
1 files changed, 12 insertions(+), 39 deletions(-)
diff --git a/drivers/staging/comedi/drivers/ni_at_a2150.c b/drivers/staging/comedi/drivers/ni_at_a2150.c
index c25e44c..f1a15ed 100644
--- a/drivers/staging/comedi/drivers/ni_at_a2150.c
+++ b/drivers/staging/comedi/drivers/ni_at_a2150.c
@@ -215,9 +215,10 @@ module_exit(driver_a2150_cleanup_module);
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
@@ -347,61 +348,35 @@ 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 {
- printk(", no irq");
- }
- if (dma) {
- printk(", dma %u", dma);
- } 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");
+ if (iobase == 0)
return -EINVAL;
- }
/* check if io addresses are available */
- if (!request_region(iobase, A2150_SIZE, driver_a2150.driver_name)) {
- printk(" I/O port conflict\n");
+ if (!request_region(iobase, A2150_SIZE, driver_a2150.driver_name))
return -EIO;
- }
dev->iobase = iobase;
/* grab our IRQ */
if (irq) {
- /* check that irq is supported */
- if (irq < 3 || irq == 8 || irq == 13 || irq > 15) {
- printk(" invalid irq line %u\n", irq);
+ /* check that irq is supported */
+ if (irq < 3 || irq == 8 || irq == 13 || irq > 15)
return -EINVAL;
- }
if (request_irq(irq, a2150_interrupt, 0,
- driver_a2150.driver_name, dev)) {
- printk("unable to allocate irq %u\n", irq);
+ driver_a2150.driver_name, dev))
return -EINVAL;
- }
devpriv->irq_dma_bits |= IRQ_LVL_BITS(irq);
dev->irq = irq;
}
/* initialize dma */
if (dma) {
- if (dma == 4 || dma > 7) {
- printk(" invalid dma channel %u\n", dma);
+ if (dma == 4 || dma > 7)
return -EINVAL;
- }
- if (request_dma(dma, driver_a2150.driver_name)) {
- printk(" failed to allocate dma channel %u\n", dma);
+ if (request_dma(dma, driver_a2150.driver_name))
return -EINVAL;
- }
devpriv->dma = dma;
devpriv->dma_buffer =
kmalloc(A2150_DMA_BUFFER_SIZE, GFP_KERNEL | GFP_DMA);
@@ -466,8 +441,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) {
/* put board in power-down mode */
@@ -801,7 +774,7 @@ static int a2150_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
#endif
data[n] = inw(dev->iobase + FIFO_DATA_REG);
#ifdef A2150_DEBUG
- printk(" data is %i\n", data[n]);
+ dev_dbg(dev->hw_dev "data is %i\n", data[n]);
#endif
data[n] ^= 0x8000;
}
--
1.7.0.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists