Commit abd83e4b authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB: usblcd.c: remove err() usage

err() was a very old USB-specific macro that I thought had
gone away.  This patch removes it from being used in the
driver and uses dev_err() instead.

CC: Zack Parsons <k3bacon@gmail.com>
CC: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
CC: Sarah Sharp <sarah.a.sharp@linux.intel.com>
CC: Felipe Balbi <balbi@ti.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c41fba13
...@@ -87,8 +87,8 @@ static int lcd_open(struct inode *inode, struct file *file) ...@@ -87,8 +87,8 @@ static int lcd_open(struct inode *inode, struct file *file)
interface = usb_find_interface(&lcd_driver, subminor); interface = usb_find_interface(&lcd_driver, subminor);
if (!interface) { if (!interface) {
mutex_unlock(&lcd_mutex); mutex_unlock(&lcd_mutex);
err("USBLCD: %s - error, can't find device for minor %d", printk(KERN_ERR "USBLCD: %s - error, can't find device for minor %d\n",
__func__, subminor); __func__, subminor);
return -ENODEV; return -ENODEV;
} }
...@@ -268,8 +268,9 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, ...@@ -268,8 +268,9 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer,
/* send the data out the bulk port */ /* send the data out the bulk port */
retval = usb_submit_urb(urb, GFP_KERNEL); retval = usb_submit_urb(urb, GFP_KERNEL);
if (retval) { if (retval) {
err("USBLCD: %s - failed submitting write urb, error %d", dev_err(&dev->udev->dev,
__func__, retval); "%s - failed submitting write urb, error %d\n",
__func__, retval);
goto error_unanchor; goto error_unanchor;
} }
...@@ -322,7 +323,7 @@ static int lcd_probe(struct usb_interface *interface, ...@@ -322,7 +323,7 @@ static int lcd_probe(struct usb_interface *interface,
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(*dev), GFP_KERNEL); dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (dev == NULL) { if (dev == NULL) {
err("Out of memory"); dev_err(&interface->dev, "Out of memory\n");
goto error; goto error;
} }
kref_init(&dev->kref); kref_init(&dev->kref);
...@@ -352,7 +353,8 @@ static int lcd_probe(struct usb_interface *interface, ...@@ -352,7 +353,8 @@ static int lcd_probe(struct usb_interface *interface,
dev->bulk_in_endpointAddr = endpoint->bEndpointAddress; dev->bulk_in_endpointAddr = endpoint->bEndpointAddress;
dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL); dev->bulk_in_buffer = kmalloc(buffer_size, GFP_KERNEL);
if (!dev->bulk_in_buffer) { if (!dev->bulk_in_buffer) {
err("Could not allocate bulk_in_buffer"); dev_err(&interface->dev,
"Could not allocate bulk_in_buffer\n");
goto error; goto error;
} }
} }
...@@ -364,7 +366,8 @@ static int lcd_probe(struct usb_interface *interface, ...@@ -364,7 +366,8 @@ static int lcd_probe(struct usb_interface *interface,
} }
} }
if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) { if (!(dev->bulk_in_endpointAddr && dev->bulk_out_endpointAddr)) {
err("Could not find both bulk-in and bulk-out endpoints"); dev_err(&interface->dev,
"Could not find both bulk-in and bulk-out endpoints\n");
goto error; goto error;
} }
...@@ -375,7 +378,8 @@ static int lcd_probe(struct usb_interface *interface, ...@@ -375,7 +378,8 @@ static int lcd_probe(struct usb_interface *interface,
retval = usb_register_dev(interface, &lcd_class); retval = usb_register_dev(interface, &lcd_class);
if (retval) { if (retval) {
/* something prevented us from registering this driver */ /* something prevented us from registering this driver */
err("Not able to get a minor for this device."); dev_err(&interface->dev,
"Not able to get a minor for this device.\n");
usb_set_intfdata(interface, NULL); usb_set_intfdata(interface, NULL);
goto error; goto error;
} }
......
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