Commit 3c16b2b3 authored by Sachin Kamat's avatar Sachin Kamat Committed by Mauro Carvalho Chehab

[media] media-devnode: Replace printk with pr_*

Fixes checkpatch warnings related to printk.
Signed-off-by: default avatarSachin Kamat <sachin.kamat@linaro.org>
Acked-by: default avatarSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 0bd0dbee
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
* counting. * counting.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -215,7 +217,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev) ...@@ -215,7 +217,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev)
minor = find_next_zero_bit(media_devnode_nums, MEDIA_NUM_DEVICES, 0); minor = find_next_zero_bit(media_devnode_nums, MEDIA_NUM_DEVICES, 0);
if (minor == MEDIA_NUM_DEVICES) { if (minor == MEDIA_NUM_DEVICES) {
mutex_unlock(&media_devnode_lock); mutex_unlock(&media_devnode_lock);
printk(KERN_ERR "could not get a free minor\n"); pr_err("could not get a free minor\n");
return -ENFILE; return -ENFILE;
} }
...@@ -230,7 +232,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev) ...@@ -230,7 +232,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev)
ret = cdev_add(&mdev->cdev, MKDEV(MAJOR(media_dev_t), mdev->minor), 1); ret = cdev_add(&mdev->cdev, MKDEV(MAJOR(media_dev_t), mdev->minor), 1);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "%s: cdev_add failed\n", __func__); pr_err("%s: cdev_add failed\n", __func__);
goto error; goto error;
} }
...@@ -243,7 +245,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev) ...@@ -243,7 +245,7 @@ int __must_check media_devnode_register(struct media_devnode *mdev)
dev_set_name(&mdev->dev, "media%d", mdev->minor); dev_set_name(&mdev->dev, "media%d", mdev->minor);
ret = device_register(&mdev->dev); ret = device_register(&mdev->dev);
if (ret < 0) { if (ret < 0) {
printk(KERN_ERR "%s: device_register failed\n", __func__); pr_err("%s: device_register failed\n", __func__);
goto error; goto error;
} }
...@@ -287,18 +289,18 @@ static int __init media_devnode_init(void) ...@@ -287,18 +289,18 @@ static int __init media_devnode_init(void)
{ {
int ret; int ret;
printk(KERN_INFO "Linux media interface: v0.10\n"); pr_info("Linux media interface: v0.10\n");
ret = alloc_chrdev_region(&media_dev_t, 0, MEDIA_NUM_DEVICES, ret = alloc_chrdev_region(&media_dev_t, 0, MEDIA_NUM_DEVICES,
MEDIA_NAME); MEDIA_NAME);
if (ret < 0) { if (ret < 0) {
printk(KERN_WARNING "media: unable to allocate major\n"); pr_warn("unable to allocate major\n");
return ret; return ret;
} }
ret = bus_register(&media_bus_type); ret = bus_register(&media_bus_type);
if (ret < 0) { if (ret < 0) {
unregister_chrdev_region(media_dev_t, MEDIA_NUM_DEVICES); unregister_chrdev_region(media_dev_t, MEDIA_NUM_DEVICES);
printk(KERN_WARNING "media: bus_register failed\n"); pr_warn("bus_register failed\n");
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