提交 c41fba13 编写于 作者: G Greg Kroah-Hartman

USB: rio500.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: Cesar Miquel <miquel@df.uba.ar>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 9d974b2a
...@@ -171,7 +171,9 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -171,7 +171,9 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
if (result == -ETIMEDOUT) if (result == -ETIMEDOUT)
retries--; retries--;
else if (result < 0) { else if (result < 0) {
err("Error executing ioctrl. code = %d", result); dev_err(&rio->rio_dev->dev,
"Error executing ioctrl. code = %d\n",
result);
retries = 0; retries = 0;
} else { } else {
dbg("Executed ioctl. Result = %d (data=%02x)", dbg("Executed ioctl. Result = %d (data=%02x)",
...@@ -238,7 +240,9 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -238,7 +240,9 @@ static long ioctl_rio(struct file *file, unsigned int cmd, unsigned long arg)
if (result == -ETIMEDOUT) if (result == -ETIMEDOUT)
retries--; retries--;
else if (result < 0) { else if (result < 0) {
err("Error executing ioctrl. code = %d", result); dev_err(&rio->rio_dev->dev,
"Error executing ioctrl. code = %d\n",
result);
retries = 0; retries = 0;
} else { } else {
dbg("Executed ioctl. Result = %d", result); dbg("Executed ioctl. Result = %d", result);
...@@ -332,7 +336,8 @@ write_rio(struct file *file, const char __user *buffer, ...@@ -332,7 +336,8 @@ write_rio(struct file *file, const char __user *buffer,
break; break;
}; };
if (result) { if (result) {
err("Write Whoops - %x", result); dev_err(&rio->rio_dev->dev, "Write Whoops - %x\n",
result);
errn = -EIO; errn = -EIO;
goto error; goto error;
} }
...@@ -401,7 +406,8 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) ...@@ -401,7 +406,8 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
} else if (result == -ETIMEDOUT || result == 15) { /* FIXME: 15 ??? */ } else if (result == -ETIMEDOUT || result == 15) { /* FIXME: 15 ??? */
if (!maxretry--) { if (!maxretry--) {
mutex_unlock(&(rio->lock)); mutex_unlock(&(rio->lock));
err("read_rio: maxretry timeout"); dev_err(&rio->rio_dev->dev,
"read_rio: maxretry timeout\n");
return -ETIME; return -ETIME;
} }
prepare_to_wait(&rio->wait_q, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(&rio->wait_q, &wait, TASK_INTERRUPTIBLE);
...@@ -410,7 +416,8 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos) ...@@ -410,7 +416,8 @@ read_rio(struct file *file, char __user *buffer, size_t count, loff_t * ppos)
continue; continue;
} else if (result != -EREMOTEIO) { } else if (result != -EREMOTEIO) {
mutex_unlock(&(rio->lock)); mutex_unlock(&(rio->lock));
err("Read Whoops - result:%u partial:%u this_read:%u", dev_err(&rio->rio_dev->dev,
"Read Whoops - result:%u partial:%u this_read:%u\n",
result, partial, this_read); result, partial, this_read);
return -EIO; return -EIO;
} else { } else {
...@@ -459,21 +466,24 @@ static int probe_rio(struct usb_interface *intf, ...@@ -459,21 +466,24 @@ static int probe_rio(struct usb_interface *intf,
retval = usb_register_dev(intf, &usb_rio_class); retval = usb_register_dev(intf, &usb_rio_class);
if (retval) { if (retval) {
err("Not able to get a minor for this device."); dev_err(&dev->dev,
"Not able to get a minor for this device.\n");
return -ENOMEM; return -ENOMEM;
} }
rio->rio_dev = dev; rio->rio_dev = dev;
if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) { if (!(rio->obuf = kmalloc(OBUF_SIZE, GFP_KERNEL))) {
err("probe_rio: Not enough memory for the output buffer"); dev_err(&dev->dev,
"probe_rio: Not enough memory for the output buffer\n");
usb_deregister_dev(intf, &usb_rio_class); usb_deregister_dev(intf, &usb_rio_class);
return -ENOMEM; return -ENOMEM;
} }
dbg("probe_rio: obuf address:%p", rio->obuf); dbg("probe_rio: obuf address:%p", rio->obuf);
if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) { if (!(rio->ibuf = kmalloc(IBUF_SIZE, GFP_KERNEL))) {
err("probe_rio: Not enough memory for the input buffer"); dev_err(&dev->dev,
"probe_rio: Not enough memory for the input buffer\n");
usb_deregister_dev(intf, &usb_rio_class); usb_deregister_dev(intf, &usb_rio_class);
kfree(rio->obuf); kfree(rio->obuf);
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册