Commit 8c6ccbeb authored by Haneen Mohammed's avatar Haneen Mohammed Committed by Greg Kroah-Hartman

Staging: media: clean dev_err logging

This patch removes  __func__ from dev_err. dev_err includes information about:
(devcice, driver, specific instance of device, etc) in the log printout.
This was done using Coccinelle, with the following semantic patch:

@A@
expression E, R;
expression  msg;
@@

dev_err(E, msg, __func__, R);

@script:python b@
e << a.msg;
y;
@@

if(e.find("%s: ") == True):
	m = e.replace("%s: ", "", 1);
	coccinelle.y = m;
elif(e.find("%s ") == True):
	m = e.replace("%s ", "", 1);
	coccinelle.y = m;
elif(e.find("%s:") == True):
	m = e.replace("%s:", "", 1);
	coccinelle.y = m;
else:
	m = e.replace("%s", "",1);
	coccinelle.y = m;

@c@
expression a.E, a.msg, a.R;
identifier  b.y;
@@

- dev_err(E, msg, __func__, R);
+ dev_err(E, y, R);
Signed-off-by: default avatarHaneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aed1c72e
...@@ -208,8 +208,7 @@ static void deregister_from_lirc(struct imon_context *context) ...@@ -208,8 +208,7 @@ static void deregister_from_lirc(struct imon_context *context)
retval = lirc_unregister_driver(minor); retval = lirc_unregister_driver(minor);
if (retval) if (retval)
dev_err(&context->usbdev->dev, dev_err(&context->usbdev->dev,
": %s: unable to deregister from lirc(%d)", "unable to deregister from lirc(%d)", retval);
__func__, retval);
else else
dev_info(&context->usbdev->dev, dev_info(&context->usbdev->dev,
"Deregistered iMON driver (minor:%d)\n", minor); "Deregistered iMON driver (minor:%d)\n", minor);
...@@ -241,9 +240,8 @@ static int display_open(struct inode *inode, struct file *file) ...@@ -241,9 +240,8 @@ static int display_open(struct inode *inode, struct file *file)
context = usb_get_intfdata(interface); context = usb_get_intfdata(interface);
if (!context) { if (!context) {
dev_err(&interface->dev, dev_err(&interface->dev, "no context found for minor %d\n",
"%s: no context found for minor %d\n", subminor);
__func__, subminor);
retval = -ENODEV; retval = -ENODEV;
goto exit; goto exit;
} }
...@@ -344,8 +342,8 @@ static int send_packet(struct imon_context *context) ...@@ -344,8 +342,8 @@ static int send_packet(struct imon_context *context)
retval = usb_submit_urb(context->tx_urb, GFP_KERNEL); retval = usb_submit_urb(context->tx_urb, GFP_KERNEL);
if (retval) { if (retval) {
atomic_set(&(context->tx.busy), 0); atomic_set(&(context->tx.busy), 0);
dev_err(&context->usbdev->dev, dev_err(&context->usbdev->dev, "error submitting urb(%d)\n",
"%s: error submitting urb(%d)\n", __func__, retval); retval);
} else { } else {
/* Wait for transmission to complete (or abort) */ /* Wait for transmission to complete (or abort) */
mutex_unlock(&context->ctx_lock); mutex_unlock(&context->ctx_lock);
...@@ -359,8 +357,7 @@ static int send_packet(struct imon_context *context) ...@@ -359,8 +357,7 @@ static int send_packet(struct imon_context *context)
retval = context->tx.status; retval = context->tx.status;
if (retval) if (retval)
dev_err(&context->usbdev->dev, dev_err(&context->usbdev->dev,
"%s: packet tx failed (%d)\n", "packet tx failed (%d)\n", retval);
__func__, retval);
} }
return retval; return retval;
...@@ -437,8 +434,8 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, ...@@ -437,8 +434,8 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
retval = send_packet(context); retval = send_packet(context);
if (retval) { if (retval) {
dev_err(&context->usbdev->dev, dev_err(&context->usbdev->dev,
"%s: send packet failed for packet #%d\n", "send packet failed for packet #%d\n",
__func__, seq/2); seq / 2);
goto exit; goto exit;
} else { } else {
seq += 2; seq += 2;
...@@ -454,8 +451,8 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, ...@@ -454,8 +451,8 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
retval = send_packet(context); retval = send_packet(context);
if (retval) if (retval)
dev_err(&context->usbdev->dev, dev_err(&context->usbdev->dev,
"%s: send packet failed for packet #%d\n", "send packet failed for packet #%d\n",
__func__, seq/2); seq / 2);
} }
exit: exit:
...@@ -877,8 +874,7 @@ static int imon_probe(struct usb_interface *interface, ...@@ -877,8 +874,7 @@ static int imon_probe(struct usb_interface *interface,
retval = usb_submit_urb(context->rx_urb, GFP_KERNEL); retval = usb_submit_urb(context->rx_urb, GFP_KERNEL);
if (retval) { if (retval) {
dev_err(dev, "%s: usb_submit_urb failed for intf0 (%d)\n", dev_err(dev, "usb_submit_urb failed for intf0 (%d)\n", retval);
__func__, retval);
alloc_status = 8; alloc_status = 8;
goto unlock; goto unlock;
} }
......
...@@ -214,9 +214,8 @@ static int vfd_open(struct inode *inode, struct file *file) ...@@ -214,9 +214,8 @@ static int vfd_open(struct inode *inode, struct file *file)
context = usb_get_intfdata(interface); context = usb_get_intfdata(interface);
if (!context) { if (!context) {
dev_err(&interface->dev, dev_err(&interface->dev, "no context found for minor %d\n",
"%s: no context found for minor %d\n", subminor);
__func__, subminor);
retval = -ENODEV; retval = -ENODEV;
goto exit; goto exit;
} }
...@@ -337,8 +336,8 @@ static int send_packet(struct sasem_context *context) ...@@ -337,8 +336,8 @@ static int send_packet(struct sasem_context *context)
retval = usb_submit_urb(context->tx_urb, GFP_KERNEL); retval = usb_submit_urb(context->tx_urb, GFP_KERNEL);
if (retval) { if (retval) {
atomic_set(&(context->tx.busy), 0); atomic_set(&(context->tx.busy), 0);
dev_err(&context->dev->dev, "%s: error submitting urb (%d)\n", dev_err(&context->dev->dev, "error submitting urb (%d)\n",
__func__, retval); retval);
} else { } else {
/* Wait for transmission to complete (or abort) */ /* Wait for transmission to complete (or abort) */
mutex_unlock(&context->ctx_lock); mutex_unlock(&context->ctx_lock);
...@@ -348,8 +347,7 @@ static int send_packet(struct sasem_context *context) ...@@ -348,8 +347,7 @@ static int send_packet(struct sasem_context *context)
retval = context->tx.status; retval = context->tx.status;
if (retval) if (retval)
dev_err(&context->dev->dev, dev_err(&context->dev->dev,
"%s: packet tx failed (%d)\n", "packet tx failed (%d)\n", retval);
__func__, retval);
} }
return retval; return retval;
...@@ -444,8 +442,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf, ...@@ -444,8 +442,7 @@ static ssize_t vfd_write(struct file *file, const char __user *buf,
retval = send_packet(context); retval = send_packet(context);
if (retval) { if (retval) {
dev_err(&context->dev->dev, dev_err(&context->dev->dev,
"%s: send packet failed for packet #%d\n", "send packet failed for packet #%d\n", i);
__func__, i);
goto exit; goto exit;
} }
} }
...@@ -509,8 +506,7 @@ static int ir_open(void *data) ...@@ -509,8 +506,7 @@ static int ir_open(void *data)
if (retval) if (retval)
dev_err(&context->dev->dev, dev_err(&context->dev->dev,
"%s: usb_submit_urb failed for ir_open (%d)\n", "usb_submit_urb failed for ir_open (%d)\n", retval);
__func__, retval);
else { else {
context->ir_isopen = 1; context->ir_isopen = 1;
dev_info(&context->dev->dev, "IR port opened\n"); dev_info(&context->dev->dev, "IR port opened\n");
......
...@@ -1160,8 +1160,8 @@ iss_register_subdev_group(struct iss_device *iss, ...@@ -1160,8 +1160,8 @@ iss_register_subdev_group(struct iss_device *iss,
subdev = v4l2_i2c_new_subdev_board(&iss->v4l2_dev, adapter, subdev = v4l2_i2c_new_subdev_board(&iss->v4l2_dev, adapter,
board_info->board_info, NULL); board_info->board_info, NULL);
if (subdev == NULL) { if (subdev == NULL) {
dev_err(iss->dev, "%s: Unable to register subdev %s\n", dev_err(iss->dev, "Unable to register subdev %s\n",
__func__, board_info->board_info->type); board_info->board_info->type);
continue; continue;
} }
...@@ -1185,16 +1185,16 @@ static int iss_register_entities(struct iss_device *iss) ...@@ -1185,16 +1185,16 @@ static int iss_register_entities(struct iss_device *iss)
iss->media_dev.link_notify = iss_pipeline_link_notify; iss->media_dev.link_notify = iss_pipeline_link_notify;
ret = media_device_register(&iss->media_dev); ret = media_device_register(&iss->media_dev);
if (ret < 0) { if (ret < 0) {
dev_err(iss->dev, "%s: Media device registration failed (%d)\n", dev_err(iss->dev, "Media device registration failed (%d)\n",
__func__, ret); ret);
return ret; return ret;
} }
iss->v4l2_dev.mdev = &iss->media_dev; iss->v4l2_dev.mdev = &iss->media_dev;
ret = v4l2_device_register(iss->dev, &iss->v4l2_dev); ret = v4l2_device_register(iss->dev, &iss->v4l2_dev);
if (ret < 0) { if (ret < 0) {
dev_err(iss->dev, "%s: V4L2 device registration failed (%d)\n", dev_err(iss->dev, "V4L2 device registration failed (%d)\n",
__func__, ret); ret);
goto done; goto done;
} }
...@@ -1252,8 +1252,8 @@ static int iss_register_entities(struct iss_device *iss) ...@@ -1252,8 +1252,8 @@ static int iss_register_entities(struct iss_device *iss)
break; break;
default: default:
dev_err(iss->dev, "%s: invalid interface type %u\n", dev_err(iss->dev, "invalid interface type %u\n",
__func__, subdevs->interface); subdevs->interface);
ret = -EINVAL; ret = -EINVAL;
goto done; goto done;
} }
......
...@@ -1221,8 +1221,7 @@ int omap4iss_video_register(struct iss_video *video, struct v4l2_device *vdev) ...@@ -1221,8 +1221,7 @@ int omap4iss_video_register(struct iss_video *video, struct v4l2_device *vdev)
ret = video_register_device(&video->video, VFL_TYPE_GRABBER, -1); ret = video_register_device(&video->video, VFL_TYPE_GRABBER, -1);
if (ret < 0) if (ret < 0)
dev_err(video->iss->dev, dev_err(video->iss->dev,
"%s: could not register video device (%d)\n", "could not register video device (%d)\n", ret);
__func__, ret);
return ret; return ret;
} }
......
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