summaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/em28xx/em28xx-video.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-12 12:26:47 +0200
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-21 12:37:26 +0200
commit8314d40233f3790e4cfa704087bb2a43c18144d7 (patch)
treedeffcd8b1c661e7f4efbdefc0ad287a367394e7f /drivers/media/usb/em28xx/em28xx-video.c
parent[media] em28xx: mark printk continuation lines as such (diff)
downloadlinux-8314d40233f3790e4cfa704087bb2a43c18144d7.tar.xz
linux-8314d40233f3790e4cfa704087bb2a43c18144d7.zip
[media] em28xx: use pr_foo instead of em28xx-specific printk macros
There's no reason to keep using em28xx-specific printk macros here. Just use pr_foo(). Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/usb/em28xx/em28xx-video.c')
-rw-r--r--drivers/media/usb/em28xx/em28xx-video.c57
1 files changed, 29 insertions, 28 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 119877bb8a1e..3efabc19bfe9 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -26,6 +26,8 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include "em28xx.h"
+
#include <linux/init.h>
#include <linux/list.h>
#include <linux/module.h>
@@ -37,7 +39,6 @@
#include <linux/mutex.h>
#include <linux/slab.h>
-#include "em28xx.h"
#include "em28xx-v4l.h"
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
@@ -413,7 +414,7 @@ set_alt:
dev->alt, dev->max_pkt_size);
errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt);
if (errCode < 0) {
- em28xx_errdev("cannot change alternate number to %d (error=%i)\n",
+ pr_err("cannot change alternate number to %d (error=%i)\n",
dev->alt, errCode);
return errCode;
}
@@ -2047,7 +2048,7 @@ static int em28xx_v4l2_open(struct file *filp)
ret = v4l2_fh_open(filp);
if (ret) {
- em28xx_errdev("%s: v4l2_fh_open() returned error %d\n",
+ pr_err("%s: v4l2_fh_open() returned error %d\n",
__func__, ret);
mutex_unlock(&dev->lock);
return ret;
@@ -2102,7 +2103,7 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
if (v4l2 == NULL)
return 0;
- em28xx_info("Closing video extension\n");
+ pr_info("Closing video extension\n");
mutex_lock(&dev->lock);
@@ -2113,17 +2114,17 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
em28xx_v4l2_media_release(dev);
if (video_is_registered(&v4l2->radio_dev)) {
- em28xx_info("V4L2 device %s deregistered\n",
+ pr_info("V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->radio_dev));
video_unregister_device(&v4l2->radio_dev);
}
if (video_is_registered(&v4l2->vbi_dev)) {
- em28xx_info("V4L2 device %s deregistered\n",
+ pr_info("V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vbi_dev));
video_unregister_device(&v4l2->vbi_dev);
}
if (video_is_registered(&v4l2->vdev)) {
- em28xx_info("V4L2 device %s deregistered\n",
+ pr_info("V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vdev));
video_unregister_device(&v4l2->vdev);
}
@@ -2153,7 +2154,7 @@ static int em28xx_v4l2_suspend(struct em28xx *dev)
if (!dev->has_video)
return 0;
- em28xx_info("Suspending video extension\n");
+ pr_info("Suspending video extension\n");
em28xx_stop_urbs(dev);
return 0;
}
@@ -2166,7 +2167,7 @@ static int em28xx_v4l2_resume(struct em28xx *dev)
if (!dev->has_video)
return 0;
- em28xx_info("Resuming video extension\n");
+ pr_info("Resuming video extension\n");
/* what do we do here */
return 0;
}
@@ -2203,7 +2204,8 @@ static int em28xx_v4l2_close(struct file *filp)
em28xx_videodbg("setting alternate 0\n");
errCode = usb_set_interface(dev->udev, 0, 0);
if (errCode < 0) {
- em28xx_errdev("cannot change alternate number to 0 (error=%i)\n", errCode);
+ pr_err("cannot change alternate number to 0 (error=%i)\n",
+ errCode);
}
}
@@ -2420,13 +2422,12 @@ static int em28xx_v4l2_init(struct em28xx *dev)
return 0;
}
- em28xx_info("Registering V4L2 extension\n");
+ pr_info("Registering V4L2 extension\n");
mutex_lock(&dev->lock);
v4l2 = kzalloc(sizeof(struct em28xx_v4l2), GFP_KERNEL);
- if (v4l2 == NULL) {
- em28xx_info("em28xx_v4l: memory allocation failed\n");
+ if (!v4l2) {
mutex_unlock(&dev->lock);
return -ENOMEM;
}
@@ -2439,7 +2440,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
#endif
ret = v4l2_device_register(&dev->udev->dev, &v4l2->v4l2_dev);
if (ret < 0) {
- em28xx_errdev("Call to v4l2_device_register() failed!\n");
+ pr_err("Call to v4l2_device_register() failed!\n");
goto err;
}
@@ -2523,7 +2524,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* Configure audio */
ret = em28xx_audio_setup(dev);
if (ret < 0) {
- em28xx_errdev("%s: Error while setting audio - error [%d]!\n",
+ pr_err("%s: Error while setting audio - error [%d]!\n",
__func__, ret);
goto unregister_dev;
}
@@ -2551,7 +2552,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* Send a reset to other chips via gpio */
ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7);
if (ret < 0) {
- em28xx_errdev("%s: em28xx_write_reg - msp34xx(1) failed! error [%d]\n",
+ pr_err("%s: em28xx_write_reg - msp34xx(1) failed! error [%d]\n",
__func__, ret);
goto unregister_dev;
}
@@ -2559,7 +2560,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
if (ret < 0) {
- em28xx_errdev("%s: em28xx_write_reg - msp34xx(2) failed! error [%d]\n",
+ pr_err("%s: em28xx_write_reg - msp34xx(2) failed! error [%d]\n",
__func__, ret);
goto unregister_dev;
}
@@ -2661,7 +2662,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER,
video_nr[dev->devno]);
if (ret) {
- em28xx_errdev("unable to register video device (error=%i).\n",
+ pr_err("unable to register video device (error=%i).\n",
ret);
goto unregister_dev;
}
@@ -2691,7 +2692,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = video_register_device(&v4l2->vbi_dev, VFL_TYPE_VBI,
vbi_nr[dev->devno]);
if (ret < 0) {
- em28xx_errdev("unable to register vbi device\n");
+ pr_err("unable to register vbi device\n");
goto unregister_dev;
}
}
@@ -2702,10 +2703,10 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = video_register_device(&v4l2->radio_dev, VFL_TYPE_RADIO,
radio_nr[dev->devno]);
if (ret < 0) {
- em28xx_errdev("can't register radio device\n");
+ pr_err("can't register radio device\n");
goto unregister_dev;
}
- em28xx_info("Registered radio device as %s\n",
+ pr_info("Registered radio device as %s\n",
video_device_node_name(&v4l2->radio_dev));
}
@@ -2715,17 +2716,17 @@ static int em28xx_v4l2_init(struct em28xx *dev)
#ifdef CONFIG_MEDIA_CONTROLLER
ret = v4l2_mc_create_media_graph(dev->media_dev);
if (ret) {
- em28xx_errdev("failed to create media graph\n");
+ pr_err("failed to create media graph\n");
em28xx_v4l2_media_release(dev);
goto unregister_dev;
}
#endif
- em28xx_info("V4L2 video device registered as %s\n",
+ pr_info("V4L2 video device registered as %s\n",
video_device_node_name(&v4l2->vdev));
if (video_is_registered(&v4l2->vbi_dev))
- em28xx_info("V4L2 VBI device registered as %s\n",
+ pr_info("V4L2 VBI device registered as %s\n",
video_device_node_name(&v4l2->vbi_dev));
/* Save some power by putting tuner to sleep */
@@ -2734,7 +2735,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* initialize videobuf2 stuff */
em28xx_vb2_setup(dev);
- em28xx_info("V4L2 extension successfully initialized\n");
+ pr_info("V4L2 extension successfully initialized\n");
kref_get(&dev->ref);
@@ -2743,17 +2744,17 @@ static int em28xx_v4l2_init(struct em28xx *dev)
unregister_dev:
if (video_is_registered(&v4l2->radio_dev)) {
- em28xx_info("V4L2 device %s deregistered\n",
+ pr_info("V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->radio_dev));
video_unregister_device(&v4l2->radio_dev);
}
if (video_is_registered(&v4l2->vbi_dev)) {
- em28xx_info("V4L2 device %s deregistered\n",
+ pr_info("V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vbi_dev));
video_unregister_device(&v4l2->vbi_dev);
}
if (video_is_registered(&v4l2->vdev)) {
- em28xx_info("V4L2 device %s deregistered\n",
+ pr_info("V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vdev));
video_unregister_device(&v4l2->vdev);
}