[PATCH 06/25] Staging: comedi: fix printk issue in usbduxfast.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a patch to the usbduxfast.c file that fixes up a printk found
by the checkpatch.pl tool.

Used dev_*() functions instead of printks wherver possible and fixed
a quoted string split across line warnings.

Signed-off-by: Ravishankar Karkala Mallikarjunayya <ravishankar.km@xxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/usbduxfast.c |   31 ++++++++++++--------------
 1 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c
index e66c1f3..3824d51 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -1637,9 +1637,8 @@ static int usbduxfast_attach(struct comedi_device *dev,
 	}
 
 	if (index < 0) {
-		printk(KERN_ERR "comedi%d: usbduxfast: error: attach failed, "
-		       "no usbduxfast devs connected to the usb bus.\n",
-		       dev->minor);
+		dev_err(dev->hw_dev, "comedi%d: error: attach failed, no usbduxfast devs connected to the usb bus.\n",
+			dev->minor);
 		up(&start_stop_sem);
 		return -ENODEV;
 	}
@@ -1664,15 +1663,15 @@ static int usbduxfast_attach(struct comedi_device *dev,
 	/* allocate space for the subdevices */
 	ret = alloc_subdevices(dev, N_SUBDEVICES);
 	if (ret < 0) {
-		printk(KERN_ERR "comedi%d: usbduxfast: error alloc space for "
-		       "subdev\n", dev->minor);
+		dev_err(dev->hw_dev, "comedi%d: error alloc space for subdev\n",
+			dev->minor);
 		up(&(usbduxfastsub[index].sem));
 		up(&start_stop_sem);
 		return ret;
 	}
 
-	printk(KERN_INFO "comedi%d: usbduxfast: usb-device %d is attached to "
-	       "comedi.\n", dev->minor, index);
+	dev_info(dev->hw_dev, "comedi%d: usb-device %d is attached to comedi.\n",
+		 dev->minor, index);
 	/* private structure is also simply the usb-structure */
 	dev->private = usbduxfastsub + index;
 	/* the first subdevice is the A/D converter */
@@ -1707,8 +1706,8 @@ static int usbduxfast_attach(struct comedi_device *dev,
 
 	up(&(usbduxfastsub[index].sem));
 	up(&start_stop_sem);
-	printk(KERN_INFO "comedi%d: successfully attached to usbduxfast.\n",
-	       dev->minor);
+	dev_info(dev->hw_dev, "comedi%d: successfully attached to usbduxfast.\n",
+		 dev->minor);
 
 	return 0;
 }
@@ -1718,19 +1717,17 @@ static int usbduxfast_detach(struct comedi_device *dev)
 	struct usbduxfastsub_s *udfs;
 
 	if (!dev) {
-		printk(KERN_ERR "comedi?: usbduxfast: detach without dev "
-		       "variable...\n");
+		dev_err(dev->hw_dev, "comedi?: detach without dev variable...\n");
 		return -EFAULT;
 	}
 #ifdef CONFIG_COMEDI_DEBUG
-	printk(KERN_DEBUG "comedi%d: usbduxfast: detach usb device\n",
-	       dev->minor);
+	dev_dbg(dev->hw_dev, "comedi%d: detach usb device\n",
+		dev->minor);
 #endif
 
 	udfs = dev->private;
 	if (!udfs) {
-		printk(KERN_ERR "comedi?: usbduxfast: detach without ptr to "
-		       "usbduxfastsub[]\n");
+		dev_err(dev->hw_dev, "comedi?: detach without ptr to usbduxfastsub[]\n");
 		return -EFAULT;
 	}
 
@@ -1744,8 +1741,8 @@ static int usbduxfast_detach(struct comedi_device *dev)
 	udfs->attached = 0;
 	udfs->comedidev = NULL;
 #ifdef CONFIG_COMEDI_DEBUG
-	printk(KERN_DEBUG "comedi%d: usbduxfast: detach: successfully "
-	       "removed\n", dev->minor);
+	dev_dbg(dev->hw_dev, "comedi%d: detach: successfully removed\n",
+		dev->minor);
 #endif
 	up(&start_stop_sem);
 	up(&udfs->sem);
-- 
1.7.0.4

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux