Commit 21ef9fc9 authored by Brad Hards's avatar Brad Hards Committed by Greg Kroah-Hartman

[PATCH] USB: printk janitorial fixes

Part 2, printk fixups for a the tiglusb and emi26 drivers.
parent 1677b6d0
...@@ -54,7 +54,7 @@ static int emi26_writememory (struct usb_device *dev, int address, unsigned char ...@@ -54,7 +54,7 @@ static int emi26_writememory (struct usb_device *dev, int address, unsigned char
unsigned char *buffer = kmalloc (length, GFP_KERNEL); unsigned char *buffer = kmalloc (length, GFP_KERNEL);
if (!buffer) { if (!buffer) {
printk(KERN_ERR "emi26: kmalloc(%d) failed.", length); err("emi26: kmalloc(%d) failed.", length);
return -ENOMEM; return -ENOMEM;
} }
memcpy (buffer, data, length); memcpy (buffer, data, length);
...@@ -69,11 +69,11 @@ static int emi26_writememory (struct usb_device *dev, int address, unsigned char ...@@ -69,11 +69,11 @@ static int emi26_writememory (struct usb_device *dev, int address, unsigned char
static int emi26_set_reset (struct usb_device *dev, unsigned char reset_bit) static int emi26_set_reset (struct usb_device *dev, unsigned char reset_bit)
{ {
int response; int response;
printk(KERN_INFO "%s - %d", __FUNCTION__, reset_bit); info("%s - %d", __FUNCTION__, reset_bit);
/* printk(KERN_DEBUG "%s - %d", __FUNCTION__, reset_bit); */ /* printk(KERN_DEBUG "%s - %d", __FUNCTION__, reset_bit); */
response = emi26_writememory (dev, CPUCS_REG, &reset_bit, 1, 0xa0); response = emi26_writememory (dev, CPUCS_REG, &reset_bit, 1, 0xa0);
if (response < 0) { if (response < 0) {
printk(KERN_ERR "emi26: set_reset (%d) failed", reset_bit); err("emi26: set_reset (%d) failed", reset_bit);
} }
return response; return response;
} }
...@@ -89,7 +89,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -89,7 +89,7 @@ static int emi26_load_firmware (struct usb_device *dev)
/* Assert reset (stop the CPU in the EMI) */ /* Assert reset (stop the CPU in the EMI) */
err = emi26_set_reset(dev,1); err = emi26_set_reset(dev,1);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err( "%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
...@@ -97,7 +97,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -97,7 +97,7 @@ static int emi26_load_firmware (struct usb_device *dev)
for (i=0; g_Loader[i].type == 0; i++) { for (i=0; g_Loader[i].type == 0; i++) {
err = emi26_writememory(dev, g_Loader[i].address, g_Loader[i].data, g_Loader[i].length, ANCHOR_LOAD_INTERNAL); err = emi26_writememory(dev, g_Loader[i].address, g_Loader[i].data, g_Loader[i].length, ANCHOR_LOAD_INTERNAL);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
} }
...@@ -120,7 +120,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -120,7 +120,7 @@ static int emi26_load_firmware (struct usb_device *dev)
} }
err = emi26_writememory(dev, addr, buf, i, ANCHOR_LOAD_FPGA); err = emi26_writememory(dev, addr, buf, i, ANCHOR_LOAD_FPGA);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
} while (i > 0); } while (i > 0);
...@@ -128,7 +128,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -128,7 +128,7 @@ static int emi26_load_firmware (struct usb_device *dev)
/* Assert reset (stop the CPU in the EMI) */ /* Assert reset (stop the CPU in the EMI) */
err = emi26_set_reset(dev,1); err = emi26_set_reset(dev,1);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
...@@ -136,7 +136,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -136,7 +136,7 @@ static int emi26_load_firmware (struct usb_device *dev)
for (i=0; g_Loader[i].type == 0; i++) { for (i=0; g_Loader[i].type == 0; i++) {
err = emi26_writememory(dev, g_Loader[i].address, g_Loader[i].data, g_Loader[i].length, ANCHOR_LOAD_INTERNAL); err = emi26_writememory(dev, g_Loader[i].address, g_Loader[i].data, g_Loader[i].length, ANCHOR_LOAD_INTERNAL);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
} }
...@@ -144,7 +144,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -144,7 +144,7 @@ static int emi26_load_firmware (struct usb_device *dev)
/* De-assert reset (let the CPU run) */ /* De-assert reset (let the CPU run) */
err = emi26_set_reset(dev,0); err = emi26_set_reset(dev,0);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
...@@ -153,7 +153,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -153,7 +153,7 @@ static int emi26_load_firmware (struct usb_device *dev)
if (!INTERNAL_RAM(g_Firmware[i].address)) { if (!INTERNAL_RAM(g_Firmware[i].address)) {
err = emi26_writememory(dev, g_Firmware[i].address, g_Firmware[i].data, g_Firmware[i].length, ANCHOR_LOAD_EXTERNAL); err = emi26_writememory(dev, g_Firmware[i].address, g_Firmware[i].data, g_Firmware[i].length, ANCHOR_LOAD_EXTERNAL);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
} }
...@@ -162,7 +162,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -162,7 +162,7 @@ static int emi26_load_firmware (struct usb_device *dev)
/* Assert reset (stop the CPU in the EMI) */ /* Assert reset (stop the CPU in the EMI) */
err = emi26_set_reset(dev,1); err = emi26_set_reset(dev,1);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
...@@ -170,7 +170,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -170,7 +170,7 @@ static int emi26_load_firmware (struct usb_device *dev)
if (INTERNAL_RAM(g_Firmware[i].address)) { if (INTERNAL_RAM(g_Firmware[i].address)) {
err = emi26_writememory(dev, g_Firmware[i].address, g_Firmware[i].data, g_Firmware[i].length, ANCHOR_LOAD_INTERNAL); err = emi26_writememory(dev, g_Firmware[i].address, g_Firmware[i].data, g_Firmware[i].length, ANCHOR_LOAD_INTERNAL);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
} }
...@@ -179,7 +179,7 @@ static int emi26_load_firmware (struct usb_device *dev) ...@@ -179,7 +179,7 @@ static int emi26_load_firmware (struct usb_device *dev)
/* De-assert reset (let the CPU run) */ /* De-assert reset (let the CPU run) */
err = emi26_set_reset(dev,0); err = emi26_set_reset(dev,0);
if (err < 0) { if (err < 0) {
printk(KERN_ERR "%s - error loading firmware: error = %d", __FUNCTION__, err); err("%s - error loading firmware: error = %d", __FUNCTION__, err);
return err; return err;
} }
...@@ -197,7 +197,7 @@ MODULE_DEVICE_TABLE (usb, id_table); ...@@ -197,7 +197,7 @@ MODULE_DEVICE_TABLE (usb, id_table);
static void * emi26_probe(struct usb_device *dev, unsigned int if_num, const struct usb_device_id *id) static void * emi26_probe(struct usb_device *dev, unsigned int if_num, const struct usb_device_id *id)
{ {
printk(KERN_INFO "%s start", __FUNCTION__); info("%s start", __FUNCTION__);
if((dev->descriptor.idVendor == EMI26_VENDOR_ID) && (dev->descriptor.idProduct == EMI26_PRODUCT_ID)) { if((dev->descriptor.idVendor == EMI26_VENDOR_ID) && (dev->descriptor.idProduct == EMI26_PRODUCT_ID)) {
emi26_load_firmware(dev); emi26_load_firmware(dev);
......
...@@ -60,7 +60,7 @@ static void usblp_cleanup (tiglusb_t * s) ...@@ -60,7 +60,7 @@ static void usblp_cleanup (tiglusb_t * s)
static int clear_device (struct usb_device *dev) static int clear_device (struct usb_device *dev)
{ {
if (usb_set_configuration (dev, dev->config[0].bConfigurationValue) < 0) { if (usb_set_configuration (dev, dev->config[0].bConfigurationValue) < 0) {
printk ("tiglusb: clear_device failed\n"); err ("tiglusb: clear_device failed");
return -1; return -1;
} }
...@@ -74,13 +74,13 @@ static int clear_pipes (struct usb_device *dev) ...@@ -74,13 +74,13 @@ static int clear_pipes (struct usb_device *dev)
pipe = usb_sndbulkpipe (dev, 1); pipe = usb_sndbulkpipe (dev, 1);
if (usb_clear_halt (dev, usb_pipeendpoint (pipe))) { if (usb_clear_halt (dev, usb_pipeendpoint (pipe))) {
printk ("tiglusb: clear_pipe (r), request failed\n"); err("tiglusb: clear_pipe (r), request failed");
return -1; return -1;
} }
pipe = usb_sndbulkpipe (dev, 2); pipe = usb_sndbulkpipe (dev, 2);
if (usb_clear_halt (dev, usb_pipeendpoint (pipe))) { if (usb_clear_halt (dev, usb_pipeendpoint (pipe))) {
printk ("tiglusb: clear_pipe (w), request failed\n"); err ("tiglusb: clear_pipe (w), request failed");
return -1; return -1;
} }
...@@ -171,7 +171,7 @@ static ssize_t tiglusb_read (struct file *file, char *buf, size_t count, loff_t ...@@ -171,7 +171,7 @@ static ssize_t tiglusb_read (struct file *file, char *buf, size_t count, loff_t
if (result == -ETIMEDOUT) { /* NAK */ if (result == -ETIMEDOUT) { /* NAK */
ret = result; ret = result;
if (!bytes_read) { if (!bytes_read) {
printk ("quirk !\n"); warn ("quirk !");
} }
warn ("tiglusb_read, NAK received."); warn ("tiglusb_read, NAK received.");
goto out; goto out;
...@@ -233,7 +233,7 @@ static ssize_t tiglusb_write (struct file *file, const char *buf, size_t count, ...@@ -233,7 +233,7 @@ static ssize_t tiglusb_write (struct file *file, const char *buf, size_t count,
} else if (result == -EPIPE) { /* STALL -- shouldn't happen */ } else if (result == -EPIPE) { /* STALL -- shouldn't happen */
warn ("CLEAR_FEATURE request to remove STALL condition."); warn ("CLEAR_FEATURE request to remove STALL condition.");
if (usb_clear_halt (s->dev, usb_pipeendpoint (pipe))) if (usb_clear_halt (s->dev, usb_pipeendpoint (pipe)))
warn ("send_packet, request failed\n"); warn ("send_packet, request failed");
//clear_device(s->dev); //clear_device(s->dev);
ret = result; ret = result;
goto out; goto out;
...@@ -273,12 +273,12 @@ static int tiglusb_ioctl (struct inode *inode, struct file *file, ...@@ -273,12 +273,12 @@ static int tiglusb_ioctl (struct inode *inode, struct file *file,
timeout = arg; // timeout value in tenth of seconds timeout = arg; // timeout value in tenth of seconds
break; break;
case IOCTL_TIUSB_RESET_DEVICE: case IOCTL_TIUSB_RESET_DEVICE:
printk (KERN_DEBUG "IOCTL_TIGLUSB_RESET_DEVICE\n"); dbg ("IOCTL_TIGLUSB_RESET_DEVICE");
if (clear_device (s->dev)) if (clear_device (s->dev))
ret = -EIO; ret = -EIO;
break; break;
case IOCTL_TIUSB_RESET_PIPES: case IOCTL_TIUSB_RESET_PIPES:
printk (KERN_DEBUG "IOCTL_TIGLUSB_RESET_PIPES\n"); dbg ("IOCTL_TIGLUSB_RESET_PIPES");
if (clear_pipes (s->dev)) if (clear_pipes (s->dev))
ret = -EIO; ret = -EIO;
break; break;
...@@ -326,8 +326,8 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum, ...@@ -326,8 +326,8 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum,
ptiglusb_t s; ptiglusb_t s;
char name[8]; char name[8];
printk ("tiglusb: probing vendor id 0x%x, device id 0x%x ifnum:%d\n", dbg ("tiglusb: probing vendor id 0x%x, device id 0x%x ifnum:%d",
dev->descriptor.idVendor, dev->descriptor.idProduct, ifnum); dev->descriptor.idVendor, dev->descriptor.idProduct, ifnum);
/* /*
* We don't handle multiple configurations. As of version 0x0103 of * We don't handle multiple configurations. As of version 0x0103 of
...@@ -341,7 +341,7 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum, ...@@ -341,7 +341,7 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum,
return NULL; return NULL;
if (usb_set_configuration (dev, dev->config[0].bConfigurationValue) < 0) { if (usb_set_configuration (dev, dev->config[0].bConfigurationValue) < 0) {
printk ("tiglusb_probe: set_configuration failed\n"); err ("tiglusb_probe: set_configuration failed");
return NULL; return NULL;
} }
...@@ -358,7 +358,7 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum, ...@@ -358,7 +358,7 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum,
dbg ("bound to interface: %d", ifnum); dbg ("bound to interface: %d", ifnum);
sprintf (name, "%d", s->minor); sprintf (name, "%d", s->minor);
printk ("tiglusb: registering to devfs : major = %d, minor = %d, node = %s\n", TIUSB_MAJOR, info ("tiglusb: registering to devfs : major = %d, minor = %d, node = %s", TIUSB_MAJOR,
(TIUSB_MINOR + s->minor), name); (TIUSB_MINOR + s->minor), name);
s->devfs = s->devfs =
devfs_register (devfs_handle, name, DEVFS_FL_DEFAULT, TIUSB_MAJOR, devfs_register (devfs_handle, name, DEVFS_FL_DEFAULT, TIUSB_MAJOR,
...@@ -366,7 +366,7 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum, ...@@ -366,7 +366,7 @@ static void *tiglusb_probe (struct usb_device *dev, unsigned int ifnum,
NULL); NULL);
/* Display firmware version */ /* Display firmware version */
printk ("tiglusb: link cable version %i.%02x\n", info ("tiglusb: link cable version %i.%02x",
dev->descriptor.bcdDevice >> 8, dev->descriptor.bcdDevice & 0xff); dev->descriptor.bcdDevice >> 8, dev->descriptor.bcdDevice & 0xff);
return s; return s;
...@@ -377,7 +377,7 @@ static void tiglusb_disconnect (struct usb_device *dev, void *drv_context) ...@@ -377,7 +377,7 @@ static void tiglusb_disconnect (struct usb_device *dev, void *drv_context)
ptiglusb_t s = (ptiglusb_t) drv_context; ptiglusb_t s = (ptiglusb_t) drv_context;
if (!s || !s->dev) if (!s || !s->dev)
printk ("bogus disconnect"); warn ("bogus disconnect");
s->remove_pending = 1; s->remove_pending = 1;
wake_up (&s->wait); wake_up (&s->wait);
...@@ -396,7 +396,7 @@ static void tiglusb_disconnect (struct usb_device *dev, void *drv_context) ...@@ -396,7 +396,7 @@ static void tiglusb_disconnect (struct usb_device *dev, void *drv_context)
/* unregister device */ /* unregister device */
devfs_unregister (s->devfs); devfs_unregister (s->devfs);
s->devfs = NULL; s->devfs = NULL;
printk ("tiglusb: device disconnected\n"); info ("tiglusb: device disconnected");
} }
static struct usb_device_id tiglusb_ids[] = { static struct usb_device_id tiglusb_ids[] = {
...@@ -452,7 +452,7 @@ static int __init tiglusb_init (void) ...@@ -452,7 +452,7 @@ static int __init tiglusb_init (void)
/* register device */ /* register device */
if (devfs_register_chrdev (TIUSB_MAJOR, "tiglusb", &tiglusb_fops)) { if (devfs_register_chrdev (TIUSB_MAJOR, "tiglusb", &tiglusb_fops)) {
printk ("tiglusb: unable to get major %d\n", TIUSB_MAJOR); err ("tiglusb: unable to get major %d", TIUSB_MAJOR);
return -EIO; return -EIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment