diff options
Diffstat (limited to 'drivers/media/dvb-core/dvbdev.c')
-rw-r--r-- | drivers/media/dvb-core/dvbdev.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index 75a3f4b57fd4..0694d1d53c67 100644 --- a/drivers/media/dvb-core/dvbdev.c +++ b/drivers/media/dvb-core/dvbdev.c @@ -21,6 +21,8 @@ * */ +#define pr_fmt(fmt) "dvbdev: " fmt + #include <linux/types.h> #include <linux/errno.h> #include <linux/string.h> @@ -43,7 +45,11 @@ static int dvbdev_debug; module_param(dvbdev_debug, int, 0644); MODULE_PARM_DESC(dvbdev_debug, "Turn on/off device debugging (default:off)."); -#define dprintk if (dvbdev_debug) printk +#define dprintk(fmt, arg...) do { \ + if (dvbdev_debug) \ + printk(KERN_DEBUG pr_fmt("%s: " fmt), \ + __func__, ##arg); \ +} while (0) static LIST_HEAD(dvb_adapter_list); static DEFINE_MUTEX(dvbdev_register_lock); @@ -354,7 +360,7 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev, if (ret) return ret; - printk(KERN_DEBUG "%s: media entity '%s' registered.\n", + pr_info("%s: media entity '%s' registered.\n", __func__, dvbdev->entity->name); return 0; @@ -438,7 +444,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, if ((id = dvbdev_get_free_id (adap, type)) < 0){ mutex_unlock(&dvbdev_register_lock); *pdvbdev = NULL; - printk(KERN_ERR "%s: couldn't find free device id\n", __func__); + pr_err("%s: couldn't find free device id\n", __func__); return -ENFILE; } @@ -493,8 +499,7 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, ret = dvb_register_media_device(dvbdev, type, minor, demux_sink_pads); if (ret) { - printk(KERN_ERR - "%s: dvb_register_media_device failed to create the mediagraph\n", + pr_err("%s: dvb_register_media_device failed to create the mediagraph\n", __func__); dvb_media_device_free(dvbdev); @@ -511,11 +516,11 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, MKDEV(DVB_MAJOR, minor), dvbdev, "dvb%d.%s%d", adap->num, dnames[type], id); if (IS_ERR(clsdev)) { - printk(KERN_ERR "%s: failed to create device dvb%d.%s%d (%ld)\n", + pr_err("%s: failed to create device dvb%d.%s%d (%ld)\n", __func__, adap->num, dnames[type], id, PTR_ERR(clsdev)); return PTR_ERR(clsdev); } - dprintk(KERN_DEBUG "DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", + dprintk("DVB: register adapter%d/%s%d @ minor: %i (0x%02x)\n", adap->num, dnames[type], id, minor, minor); return 0; @@ -808,7 +813,7 @@ int dvb_register_adapter(struct dvb_adapter *adap, const char *name, memset (adap, 0, sizeof(struct dvb_adapter)); INIT_LIST_HEAD (&adap->device_list); - printk(KERN_INFO "DVB: registering new adapter (%s)\n", name); + pr_info("DVB: registering new adapter (%s)\n", name); adap->num = num; adap->name = name; @@ -926,13 +931,13 @@ static int __init init_dvbdev(void) dev_t dev = MKDEV(DVB_MAJOR, 0); if ((retval = register_chrdev_region(dev, MAX_DVB_MINORS, "DVB")) != 0) { - printk(KERN_ERR "dvb-core: unable to get major %d\n", DVB_MAJOR); + pr_err("dvb-core: unable to get major %d\n", DVB_MAJOR); return retval; } cdev_init(&dvb_device_cdev, &dvb_device_fops); if ((retval = cdev_add(&dvb_device_cdev, dev, MAX_DVB_MINORS)) != 0) { - printk(KERN_ERR "dvb-core: unable register character device\n"); + pr_err("dvb-core: unable register character device\n"); goto error; } |