From d56dc61265d2527a63ab5b0f03199a43cd89ca36 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Wed, 30 Jul 2008 08:43:36 -0300 Subject: V4L/DVB (8613): v4l: move BKL down to the driver level. The BKL is now moved from the video_open function in v4l2-dev.c to the various drivers. It seems about a third of the drivers already has a lock of some sort protecting the open(), another third uses video_exclusive_open (yuck!) and the last third required adding the BKL in their open function. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/se401.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'drivers/media/video/se401.c') diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c index acceed5d04a..d16bbf0d278 100644 --- a/drivers/media/video/se401.c +++ b/drivers/media/video/se401.c @@ -936,14 +936,18 @@ static int se401_open(struct inode *inode, struct file *file) struct usb_se401 *se401 = (struct usb_se401 *)dev; int err = 0; - if (se401->user) + lock_kernel(); + if (se401->user) { + unlock_kernel(); return -EBUSY; + } se401->fbuf = rvmalloc(se401->maxframesize * SE401_NUMFRAMES); if (se401->fbuf) file->private_data = dev; else err = -ENOMEM; se401->user = !err; + unlock_kernel(); return err; } -- cgit v1.2.3-70-g09d2 From aa5e90af7d78d1711f8f4275ce3638817c0023dc Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sat, 23 Aug 2008 06:23:55 -0300 Subject: V4L/DVB (8783): v4l: add all missing video_device release callbacks All drivers that call video_device_register where checked to see if they set the release callback of struct video_device. Where that callback was missing it was added. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/radio-aimslab.c | 1 + drivers/media/radio/radio-aztech.c | 7 ++++--- drivers/media/radio/radio-cadet.c | 1 + drivers/media/radio/radio-gemtek-pci.c | 7 ++++--- drivers/media/radio/radio-gemtek.c | 7 ++++--- drivers/media/radio/radio-maestro.c | 1 + drivers/media/radio/radio-maxiradio.c | 7 ++++--- drivers/media/radio/radio-rtrack2.c | 1 + drivers/media/radio/radio-sf16fmi.c | 1 + drivers/media/radio/radio-sf16fmr2.c | 1 + drivers/media/radio/radio-terratec.c | 1 + drivers/media/radio/radio-trust.c | 1 + drivers/media/radio/radio-typhoon.c | 1 + drivers/media/radio/radio-zoltrix.c | 1 + drivers/media/video/bw-qcam.c | 1 + drivers/media/video/c-qcam.c | 1 + drivers/media/video/cpia.c | 1 + drivers/media/video/pms.c | 1 + drivers/media/video/saa5249.c | 1 + drivers/media/video/se401.c | 1 + drivers/media/video/stradis.c | 1 + drivers/media/video/usbvideo/usbvideo.c | 6 +----- drivers/media/video/usbvideo/vicam.c | 1 + drivers/media/video/w9966.c | 1 + 24 files changed, 36 insertions(+), 17 deletions(-) (limited to 'drivers/media/video/se401.c') diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c index b657c7bb47c..59fdaf85e41 100644 --- a/drivers/media/radio/radio-aimslab.c +++ b/drivers/media/radio/radio-aimslab.c @@ -420,6 +420,7 @@ static struct video_device rtrack_radio = { .name = "RadioTrack radio", .fops = &rtrack_fops, .ioctl_ops = &rtrack_ioctl_ops, + .release = video_device_release_empty, }; static int __init rtrack_init(void) diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c index ae18a7cf0d5..ddd96295a9f 100644 --- a/drivers/media/radio/radio-aztech.c +++ b/drivers/media/radio/radio-aztech.c @@ -381,9 +381,10 @@ static const struct v4l2_ioctl_ops aztech_ioctl_ops = { }; static struct video_device aztech_radio = { - .name = "Aztech radio", - .fops = &aztech_fops, - .ioctl_ops = &aztech_ioctl_ops, + .name = "Aztech radio", + .fops = &aztech_fops, + .ioctl_ops = &aztech_ioctl_ops, + .release = video_device_release_empty, }; module_param_named(debug,aztech_radio.debug, int, 0644); diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 04c3698d32e..0490a1fa999 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c @@ -589,6 +589,7 @@ static struct video_device cadet_radio = { .name = "Cadet radio", .fops = &cadet_fops, .ioctl_ops = &cadet_ioctl_ops, + .release = video_device_release_empty, }; #ifdef CONFIG_PNP diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c index a7b9a5df4ca..d65fd287bde 100644 --- a/drivers/media/radio/radio-gemtek-pci.c +++ b/drivers/media/radio/radio-gemtek-pci.c @@ -401,9 +401,10 @@ static const struct v4l2_ioctl_ops gemtek_pci_ioctl_ops = { }; static struct video_device vdev_template = { - .name = "Gemtek PCI Radio", - .fops = &gemtek_pci_fops, - .ioctl_ops = &gemtek_pci_ioctl_ops, + .name = "Gemtek PCI Radio", + .fops = &gemtek_pci_fops, + .ioctl_ops = &gemtek_pci_ioctl_ops, + .release = video_device_release_empty, }; static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci_device_id *pci_id ) diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c index cc90329026f..2d991ae2f20 100644 --- a/drivers/media/radio/radio-gemtek.c +++ b/drivers/media/radio/radio-gemtek.c @@ -581,9 +581,10 @@ static const struct v4l2_ioctl_ops gemtek_ioctl_ops = { }; static struct video_device gemtek_radio = { - .name = "GemTek Radio card", - .fops = &gemtek_fops, - .ioctl_ops = &gemtek_ioctl_ops, + .name = "GemTek Radio card", + .fops = &gemtek_fops, + .ioctl_ops = &gemtek_ioctl_ops, + .release = video_device_release_empty, }; /* diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c index 03c20948eef..182b433981c 100644 --- a/drivers/media/radio/radio-maestro.c +++ b/drivers/media/radio/radio-maestro.c @@ -388,6 +388,7 @@ static struct video_device maestro_radio = { .name = "Maestro radio", .fops = &maestro_fops, .ioctl_ops = &maestro_ioctl_ops, + .release = video_device_release, }; static int __devinit maestro_probe(struct pci_dev *pdev, diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 263ef8b02fd..4e2e8a3d9b5 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -402,9 +402,10 @@ static const struct v4l2_ioctl_ops maxiradio_ioctl_ops = { }; static struct video_device maxiradio_radio = { - .name = "Maxi Radio FM2000 radio", - .fops = &maxiradio_fops, - .ioctl_ops = &maxiradio_ioctl_ops, + .name = "Maxi Radio FM2000 radio", + .fops = &maxiradio_fops, + .ioctl_ops = &maxiradio_ioctl_ops, + .release = video_device_release_empty, }; static int __devinit maxiradio_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index 5b93b47be71..8fe820da73e 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c @@ -326,6 +326,7 @@ static struct video_device rtrack2_radio = { .name = "RadioTrack II radio", .fops = &rtrack2_fops, .ioctl_ops = &rtrack2_ioctl_ops, + .release = video_device_release_empty, }; static int __init rtrack2_init(void) diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c index 55f8334513f..6d865a7a91e 100644 --- a/drivers/media/radio/radio-sf16fmi.c +++ b/drivers/media/radio/radio-sf16fmi.c @@ -326,6 +326,7 @@ static struct video_device fmi_radio = { .name = "SF16FMx radio", .fops = &fmi_fops, .ioctl_ops = &fmi_ioctl_ops, + .release = video_device_release_empty, }; /* ladis: this is my card. does any other types exist? */ diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c index 14153ed939d..9625d1f0194 100644 --- a/drivers/media/radio/radio-sf16fmr2.c +++ b/drivers/media/radio/radio-sf16fmr2.c @@ -442,6 +442,7 @@ static struct video_device fmr2_radio = { .name = "SF16FMR2 radio", .fops = &fmr2_fops, .ioctl_ops = &fmr2_ioctl_ops, + .release = video_device_release_empty, }; static int __init fmr2_init(void) diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c index eed14972a94..de13ec81ce4 100644 --- a/drivers/media/radio/radio-terratec.c +++ b/drivers/media/radio/radio-terratec.c @@ -398,6 +398,7 @@ static struct video_device terratec_radio = { .name = "TerraTec ActiveRadio", .fops = &terratec_fops, .ioctl_ops = &terratec_ioctl_ops, + .release = video_device_release_empty, }; static int __init terratec_init(void) diff --git a/drivers/media/radio/radio-trust.c b/drivers/media/radio/radio-trust.c index dd0c425ef3b..e7b111fcd10 100644 --- a/drivers/media/radio/radio-trust.c +++ b/drivers/media/radio/radio-trust.c @@ -378,6 +378,7 @@ static struct video_device trust_radio = { .name = "Trust FM Radio", .fops = &trust_fops, .ioctl_ops = &trust_ioctl_ops, + .release = video_device_release_empty, }; static int __init trust_init(void) diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c index 87846850723..c2eedb7a73a 100644 --- a/drivers/media/radio/radio-typhoon.c +++ b/drivers/media/radio/radio-typhoon.c @@ -375,6 +375,7 @@ static struct video_device typhoon_radio = { .name = "Typhoon Radio", .fops = &typhoon_fops, .ioctl_ops = &typhoon_ioctl_ops, + .release = video_device_release_empty, }; #ifdef CONFIG_RADIO_TYPHOON_PROC_FS diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index 4d76e710194..0d43e8401eb 100644 --- a/drivers/media/radio/radio-zoltrix.c +++ b/drivers/media/radio/radio-zoltrix.c @@ -439,6 +439,7 @@ static struct video_device zoltrix_radio = { .name = "Zoltrix Radio Plus", .fops = &zoltrix_fops, .ioctl_ops = &zoltrix_ioctl_ops, + .release = video_device_release_empty, }; static int __init zoltrix_init(void) diff --git a/drivers/media/video/bw-qcam.c b/drivers/media/video/bw-qcam.c index e8e1bb122b5..ace4ff9ea02 100644 --- a/drivers/media/video/bw-qcam.c +++ b/drivers/media/video/bw-qcam.c @@ -926,6 +926,7 @@ static struct video_device qcam_template= { .name = "Connectix Quickcam", .fops = &qcam_fops, + .release = video_device_release_empty, }; #define MAX_CAMS 4 diff --git a/drivers/media/video/c-qcam.c b/drivers/media/video/c-qcam.c index 2196c1dc5ae..17aa0adb346 100644 --- a/drivers/media/video/c-qcam.c +++ b/drivers/media/video/c-qcam.c @@ -722,6 +722,7 @@ static struct video_device qcam_template= { .name = "Colour QuickCam", .fops = &qcam_fops, + .release = video_device_release_empty, }; /* Initialize the QuickCam driver control structure. */ diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index a661800b0e6..c0600fdbfc6 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c @@ -3801,6 +3801,7 @@ static const struct file_operations cpia_fops = { static struct video_device cpia_template = { .name = "CPiA Camera", .fops = &cpia_fops, + .release = video_device_release_empty, }; /* initialise cam_data structure */ diff --git a/drivers/media/video/pms.c b/drivers/media/video/pms.c index b39794f0baf..994807818aa 100644 --- a/drivers/media/video/pms.c +++ b/drivers/media/video/pms.c @@ -915,6 +915,7 @@ static struct video_device pms_template= { .name = "Mediavision PMS", .fops = &pms_fops, + .release = video_device_release_empty, }; static struct pms_device pms_device; diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c index dfd8a9338c5..225117c789c 100644 --- a/drivers/media/video/saa5249.c +++ b/drivers/media/video/saa5249.c @@ -708,6 +708,7 @@ static struct video_device saa_template = { .name = IF_NAME, .fops = &saa_fops, + .release = video_device_release, }; MODULE_LICENSE("GPL"); diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c index d16bbf0d278..b01f25d7292 100644 --- a/drivers/media/video/se401.c +++ b/drivers/media/video/se401.c @@ -1236,6 +1236,7 @@ static const struct file_operations se401_fops = { static struct video_device se401_template = { .name = "se401 USB camera", .fops = &se401_fops, + .release = video_device_release_empty, }; diff --git a/drivers/media/video/stradis.c b/drivers/media/video/stradis.c index a3cbe9be3c1..bbad54f85c8 100644 --- a/drivers/media/video/stradis.c +++ b/drivers/media/video/stradis.c @@ -1925,6 +1925,7 @@ static struct video_device saa_template = { .name = "SAA7146A", .fops = &saa_fops, .minor = -1, + .release = video_device_release_empty, }; static int __devinit configure_saa7146(struct pci_dev *pdev, int num) diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c index 6b1b2003a65..9569e8ced4b 100644 --- a/drivers/media/video/usbvideo/usbvideo.c +++ b/drivers/media/video/usbvideo/usbvideo.c @@ -1006,10 +1006,6 @@ allocate_done: EXPORT_SYMBOL(usbvideo_AllocateDevice); -static void usbvideo_dummy_release(struct video_device *vfd) -{ -} - int usbvideo_RegisterVideoDevice(struct uvd *uvd) { char tmp1[20], tmp2[20]; /* Buffers for printing */ @@ -1043,7 +1039,7 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd) return -EINVAL; } uvd->vdev.parent = &uvd->dev->dev; - uvd->vdev.release = usbvideo_dummy_release; + uvd->vdev.release = video_device_release_empty; if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) < 0) { err("%s: video_register_device failed", __func__); return -EPIPE; diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c index efb878a7402..d7728256f29 100644 --- a/drivers/media/video/usbvideo/vicam.c +++ b/drivers/media/video/usbvideo/vicam.c @@ -801,6 +801,7 @@ static struct video_device vicam_template = { .name = "ViCam-based USB Camera", .fops = &vicam_fops, .minor = -1, + .release = video_device_release_empty, }; /* table of devices that work with this driver */ diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c index c635cffb1fb..e3580119640 100644 --- a/drivers/media/video/w9966.c +++ b/drivers/media/video/w9966.c @@ -216,6 +216,7 @@ static const struct file_operations w9966_fops = { static struct video_device w9966_template = { .name = W9966_DRIVERNAME, .fops = &w9966_fops, + .release = video_device_release_empty, }; /* -- cgit v1.2.3-70-g09d2 From a482f327ff56bc3cf53176a7eb736cea47291a1d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 10 Oct 2008 05:08:23 -0300 Subject: V4L/DVB (9116): USB: remove info() macro from usb media drivers USB should not be having it's own printk macros, so remove info() and use the system-wide standard of dev_info() wherever possible. Cc: Douglas Landgraf Cc: Mike Isely Cc: Thierry Merle Cc: Antoine Jacquet Signed-off-by: Greg Kroah-Hartman Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/dsbr100.c | 3 +- drivers/media/video/dabusb.c | 3 +- drivers/media/video/ov511.c | 105 +++++++------- drivers/media/video/ov511.h | 3 +- drivers/media/video/pvrusb2/pvrusb2-main.c | 8 +- drivers/media/video/se401.c | 37 ++--- drivers/media/video/stv680.c | 6 +- drivers/media/video/usbvideo/ibmcam.c | 78 ++++++----- drivers/media/video/usbvideo/konicawc.c | 17 ++- drivers/media/video/usbvideo/quickcam_messenger.c | 3 +- drivers/media/video/usbvideo/ultracam.c | 29 ++-- drivers/media/video/usbvideo/usbvideo.c | 163 ++++++++++++++-------- drivers/media/video/usbvision/usbvision-core.c | 3 +- drivers/media/video/usbvision/usbvision-i2c.c | 3 +- drivers/media/video/usbvision/usbvision-video.c | 3 +- drivers/media/video/zr364xx.c | 50 ++++--- 16 files changed, 312 insertions(+), 202 deletions(-) (limited to 'drivers/media/video/se401.c') diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c index 0f06e6ffb0e..b3a5cb1adf3 100644 --- a/drivers/media/radio/dsbr100.c +++ b/drivers/media/radio/dsbr100.c @@ -510,7 +510,8 @@ static int usb_dsbr100_probe(struct usb_interface *intf, static int __init dsbr100_init(void) { int retval = usb_register(&usb_dsbr100_driver); - info(DRIVER_VERSION ":" DRIVER_DESC); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return retval; } diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c index 79faedf5852..3aa538afcc0 100644 --- a/drivers/media/video/dabusb.c +++ b/drivers/media/video/dabusb.c @@ -866,7 +866,8 @@ static int __init dabusb_init (void) dbg("dabusb_init: driver registered"); - info(DRIVER_VERSION ":" DRIVER_DESC); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); out: return retval; diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c index c6852402c5e..935d73de57b 100644 --- a/drivers/media/video/ov511.c +++ b/drivers/media/video/ov511.c @@ -974,14 +974,14 @@ dump_i2c_range(struct usb_ov511 *ov, int reg1, int regn) for (i = reg1; i <= regn; i++) { rc = i2c_r(ov, i); - info("Sensor[0x%02X] = 0x%02X", i, rc); + dev_info(&ov->dev->dev, "Sensor[0x%02X] = 0x%02X\n", i, rc); } } static void dump_i2c_regs(struct usb_ov511 *ov) { - info("I2C REGS"); + dev_info(&ov->dev->dev, "I2C REGS\n"); dump_i2c_range(ov, 0x00, 0x7C); } @@ -992,28 +992,28 @@ dump_reg_range(struct usb_ov511 *ov, int reg1, int regn) for (i = reg1; i <= regn; i++) { rc = reg_r(ov, i); - info("OV511[0x%02X] = 0x%02X", i, rc); + dev_info(&ov->dev->dev, "OV511[0x%02X] = 0x%02X\n", i, rc); } } static void ov511_dump_regs(struct usb_ov511 *ov) { - info("CAMERA INTERFACE REGS"); + dev_info(&ov->dev->dev, "CAMERA INTERFACE REGS\n"); dump_reg_range(ov, 0x10, 0x1f); - info("DRAM INTERFACE REGS"); + dev_info(&ov->dev->dev, "DRAM INTERFACE REGS\n"); dump_reg_range(ov, 0x20, 0x23); - info("ISO FIFO REGS"); + dev_info(&ov->dev->dev, "ISO FIFO REGS\n"); dump_reg_range(ov, 0x30, 0x31); - info("PIO REGS"); + dev_info(&ov->dev->dev, "PIO REGS\n"); dump_reg_range(ov, 0x38, 0x39); dump_reg_range(ov, 0x3e, 0x3e); - info("I2C REGS"); + dev_info(&ov->dev->dev, "I2C REGS\n"); dump_reg_range(ov, 0x40, 0x49); - info("SYSTEM CONTROL REGS"); + dev_info(&ov->dev->dev, "SYSTEM CONTROL REGS\n"); dump_reg_range(ov, 0x50, 0x55); dump_reg_range(ov, 0x5e, 0x5f); - info("OmniCE REGS"); + dev_info(&ov->dev->dev, "OmniCE REGS\n"); dump_reg_range(ov, 0x70, 0x79); /* NOTE: Quantization tables are not readable. You will get the value * in reg. 0x79 for every table register */ @@ -1025,25 +1025,25 @@ ov511_dump_regs(struct usb_ov511 *ov) static void ov518_dump_regs(struct usb_ov511 *ov) { - info("VIDEO MODE REGS"); + dev_info(&ov->dev->dev, "VIDEO MODE REGS\n"); dump_reg_range(ov, 0x20, 0x2f); - info("DATA PUMP AND SNAPSHOT REGS"); + dev_info(&ov->dev->dev, "DATA PUMP AND SNAPSHOT REGS\n"); dump_reg_range(ov, 0x30, 0x3f); - info("I2C REGS"); + dev_info(&ov->dev->dev, "I2C REGS\n"); dump_reg_range(ov, 0x40, 0x4f); - info("SYSTEM CONTROL AND VENDOR REGS"); + dev_info(&ov->dev->dev, "SYSTEM CONTROL AND VENDOR REGS\n"); dump_reg_range(ov, 0x50, 0x5f); - info("60 - 6F"); + dev_info(&ov->dev->dev, "60 - 6F\n"); dump_reg_range(ov, 0x60, 0x6f); - info("70 - 7F"); + dev_info(&ov->dev->dev, "70 - 7F\n"); dump_reg_range(ov, 0x70, 0x7f); - info("Y QUANTIZATION TABLE"); + dev_info(&ov->dev->dev, "Y QUANTIZATION TABLE\n"); dump_reg_range(ov, 0x80, 0x8f); - info("UV QUANTIZATION TABLE"); + dev_info(&ov->dev->dev, "UV QUANTIZATION TABLE\n"); dump_reg_range(ov, 0x90, 0x9f); - info("A0 - BF"); + dev_info(&ov->dev->dev, "A0 - BF\n"); dump_reg_range(ov, 0xa0, 0xbf); - info("CBR"); + dev_info(&ov->dev->dev, "CBR\n"); dump_reg_range(ov, 0xc0, 0xcf); } #endif @@ -3205,9 +3205,10 @@ ov511_move_data(struct usb_ov511 *ov, unsigned char *in, int n) */ if (printph) { - info("ph(%3d): %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x", - pnum, in[0], in[1], in[2], in[3], in[4], in[5], in[6], - in[7], in[8], in[9], in[10], in[11]); + dev_info(&ov->dev->dev, + "ph(%3d): %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x %2x\n", + pnum, in[0], in[1], in[2], in[3], in[4], in[5], in[6], + in[7], in[8], in[9], in[10], in[11]); } /* Check for SOF/EOF packet */ @@ -3366,8 +3367,10 @@ ov518_move_data(struct usb_ov511 *ov, unsigned char *in, int n) * the definitive SOF/EOF format */ if ((!(in[0] | in[1] | in[2] | in[3] | in[5])) && in[6]) { if (printph) { - info("ph: %2x %2x %2x %2x %2x %2x %2x %2x", in[0], - in[1], in[2], in[3], in[4], in[5], in[6], in[7]); + dev_info(&ov->dev->dev, + "ph: %2x %2x %2x %2x %2x %2x %2x %2x\n", + in[0], in[1], in[2], in[3], in[4], in[5], + in[6], in[7]); } if (frame->scanstate == STATE_LINES) { @@ -3646,14 +3649,16 @@ ov51x_init_isoc(struct usb_ov511 *ov) if (packetsize == -1) { ov518_set_packet_size(ov, 640); } else { - info("Forcing packet size to %d", packetsize); + dev_info(&ov->dev->dev, "Forcing packet size to %d\n", + packetsize); ov518_set_packet_size(ov, packetsize); } } else { if (packetsize == -1) { ov511_set_packet_size(ov, size); } else { - info("Forcing packet size to %d", packetsize); + dev_info(&ov->dev->dev, "Forcing packet size to %d\n", + packetsize); ov511_set_packet_size(ov, packetsize); } } @@ -4121,7 +4126,7 @@ ov51x_v4l1_ioctl_internal(struct inode *inode, struct file *file, return -EIO; if (force_palette && p->palette != force_palette) { - info("Palette rejected (%s)", + dev_info(&ov->dev->dev, "Palette rejected (%s)\n", symbolic(v4l1_plist, p->palette)); return -EINVAL; } @@ -4849,26 +4854,27 @@ ov7xx0_configure(struct usb_ov511 *ov) err("Error detecting sensor type"); return -1; } else if ((rc & 3) == 3) { - info("Sensor is an OV7610"); + dev_info(&ov->dev->dev, "Sensor is an OV7610\n"); ov->sensor = SEN_OV7610; } else if ((rc & 3) == 1) { /* I don't know what's different about the 76BE yet. */ if (i2c_r(ov, 0x15) & 1) - info("Sensor is an OV7620AE"); + dev_info(&ov->dev->dev, "Sensor is an OV7620AE\n"); else - info("Sensor is an OV76BE"); + dev_info(&ov->dev->dev, "Sensor is an OV76BE\n"); /* OV511+ will return all zero isoc data unless we * configure the sensor as a 7620. Someone needs to * find the exact reg. setting that causes this. */ if (ov->bridge == BRG_OV511PLUS) { - info("Enabling 511+/7620AE workaround"); + dev_info(&ov->dev->dev, + "Enabling 511+/7620AE workaround\n"); ov->sensor = SEN_OV7620; } else { ov->sensor = SEN_OV76BE; } } else if ((rc & 3) == 0) { - info("Sensor is an OV7620"); + dev_info(&ov->dev->dev, "Sensor is an OV7620\n"); ov->sensor = SEN_OV7620; } else { err("Unknown image sensor version: %d", rc & 3); @@ -5024,16 +5030,16 @@ ov6xx0_configure(struct usb_ov511 *ov) if ((rc & 3) == 0) { ov->sensor = SEN_OV6630; - info("Sensor is an OV6630"); + dev_info(&ov->dev->dev, "Sensor is an OV6630\n"); } else if ((rc & 3) == 1) { ov->sensor = SEN_OV6620; - info("Sensor is an OV6620"); + dev_info(&ov->dev->dev, "Sensor is an OV6620\n"); } else if ((rc & 3) == 2) { ov->sensor = SEN_OV6630; - info("Sensor is an OV6630AE"); + dev_info(&ov->dev->dev, "Sensor is an OV6630AE\n"); } else if ((rc & 3) == 3) { ov->sensor = SEN_OV6630; - info("Sensor is an OV6630AF"); + dev_info(&ov->dev->dev, "Sensor is an OV6630AF\n"); } /* Set sensor-specific vars */ @@ -5088,10 +5094,10 @@ ks0127_configure(struct usb_ov511 *ov) err("Error detecting sensor type"); return -1; } else if ((rc & 0x0f) == 0) { - info("Sensor is a KS0127"); + dev_info(&ov->dev->dev, "Sensor is a KS0127\n"); ov->sensor = SEN_KS0127; } else if ((rc & 0x0f) == 9) { - info("Sensor is a KS0127B Rev. A"); + dev_info(&ov->dev->dev, "Sensor is a KS0127B Rev. A\n"); ov->sensor = SEN_KS0127B; } } else { @@ -5200,7 +5206,8 @@ saa7111a_configure(struct usb_ov511 *ov) err("Error detecting sensor version"); return -1; } else { - info("Sensor is an SAA7111A (version 0x%x)", rc); + dev_info(&ov->dev->dev, + "Sensor is an SAA7111A (version 0x%x)\n", rc); ov->sensor = SEN_SAA7111A; } @@ -5262,7 +5269,7 @@ ov511_configure(struct usb_ov511 *ov) PDEBUG (1, "CustomID = %d", ov->customid); ov->desc = symbolic(camlist, ov->customid); - info("model: %s", ov->desc); + dev_info(&ov->dev->dev, "model: %s\n", ov->desc); if (0 == strcmp(ov->desc, NOT_DEFINED_STR)) { err("Camera type (%d) not recognized", ov->customid); @@ -5426,7 +5433,8 @@ ov518_configure(struct usb_ov511 *ov) PDEBUG(4, ""); /* First 5 bits of custom ID reg are a revision ID on OV518 */ - info("Device revision %d", 0x1F & reg_r(ov, R511_SYS_CUST_ID)); + dev_info(&ov->dev->dev, "Device revision %d\n", + 0x1F & reg_r(ov, R511_SYS_CUST_ID)); /* Give it the default description */ ov->desc = symbolic(camlist, 0); @@ -5773,7 +5781,8 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id) goto error; } - info("USB %s video device found", symbolic(brglist, ov->bridge)); + dev_info(&intf->dev, "USB %s video device found\n", + symbolic(brglist, ov->bridge)); init_waitqueue_head(&ov->wq); @@ -5854,8 +5863,8 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id) goto error; } - info("Device at %s registered to minor %d", ov->usb_path, - ov->vdev->minor); + dev_info(&intf->dev, "Device at %s registered to minor %d\n", + ov->usb_path, ov->vdev->minor); usb_set_intfdata(intf, ov); if (ov_create_sysfs(ov->vdev)) { @@ -5958,7 +5967,8 @@ usb_ov511_init(void) if (retval) goto out; - info(DRIVER_VERSION " : " DRIVER_DESC); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); out: return retval; @@ -5968,8 +5978,7 @@ static void __exit usb_ov511_exit(void) { usb_deregister(&ov511_driver); - info("driver deregistered"); - + printk(KERN_INFO KBUILD_MODNAME ": driver deregistered\n"); } module_init(usb_ov511_init); diff --git a/drivers/media/video/ov511.h b/drivers/media/video/ov511.h index baded1262ca..70d99e52329 100644 --- a/drivers/media/video/ov511.h +++ b/drivers/media/video/ov511.h @@ -12,7 +12,8 @@ #ifdef OV511_DEBUG #define PDEBUG(level, fmt, args...) \ - if (debug >= (level)) info("[%s:%d] " fmt, \ + if (debug >= (level)) \ + printk(KERN_INFO KBUILD_MODNAME "[%s:%d] \n" fmt, \ __func__, __LINE__ , ## args) #else #define PDEBUG(level, fmt, args...) do {} while(0) diff --git a/drivers/media/video/pvrusb2/pvrusb2-main.c b/drivers/media/video/pvrusb2/pvrusb2-main.c index ad0d98c2ebb..9b3c874d96d 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-main.c +++ b/drivers/media/video/pvrusb2/pvrusb2-main.c @@ -137,9 +137,11 @@ static int __init pvr_init(void) ret = usb_register(&pvr_driver); if (ret == 0) - info(DRIVER_DESC " : " DRIVER_VERSION); - if (pvrusb2_debug) info("Debug mask is %d (0x%x)", - pvrusb2_debug,pvrusb2_debug); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); + if (pvrusb2_debug) + printk(KERN_INFO KBUILD_MODNAME ": Debug mask is %d (0x%x)\n", + pvrusb2_debug,pvrusb2_debug); pvr2_trace(PVR2_TRACE_INIT,"pvr_init complete"); diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c index b01f25d7292..ae3949180c4 100644 --- a/drivers/media/video/se401.c +++ b/drivers/media/video/se401.c @@ -288,7 +288,7 @@ static void se401_button_irq(struct urb *urb) int status; if (!se401->dev) { - info("ohoh: device vapourished"); + dev_info(&urb->dev->dev, "device vapourished\n"); return; } @@ -328,7 +328,7 @@ static void se401_video_irq(struct urb *urb) return; if (!se401->dev) { - info ("ohoh: device vapourished"); + dev_info(&urb->dev->dev, "device vapourished\n"); return; } @@ -375,7 +375,7 @@ static void se401_video_irq(struct urb *urb) urb->status=0; urb->dev=se401->dev; if(usb_submit_urb(urb, GFP_KERNEL)) - info("urb burned down"); + dev_info(&urb->dev->dev, "urb burned down\n"); return; } @@ -860,7 +860,8 @@ static int se401_newframe(struct usb_se401 *se401, int framenr) ); if (se401->nullpackets > SE401_MAX_NULLPACKETS) { se401->nullpackets=0; - info("to many null length packets, restarting capture"); + dev_info(&se401->dev->dev, + "too many null length packets, restarting capture\n"); se401_stop_stream(se401); se401_start_stream(se401); } else { @@ -880,7 +881,8 @@ static int se401_newframe(struct usb_se401 *se401, int framenr) se401->scratch_use=0; if (errors > SE401_MAX_ERRORS) { errors=0; - info("to much errors, restarting capture"); + dev_info(&se401->dev->dev, + "too many errors, restarting capture\n"); se401_stop_stream(se401); se401_start_stream(se401); } @@ -913,7 +915,7 @@ static void usb_se401_remove_disconnected (struct usb_se401 *se401) usb_kill_urb(se401->inturb); usb_free_urb(se401->inturb); } - info("%s disconnected", se401->camera_name); + dev_info(&se401->dev->dev, "%s disconnected", se401->camera_name); /* Free the memory */ kfree(se401->width); @@ -960,8 +962,8 @@ static int se401_close(struct inode *inode, struct file *file) rvfree(se401->fbuf, se401->maxframesize * SE401_NUMFRAMES); if (se401->removed) { + dev_info(&se401->dev->dev, "device unregistered\n"); usb_se401_remove_disconnected(se401); - info("device unregistered"); } else { for (i=0; iframe[i].grabstate=FRAME_UNUSED; @@ -1276,7 +1278,7 @@ static int se401_init(struct usb_se401 *se401, int button) for (i=0; isizes; i++) { sprintf(temp, "%s %dx%d", temp, se401->width[i], se401->height[i]); } - info("%s", temp); + dev_info(&se401->dev->dev, "%s\n", temp); se401->maxframesize=se401->width[se401->sizes-1]*se401->height[se401->sizes-1]*3; rc=se401_sndctrl(0, se401, SE401_REQ_GET_WIDTH, 0, cp, sizeof(cp)); @@ -1310,7 +1312,8 @@ static int se401_init(struct usb_se401 *se401, int button) if (button) { se401->inturb=usb_alloc_urb(0, GFP_KERNEL); if (!se401->inturb) { - info("Allocation of inturb failed"); + dev_info(&se401->dev->dev, + "Allocation of inturb failed\n"); return 1; } usb_fill_int_urb(se401->inturb, se401->dev, @@ -1321,7 +1324,7 @@ static int se401_init(struct usb_se401 *se401, int button) 8 ); if (usb_submit_urb(se401->inturb, GFP_KERNEL)) { - info("int urb burned down"); + dev_info(&se401->dev->dev, "int urb burned down\n"); return 1; } } else @@ -1378,7 +1381,7 @@ static int se401_probe(struct usb_interface *intf, return -ENODEV; /* We found one */ - info("SE401 camera found: %s", camera_name); + dev_info(&intf->dev, "SE401 camera found: %s\n", camera_name); if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) { err("couldn't kmalloc se401 struct"); @@ -1389,7 +1392,8 @@ static int se401_probe(struct usb_interface *intf, se401->iface = interface->bInterfaceNumber; se401->camera_name = camera_name; - info("firmware version: %02x", le16_to_cpu(dev->descriptor.bcdDevice) & 255); + dev_info(&intf->dev, "firmware version: %02x\n", + le16_to_cpu(dev->descriptor.bcdDevice) & 255); if (se401_init(se401, button)) { kfree(se401); @@ -1407,7 +1411,8 @@ static int se401_probe(struct usb_interface *intf, err("video_register_device failed"); return -EIO; } - info("registered new video device: video%d", se401->vdev.minor); + dev_info(&intf->dev, "registered new video device: video%d\n", + se401->vdev.minor); usb_set_intfdata (intf, se401); return 0; @@ -1451,10 +1456,10 @@ static struct usb_driver se401_driver = { static int __init usb_se401_init(void) { - info("SE401 usb camera driver version %s registering", version); + printk(KERN_INFO "SE401 usb camera driver version %s registering\n", version); if (flickerless) if (flickerless!=50 && flickerless!=60) { - info("Invallid flickerless value, use 0, 50 or 60."); + printk(KERN_ERR "Invallid flickerless value, use 0, 50 or 60.\n"); return -1; } return usb_register(&se401_driver); @@ -1463,7 +1468,7 @@ static int __init usb_se401_init(void) static void __exit usb_se401_exit(void) { usb_deregister(&se401_driver); - info("SE401 driver deregistered"); + printk(KERN_INFO "SE401 driver deregistered\frame"); } module_init(usb_se401_init); diff --git a/drivers/media/video/stv680.c b/drivers/media/video/stv680.c index b21a8d6827c..9c549d93599 100644 --- a/drivers/media/video/stv680.c +++ b/drivers/media/video/stv680.c @@ -84,7 +84,8 @@ static unsigned int debug; #define PDEBUG(level, fmt, args...) \ do { \ if (debug >= level) \ - info("[%s:%d] " fmt, __func__, __LINE__ , ## args); \ + printk(KERN_INFO KBUILD_MODNAME " [%s:%d] \n" fmt, \ + __func__, __LINE__ , ## args); \ } while (0) @@ -1552,7 +1553,8 @@ static int __init usb_stv680_init (void) } PDEBUG (0, "STV(i): usb camera driver version %s registering", DRIVER_VERSION); - info(DRIVER_DESC " " DRIVER_VERSION); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return 0; } diff --git a/drivers/media/video/usbvideo/ibmcam.c b/drivers/media/video/usbvideo/ibmcam.c index cc27efe121d..28421d386f1 100644 --- a/drivers/media/video/usbvideo/ibmcam.c +++ b/drivers/media/video/usbvideo/ibmcam.c @@ -258,7 +258,9 @@ static enum ParseState ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame h (RING_QUEUE_PEEK(&uvd->dp, 2) == 0x00)) { #if 0 /* This code helps to detect new frame markers */ - info("Header sig: 00 FF 00 %02X", RING_QUEUE_PEEK(&uvd->dp, 3)); + dev_info(&uvd->dev->dev, + "Header sig: 00 FF 00 %02X\n", + RING_QUEUE_PEEK(&uvd->dp, 3)); #endif frame->header = RING_QUEUE_PEEK(&uvd->dp, 3); if ((frame->header == HDRSIG_MODEL1_128x96) || @@ -266,7 +268,8 @@ static enum ParseState ibmcam_find_header(struct uvd *uvd) /* FIXME: Add frame h (frame->header == HDRSIG_MODEL1_352x288)) { #if 0 - info("Header found."); + dev_info(&uvd->dev->dev, + "Header found.\n"); #endif RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, marker_len); icam->has_hdr = 1; @@ -295,7 +298,7 @@ case IBMCAM_MODEL_4: (RING_QUEUE_PEEK(&uvd->dp, 1) == 0xFF)) { #if 0 - info("Header found."); + dev_info(&uvd->dev->dev, "Header found.\n"); #endif RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, marker_len); icam->has_hdr = 1; @@ -338,7 +341,7 @@ case IBMCAM_MODEL_4: byte4 = RING_QUEUE_PEEK(&uvd->dp, 3); frame->header = (byte3 << 8) | byte4; #if 0 - info("Header found."); + dev_info(&uvd->dev->dev, "Header found.\n"); #endif RING_QUEUE_DEQUEUE_BYTES(&uvd->dp, marker_len); icam->has_hdr = 1; @@ -354,7 +357,8 @@ case IBMCAM_MODEL_4: } if (!icam->has_hdr) { if (uvd->debug > 2) - info("Skipping frame, no header"); + dev_info(&uvd->dev->dev, + "Skipping frame, no header\n"); return scan_EndParse; } @@ -881,7 +885,9 @@ static enum ParseState ibmcam_model3_parse_lines( */ if ((frame->curline + 1) >= data_h) { if (uvd->debug >= 3) - info("Reached line %d. (frame is done)", frame->curline); + dev_info(&uvd->dev->dev, + "Reached line %d. (frame is done)\n", + frame->curline); return scan_NextFrame; } @@ -954,8 +960,9 @@ static enum ParseState ibmcam_model3_parse_lines( if (frame->curline >= VIDEOSIZE_Y(frame->request)) { if (uvd->debug >= 3) { - info("All requested lines (%ld.) done.", - VIDEOSIZE_Y(frame->request)); + dev_info(&uvd->dev->dev, + "All requested lines (%ld.) done.\n", + VIDEOSIZE_Y(frame->request)); } return scan_NextFrame; } else @@ -1000,7 +1007,9 @@ static enum ParseState ibmcam_model4_128x96_parse_lines( */ if ((frame->curline + 1) >= data_h) { if (uvd->debug >= 3) - info("Reached line %d. (frame is done)", frame->curline); + dev_info(&uvd->dev->dev, + "Reached line %d. (frame is done)\n", + frame->curline); return scan_NextFrame; } @@ -1049,8 +1058,9 @@ static enum ParseState ibmcam_model4_128x96_parse_lines( if (frame->curline >= VIDEOSIZE_Y(frame->request)) { if (uvd->debug >= 3) { - info("All requested lines (%ld.) done.", - VIDEOSIZE_Y(frame->request)); + dev_info(&uvd->dev->dev, + "All requested lines (%ld.) done.\n", + VIDEOSIZE_Y(frame->request)); } return scan_NextFrame; } else @@ -1171,10 +1181,11 @@ static int ibmcam_veio( sizeof(cp), 1000); #if 0 - info("USB => %02x%02x%02x%02x%02x%02x%02x%02x " - "(req=$%02x val=$%04x ind=$%04x)", - cp[0],cp[1],cp[2],cp[3],cp[4],cp[5],cp[6],cp[7], - req, value, index); + dev_info(&uvd->dev->dev, + "USB => %02x%02x%02x%02x%02x%02x%02x%02x " + "(req=$%02x val=$%04x ind=$%04x)\n", + cp[0],cp[1],cp[2],cp[3],cp[4],cp[5],cp[6],cp[7], + req, value, index); #endif } else { i = usb_control_msg( @@ -1449,10 +1460,9 @@ static void ibmcam_adjust_contrast(struct uvd *uvd) */ static void ibmcam_change_lighting_conditions(struct uvd *uvd) { - static const char proc[] = "ibmcam_change_lighting_conditions"; - if (debug > 0) - info("%s: Set lighting to %hu.", proc, lighting); + dev_info(&uvd->dev->dev, + "%s: Set lighting to %hu.\n", __func__, lighting); switch (IBMCAM_T(uvd)->camera_model) { case IBMCAM_MODEL_1: @@ -1495,8 +1505,6 @@ static void ibmcam_change_lighting_conditions(struct uvd *uvd) */ static void ibmcam_set_sharpness(struct uvd *uvd) { - static const char proc[] = "ibmcam_set_sharpness"; - switch (IBMCAM_T(uvd)->camera_model) { case IBMCAM_MODEL_1: { @@ -1505,7 +1513,8 @@ static void ibmcam_set_sharpness(struct uvd *uvd) RESTRICT_TO_RANGE(sharpness, SHARPNESS_MIN, SHARPNESS_MAX); if (debug > 0) - info("%s: Set sharpness to %hu.", proc, sharpness); + dev_info(&uvd->dev->dev, "%s: Set sharpness to %hu.\n", + __func__, sharpness); sv = sa[sharpness - SHARPNESS_MIN]; for (i=0; i < 2; i++) { @@ -1564,11 +1573,11 @@ static void ibmcam_set_sharpness(struct uvd *uvd) */ static void ibmcam_set_brightness(struct uvd *uvd) { - static const char proc[] = "ibmcam_set_brightness"; static const unsigned short n = 1; if (debug > 0) - info("%s: Set brightness to %hu.", proc, uvd->vpic.brightness); + dev_info(&uvd->dev->dev, "%s: Set brightness to %hu.\n", + __func__, uvd->vpic.brightness); switch (IBMCAM_T(uvd)->camera_model) { case IBMCAM_MODEL_1: @@ -2115,7 +2124,8 @@ static void ibmcam_model2_setup_after_video_if(struct uvd *uvd) break; } if (uvd->debug > 0) - info("Framerate (hardware): %hd.", hw_fps); + dev_info(&uvd->dev->dev, "Framerate (hardware): %hd.\n", + hw_fps); RESTRICT_TO_RANGE(hw_fps, 0, 31); ibmcam_model2_Packet1(uvd, mod2_set_framerate, hw_fps); } @@ -3487,7 +3497,7 @@ static void ibmcam_model3_setup_after_video_if(struct uvd *uvd) /* 01.01.08 - Added for RCA video in support -LO */ if(init_model3_input) { if (debug > 0) - info("Setting input to RCA."); + dev_info(&uvd->dev->dev, "Setting input to RCA.\n"); for (i=0; i < ARRAY_SIZE(initData); i++) { ibmcam_veio(uvd, initData[i].req, initData[i].value, initData[i].index); } @@ -3685,7 +3695,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id * unsigned char video_ep = 0; if (debug >= 1) - info("ibmcam_probe(%p,%u.)", intf, ifnum); + dev_info(&uvd->dev->dev, "ibmcam_probe(%p,%u.)\n", intf, ifnum); /* We don't handle multi-config cameras */ if (dev->descriptor.bNumConfigurations != 1) @@ -3736,14 +3746,16 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id * brand = "IBM PC Camera"; /* a.k.a. Xirlink C-It */ break; } - info("%s USB camera found (model %d, rev. 0x%04x)", - brand, model, le16_to_cpu(dev->descriptor.bcdDevice)); + dev_info(&uvd->dev->dev, + "%s USB camera found (model %d, rev. 0x%04x)\n", + brand, model, le16_to_cpu(dev->descriptor.bcdDevice)); } while (0); /* Validate found interface: must have one ISO endpoint */ nas = intf->num_altsetting; if (debug > 0) - info("Number of alternate settings=%d.", nas); + dev_info(&uvd->dev->dev, "Number of alternate settings=%d.\n", + nas); if (nas < 2) { err("Too few alternate settings for this camera!"); return -ENODEV; @@ -3787,7 +3799,9 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id * actInterface = i; maxPS = le16_to_cpu(endpoint->wMaxPacketSize); if (debug > 0) - info("Active setting=%d. maxPS=%d.", i, maxPS); + dev_info(&uvd->dev->dev, + "Active setting=%d. " + "maxPS=%d.\n", i, maxPS); } else err("More than one active alt. setting! Ignoring #%d.", i); } @@ -3826,7 +3840,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id * RESTRICT_TO_RANGE(framerate, 0, 5); break; default: - info("IBM camera: using 320x240"); + dev_info(&uvd->dev->dev, "IBM camera: using 320x240\n"); size = SIZE_320x240; /* No break here */ case SIZE_320x240: @@ -3855,7 +3869,7 @@ static int ibmcam_probe(struct usb_interface *intf, const struct usb_device_id * canvasY = 120; break; default: - info("IBM NetCamera: using 176x144"); + dev_info(&uvd->dev->dev, "IBM NetCamera: using 176x144\n"); size = SIZE_176x144; /* No break here */ case SIZE_176x144: diff --git a/drivers/media/video/usbvideo/konicawc.c b/drivers/media/video/usbvideo/konicawc.c index 1c180284ec6..e986c28b7bb 100644 --- a/drivers/media/video/usbvideo/konicawc.c +++ b/drivers/media/video/usbvideo/konicawc.c @@ -337,7 +337,8 @@ static int konicawc_compress_iso(struct uvd *uvd, struct urb *dataurb, struct ur } if((sts > 0x01) && (sts < 0x80)) { - info("unknown status %2.2x", sts); + dev_info(&uvd->dev->dev, "unknown status %2.2x\n", + sts); bad++; continue; } @@ -568,8 +569,12 @@ static void konicawc_process_isoc(struct uvd *uvd, struct usbvideo_frame *frame) fdrops = (0x80 + curframe - cam->lastframe) & 0x7F; fdrops--; if(fdrops) { - info("Dropped %d frames (%d -> %d)", fdrops, - cam->lastframe, curframe); + dev_info(&uvd->dev->dev, + "Dropped %d frames " + "(%d -> %d)\n", + fdrops, + cam->lastframe, + curframe); } } cam->lastframe = curframe; @@ -784,7 +789,8 @@ static int konicawc_probe(struct usb_interface *intf, const struct usb_device_id if (dev->descriptor.bNumConfigurations != 1) return -ENODEV; - info("Konica Webcam (rev. 0x%04x)", le16_to_cpu(dev->descriptor.bcdDevice)); + dev_info(&intf->dev, "Konica Webcam (rev. 0x%04x)\n", + le16_to_cpu(dev->descriptor.bcdDevice)); RESTRICT_TO_RANGE(speed, 0, MAX_SPEED); /* Validate found interface: must have one ISO endpoint */ @@ -925,7 +931,8 @@ static struct usb_device_id id_table[] = { static int __init konicawc_init(void) { struct usbvideo_cb cbTbl; - info(DRIVER_DESC " " DRIVER_VERSION); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); memset(&cbTbl, 0, sizeof(cbTbl)); cbTbl.probe = konicawc_probe; cbTbl.setupOnOpen = konicawc_setup_on_open; diff --git a/drivers/media/video/usbvideo/quickcam_messenger.c b/drivers/media/video/usbvideo/quickcam_messenger.c index 3d26a30abe1..05c61b52311 100644 --- a/drivers/media/video/usbvideo/quickcam_messenger.c +++ b/drivers/media/video/usbvideo/quickcam_messenger.c @@ -1080,7 +1080,8 @@ static struct usbvideo_cb qcm_driver = { static int __init qcm_init(void) { - info(DRIVER_DESC " " DRIVER_VERSION); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + DRIVER_DESC "\n"); return usbvideo_register( &cams, diff --git a/drivers/media/video/usbvideo/ultracam.c b/drivers/media/video/usbvideo/ultracam.c index 9544e644bf0..9714baab783 100644 --- a/drivers/media/video/usbvideo/ultracam.c +++ b/drivers/media/video/usbvideo/ultracam.c @@ -156,10 +156,11 @@ static int ultracam_veio( sizeof(cp), 1000); #if 1 - info("USB => %02x%02x%02x%02x%02x%02x%02x%02x " - "(req=$%02x val=$%04x ind=$%04x)", - cp[0],cp[1],cp[2],cp[3],cp[4],cp[5],cp[6],cp[7], - req, value, index); + dev_info(&uvd->dev->dev, + "USB => %02x%02x%02x%02x%02x%02x%02x%02x " + "(req=$%02x val=$%04x ind=$%04x)\n", + cp[0],cp[1],cp[2],cp[3],cp[4],cp[5],cp[6],cp[7], + req, value, index); #endif } else { i = usb_control_msg( @@ -517,19 +518,20 @@ static int ultracam_probe(struct usb_interface *intf, const struct usb_device_id unsigned char video_ep = 0; if (debug >= 1) - info("ultracam_probe(%p)", intf); + dev_info(&intf->dev, "ultracam_probe\n"); /* We don't handle multi-config cameras */ if (dev->descriptor.bNumConfigurations != 1) return -ENODEV; - info("IBM Ultra camera found (rev. 0x%04x)", - le16_to_cpu(dev->descriptor.bcdDevice)); + dev_info(&intf->dev, "IBM Ultra camera found (rev. 0x%04x)\n", + le16_to_cpu(dev->descriptor.bcdDevice)); /* Validate found interface: must have one ISO endpoint */ nas = intf->num_altsetting; if (debug > 0) - info("Number of alternate settings=%d.", nas); + dev_info(&intf->dev, "Number of alternate settings=%d.\n", + nas); if (nas < 8) { err("Too few alternate settings for this camera!"); return -ENODEV; @@ -576,7 +578,9 @@ static int ultracam_probe(struct usb_interface *intf, const struct usb_device_id actInterface = i; maxPS = le16_to_cpu(endpoint->wMaxPacketSize); if (debug > 0) - info("Active setting=%d. maxPS=%d.", i, maxPS); + dev_info(&intf->dev, + "Active setting=%d. " + "maxPS=%d.\n", i, maxPS); } else { /* Got another active alt. setting */ if (maxPS < le16_to_cpu(endpoint->wMaxPacketSize)) { @@ -584,8 +588,11 @@ static int ultracam_probe(struct usb_interface *intf, const struct usb_device_id actInterface = i; maxPS = le16_to_cpu(endpoint->wMaxPacketSize); if (debug > 0) { - info("Even better ctive setting=%d. maxPS=%d.", - i, maxPS); + dev_info(&intf->dev, + "Even better ctive " + "setting=%d. " + "maxPS=%d.\n", + i, maxPS); } } } diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c index 9569e8ced4b..07cd87d16f6 100644 --- a/drivers/media/video/usbvideo/usbvideo.c +++ b/drivers/media/video/usbvideo/usbvideo.c @@ -468,8 +468,9 @@ static void usbvideo_ReportStatistics(const struct uvd *uvd) percent = (100 * goodPackets) / allPackets; else percent = goodPackets / (allPackets / 100); - info("Packet Statistics: Total=%lu. Empty=%lu. Usage=%lu%%", - allPackets, badPackets, percent); + dev_info(&uvd->dev->dev, + "Packet Statistics: Total=%lu. Empty=%lu. Usage=%lu%%\n", + allPackets, badPackets, percent); if (uvd->iso_packet_len > 0) { unsigned long allBytes, xferBytes; char multiplier = ' '; @@ -497,8 +498,9 @@ static void usbvideo_ReportStatistics(const struct uvd *uvd) } } } - info("Transfer Statistics: Transferred=%lu%cB Usage=%lu%%", - xferBytes, multiplier, percent); + dev_info(&uvd->dev->dev, + "Transfer Statistics: Transferred=%lu%cB Usage=%lu%%\n", + xferBytes, multiplier, percent); } } } @@ -545,7 +547,7 @@ void usbvideo_TestPattern(struct uvd *uvd, int fullframe, int pmode) { /* For debugging purposes only */ char tmp[20]; usbvideo_VideosizeToString(tmp, sizeof(tmp), frame->request); - info("testpattern: frame=%s", tmp); + dev_info(&uvd->dev->dev, "testpattern: frame=%s\n", tmp); } #endif /* Form every scan line */ @@ -854,7 +856,7 @@ static void usbvideo_Disconnect(struct usb_interface *intf) usbvideo_ClientIncModCount(uvd); if (uvd->debug > 0) - info("%s(%p.)", __func__, intf); + dev_info(&intf->dev, "%s(%p.)\n", __func__, intf); mutex_lock(&uvd->lock); uvd->remove_pending = 1; /* Now all ISO data will be ignored */ @@ -870,14 +872,15 @@ static void usbvideo_Disconnect(struct usb_interface *intf) video_unregister_device(&uvd->vdev); if (uvd->debug > 0) - info("%s: Video unregistered.", __func__); + dev_info(&intf->dev, "%s: Video unregistered.\n", __func__); if (uvd->user) - info("%s: In use, disconnect pending.", __func__); + dev_info(&intf->dev, "%s: In use, disconnect pending.\n", + __func__); else usbvideo_CameraRelease(uvd); mutex_unlock(&uvd->lock); - info("USB camera disconnected."); + dev_info(&intf->dev, "USB camera disconnected.\n"); usbvideo_ClientDecModCount(uvd); } @@ -1015,14 +1018,17 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd) return -EINVAL; } if (uvd->video_endp == 0) { - info("%s: No video endpoint specified; data pump disabled.", __func__); + dev_info(&uvd->dev->dev, + "%s: No video endpoint specified; data pump disabled.\n", + __func__); } if (uvd->paletteBits == 0) { err("%s: No palettes specified!", __func__); return -EINVAL; } if (uvd->defaultPalette == 0) { - info("%s: No default palette!", __func__); + dev_info(&uvd->dev->dev, "%s: No default palette!\n", + __func__); } uvd->max_frame_size = VIDEOSIZE_X(uvd->canvas) * @@ -1031,8 +1037,10 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd) usbvideo_VideosizeToString(tmp2, sizeof(tmp2), uvd->canvas); if (uvd->debug > 0) { - info("%s: iface=%d. endpoint=$%02x paletteBits=$%08lx", - __func__, uvd->iface, uvd->video_endp, uvd->paletteBits); + dev_info(&uvd->dev->dev, + "%s: iface=%d. endpoint=$%02x paletteBits=$%08lx\n", + __func__, uvd->iface, uvd->video_endp, + uvd->paletteBits); } if (uvd->dev == NULL) { err("%s: uvd->dev == NULL", __func__); @@ -1045,12 +1053,13 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd) return -EPIPE; } if (uvd->debug > 1) { - info("%s: video_register_device() successful", __func__); + dev_info(&uvd->dev->dev, + "%s: video_register_device() successful\n", __func__); } - info("%s on /dev/video%d: canvas=%s videosize=%s", - (uvd->handle != NULL) ? uvd->handle->drvName : "???", - uvd->vdev.minor, tmp2, tmp1); + dev_info(&uvd->dev->dev, "%s on /dev/video%d: canvas=%s videosize=%s\n", + (uvd->handle != NULL) ? uvd->handle->drvName : "???", + uvd->vdev.minor, tmp2, tmp1); usb_get_dev(uvd->dev); return 0; @@ -1112,7 +1121,7 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file) int i, errCode = 0; if (uvd->debug > 1) - info("%s($%p)", __func__, dev); + dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, dev); if (0 < usbvideo_ClientIncModCount(uvd)) return -ENODEV; @@ -1179,19 +1188,25 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file) if (errCode == 0) { if (VALID_CALLBACK(uvd, setupOnOpen)) { if (uvd->debug > 1) - info("%s: setupOnOpen callback", __func__); + dev_info(&uvd->dev->dev, + "%s: setupOnOpen callback\n", + __func__); errCode = GET_CALLBACK(uvd, setupOnOpen)(uvd); if (errCode < 0) { err("%s: setupOnOpen callback failed (%d.).", __func__, errCode); } else if (uvd->debug > 1) { - info("%s: setupOnOpen callback successful", __func__); + dev_info(&uvd->dev->dev, + "%s: setupOnOpen callback successful\n", + __func__); } } if (errCode == 0) { uvd->settingsAdjusted = 0; if (uvd->debug > 1) - info("%s: Open succeeded.", __func__); + dev_info(&uvd->dev->dev, + "%s: Open succeeded.\n", + __func__); uvd->user++; file->private_data = uvd; } @@ -1201,7 +1216,8 @@ static int usbvideo_v4l_open(struct inode *inode, struct file *file) if (errCode != 0) usbvideo_ClientDecModCount(uvd); if (uvd->debug > 0) - info("%s: Returning %d.", __func__, errCode); + dev_info(&uvd->dev->dev, "%s: Returning %d.\n", __func__, + errCode); return errCode; } @@ -1224,7 +1240,7 @@ static int usbvideo_v4l_close(struct inode *inode, struct file *file) int i; if (uvd->debug > 1) - info("%s($%p)", __func__, dev); + dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, dev); mutex_lock(&uvd->lock); GET_CALLBACK(uvd, stopDataPump)(uvd); @@ -1244,14 +1260,15 @@ static int usbvideo_v4l_close(struct inode *inode, struct file *file) uvd->user--; if (uvd->remove_pending) { if (uvd->debug > 0) - info("usbvideo_v4l_close: Final disconnect."); + dev_info(&uvd->dev->dev, "%s: Final disconnect.\n", + __func__); usbvideo_CameraRelease(uvd); } mutex_unlock(&uvd->lock); usbvideo_ClientDecModCount(uvd); if (uvd->debug > 1) - info("%s: Completed.", __func__); + dev_info(&uvd->dev->dev, "%s: Completed.\n", __func__); file->private_data = NULL; return 0; } @@ -1365,8 +1382,9 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file, struct video_mmap *vm = arg; if (uvd->debug >= 1) { - info("VIDIOCMCAPTURE: frame=%d. size=%dx%d, format=%d.", - vm->frame, vm->width, vm->height, vm->format); + dev_info(&uvd->dev->dev, + "VIDIOCMCAPTURE: frame=%d. size=%dx%d, format=%d.\n", + vm->frame, vm->width, vm->height, vm->format); } /* * Check if the requested size is supported. If the requestor @@ -1384,18 +1402,24 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file, if ((vm->width > VIDEOSIZE_X(uvd->canvas)) || (vm->height > VIDEOSIZE_Y(uvd->canvas))) { if (uvd->debug > 0) { - info("VIDIOCMCAPTURE: Size=%dx%d too large; " - "allowed only up to %ldx%ld", vm->width, vm->height, - VIDEOSIZE_X(uvd->canvas), VIDEOSIZE_Y(uvd->canvas)); + dev_info(&uvd->dev->dev, + "VIDIOCMCAPTURE: Size=%dx%d " + "too large; allowed only up " + "to %ldx%ld\n", vm->width, + vm->height, + VIDEOSIZE_X(uvd->canvas), + VIDEOSIZE_Y(uvd->canvas)); } return -EINVAL; } /* Check if the palette is supported */ if (((1L << vm->format) & uvd->paletteBits) == 0) { if (uvd->debug > 0) { - info("VIDIOCMCAPTURE: format=%d. not supported" - " (paletteBits=$%08lx)", - vm->format, uvd->paletteBits); + dev_info(&uvd->dev->dev, + "VIDIOCMCAPTURE: format=%d. " + "not supported " + "(paletteBits=$%08lx)\n", + vm->format, uvd->paletteBits); } return -EINVAL; } @@ -1423,7 +1447,9 @@ static int usbvideo_v4l_do_ioctl(struct inode *inode, struct file *file, return -EINVAL; if (uvd->debug >= 1) - info("VIDIOCSYNC: syncing to frame %d.", *frameNum); + dev_info(&uvd->dev->dev, + "VIDIOCSYNC: syncing to frame %d.\n", + *frameNum); if (uvd->flags & FLAGS_NO_DECODING) ret = usbvideo_GetFrame(uvd, *frameNum); else if (VALID_CALLBACK(uvd, getFrame)) { @@ -1505,7 +1531,9 @@ static ssize_t usbvideo_v4l_read(struct file *file, char __user *buf, return -EFAULT; if (uvd->debug >= 1) - info("%s: %Zd. bytes, noblock=%d.", __func__, count, noblock); + dev_info(&uvd->dev->dev, + "%s: %Zd. bytes, noblock=%d.\n", + __func__, count, noblock); mutex_lock(&uvd->lock); @@ -1686,18 +1714,21 @@ static void usbvideo_IsocIrq(struct urb *urb) return; #if 0 if (urb->actual_length > 0) { - info("urb=$%p status=%d. errcount=%d. length=%d.", - urb, urb->status, urb->error_count, urb->actual_length); + dev_info(&uvd->dev->dev, + "urb=$%p status=%d. errcount=%d. length=%d.\n", + urb, urb->status, urb->error_count, + urb->actual_length); } else { static int c = 0; if (c++ % 100 == 0) - info("No Isoc data"); + dev_info(&uvd->dev->dev, "No Isoc data\n"); } #endif if (!uvd->streaming) { if (uvd->debug >= 1) - info("Not streaming, but interrupt!"); + dev_info(&uvd->dev->dev, + "Not streaming, but interrupt!\n"); return; } @@ -1742,7 +1773,7 @@ static int usbvideo_StartDataPump(struct uvd *uvd) int i, errFlag; if (uvd->debug > 1) - info("%s($%p)", __func__, uvd); + dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, uvd); if (!CAMERA_IS_OPERATIONAL(uvd)) { err("%s: Camera is not operational", __func__); @@ -1790,7 +1821,9 @@ static int usbvideo_StartDataPump(struct uvd *uvd) uvd->streaming = 1; if (uvd->debug > 1) - info("%s: streaming=1 video_endp=$%02x", __func__, uvd->video_endp); + dev_info(&uvd->dev->dev, + "%s: streaming=1 video_endp=$%02x\n", __func__, + uvd->video_endp); return 0; } @@ -1812,14 +1845,14 @@ static void usbvideo_StopDataPump(struct uvd *uvd) return; if (uvd->debug > 1) - info("%s($%p)", __func__, uvd); + dev_info(&uvd->dev->dev, "%s($%p)\n", __func__, uvd); /* Unschedule all of the iso td's */ for (i=0; i < USBVIDEO_NUMSBUF; i++) { usb_kill_urb(uvd->sbuf[i].urb); } if (uvd->debug > 1) - info("%s: streaming=0", __func__); + dev_info(&uvd->dev->dev, "%s: streaming=0\n", __func__); uvd->streaming = 0; if (!uvd->remove_pending) { @@ -1851,7 +1884,8 @@ static int usbvideo_NewFrame(struct uvd *uvd, int framenum) int n; if (uvd->debug > 1) - info("usbvideo_NewFrame($%p,%d.)", uvd, framenum); + dev_info(&uvd->dev->dev, "usbvideo_NewFrame($%p,%d.)\n", uvd, + framenum); /* If we're not grabbing a frame right now and the other frame is */ /* ready to be grabbed into, then use it instead */ @@ -1956,12 +1990,14 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) struct usbvideo_frame *frame = &uvd->frame[frameNum]; if (uvd->debug >= 2) - info("%s($%p,%d.)", __func__, uvd, frameNum); + dev_info(&uvd->dev->dev, "%s($%p,%d.)\n", __func__, uvd, + frameNum); switch (frame->frameState) { case FrameState_Unused: if (uvd->debug >= 2) - info("%s: FrameState_Unused", __func__); + dev_info(&uvd->dev->dev, "%s: FrameState_Unused\n", + __func__); return -EINVAL; case FrameState_Ready: case FrameState_Grabbing: @@ -1971,7 +2007,9 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) redo: if (!CAMERA_IS_OPERATIONAL(uvd)) { if (uvd->debug >= 2) - info("%s: Camera is not operational (1)", __func__); + dev_info(&uvd->dev->dev, + "%s: Camera is not operational (1)\n", + __func__); return -EIO; } ntries = 0; @@ -1980,24 +2018,33 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) signalPending = signal_pending(current); if (!CAMERA_IS_OPERATIONAL(uvd)) { if (uvd->debug >= 2) - info("%s: Camera is not operational (2)", __func__); + dev_info(&uvd->dev->dev, + "%s: Camera is not " + "operational (2)\n", __func__); return -EIO; } assert(uvd->fbuf != NULL); if (signalPending) { if (uvd->debug >= 2) - info("%s: Signal=$%08x", __func__, signalPending); + dev_info(&uvd->dev->dev, + "%s: Signal=$%08x\n", __func__, + signalPending); if (uvd->flags & FLAGS_RETRY_VIDIOCSYNC) { usbvideo_TestPattern(uvd, 1, 0); uvd->curframe = -1; uvd->stats.frame_num++; if (uvd->debug >= 2) - info("%s: Forced test pattern screen", __func__); + dev_info(&uvd->dev->dev, + "%s: Forced test " + "pattern screen\n", + __func__); return 0; } else { /* Standard answer: Interrupted! */ if (uvd->debug >= 2) - info("%s: Interrupted!", __func__); + dev_info(&uvd->dev->dev, + "%s: Interrupted!\n", + __func__); return -EINTR; } } else { @@ -2011,8 +2058,10 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) } } while (frame->frameState == FrameState_Grabbing); if (uvd->debug >= 2) { - info("%s: Grabbing done; state=%d. (%lu. bytes)", - __func__, frame->frameState, frame->seqRead_Length); + dev_info(&uvd->dev->dev, + "%s: Grabbing done; state=%d. (%lu. bytes)\n", + __func__, frame->frameState, + frame->seqRead_Length); } if (frame->frameState == FrameState_Error) { int ret = usbvideo_NewFrame(uvd, frameNum); @@ -2049,7 +2098,9 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) } frame->frameState = FrameState_Done_Hold; if (uvd->debug >= 2) - info("%s: Entered FrameState_Done_Hold state.", __func__); + dev_info(&uvd->dev->dev, + "%s: Entered FrameState_Done_Hold state.\n", + __func__); return 0; case FrameState_Done_Hold: @@ -2060,7 +2111,9 @@ static int usbvideo_GetFrame(struct uvd *uvd, int frameNum) * it will be released back into the wild to roam freely. */ if (uvd->debug >= 2) - info("%s: FrameState_Done_Hold state.", __func__); + dev_info(&uvd->dev->dev, + "%s: FrameState_Done_Hold state.\n", + __func__); return 0; } diff --git a/drivers/media/video/usbvision/usbvision-core.c b/drivers/media/video/usbvision/usbvision-core.c index c317ed7a848..b26b563a0b0 100644 --- a/drivers/media/video/usbvision/usbvision-core.c +++ b/drivers/media/video/usbvision/usbvision-core.c @@ -84,7 +84,8 @@ MODULE_PARM_DESC(adjust_Y_Offset, "adjust Y offset display [core]"); #ifdef USBVISION_DEBUG #define PDEBUG(level, fmt, args...) { \ if (core_debug & (level)) \ - info("[%s:%d] " fmt, __func__, __LINE__ , ## args); \ + printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \ + __func__, __LINE__ , ## args); \ } #else #define PDEBUG(level, fmt, args...) do {} while(0) diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c index a6d00858b07..92427fdc145 100644 --- a/drivers/media/video/usbvision/usbvision-i2c.c +++ b/drivers/media/video/usbvision/usbvision-i2c.c @@ -47,7 +47,8 @@ MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]"); #define PDEBUG(level, fmt, args...) { \ if (i2c_debug & (level)) \ - info("[%s:%d] " fmt, __func__, __LINE__ , ## args); \ + printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \ + __func__, __LINE__ , ## args); \ } static int usbvision_i2c_write(struct usb_usbvision *usbvision, unsigned char addr, char *buf, diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c index 782ee643601..e10b256aeba 100644 --- a/drivers/media/video/usbvision/usbvision-video.c +++ b/drivers/media/video/usbvision/usbvision-video.c @@ -98,7 +98,8 @@ USBVISION_DRIVER_VERSION_PATCHLEVEL) #ifdef USBVISION_DEBUG #define PDEBUG(level, fmt, args...) { \ if (video_debug & (level)) \ - info("[%s:%d] " fmt, __func__, __LINE__ , ## args); \ + printk(KERN_INFO KBUILD_MODNAME ":[%s:%d] " fmt, \ + __func__, __LINE__ , ## args); \ } #else #define PDEBUG(level, fmt, args...) do {} while(0) diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c index 93991cb9ca7..7cdac99deea 100644 --- a/drivers/media/video/zr364xx.c +++ b/drivers/media/video/zr364xx.c @@ -52,7 +52,7 @@ /* Debug macro */ -#define DBG(x...) if (debug) info(x) +#define DBG(x...) if (debug) printk(KERN_INFO KBUILD_MODNAME x) /* Init methods, need to find nicer names for these @@ -128,7 +128,7 @@ static int send_control_msg(struct usb_device *udev, u8 request, u16 value, unsigned char *transfer_buffer = kmalloc(size, GFP_KERNEL); if (!transfer_buffer) { - info("kmalloc(%d) failed", size); + dev_err(&udev->dev, "kmalloc(%d) failed\n", size); return -ENOMEM; } @@ -144,7 +144,8 @@ static int send_control_msg(struct usb_device *udev, u8 request, u16 value, kfree(transfer_buffer); if (status < 0) - info("Failed sending control message, error %d.", status); + dev_err(&udev->dev, + "Failed sending control message, error %d.\n", status); return status; } @@ -304,11 +305,11 @@ static int read_frame(struct zr364xx_camera *cam, int framenum) DBG("buffer : %d %d", cam->buffer[0], cam->buffer[1]); DBG("bulk : n=%d size=%d", n, actual_length); if (n < 0) { - info("error reading bulk msg"); + dev_err(&cam->udev->dev, "error reading bulk msg\n"); return 0; } if (actual_length < 0 || actual_length > BUFFER_SIZE) { - info("wrong number of bytes"); + dev_err(&cam->udev->dev, "wrong number of bytes\n"); return 0; } @@ -652,7 +653,7 @@ static int zr364xx_open(struct inode *inode, struct file *file) if (!cam->framebuf) { cam->framebuf = vmalloc_32(MAX_FRAME_SIZE * FRAMES); if (!cam->framebuf) { - info("vmalloc_32 failed!"); + dev_err(&cam->udev->dev, "vmalloc_32 failed!\n"); err = -ENOMEM; goto out; } @@ -664,7 +665,8 @@ static int zr364xx_open(struct inode *inode, struct file *file) 0, init[cam->method][i].bytes, init[cam->method][i].size); if (err < 0) { - info("error during open sequence: %d", i); + dev_err(&cam->udev->dev, + "error during open sequence: %d\n", i); goto out; } } @@ -712,7 +714,7 @@ static int zr364xx_release(struct inode *inode, struct file *file) 0, init[i][cam->method].bytes, init[cam->method][i].size); if (err < 0) { - info("error during release sequence"); + dev_err(&udev->dev, "error during release sequence\n"); goto out; } } @@ -808,13 +810,14 @@ static int zr364xx_probe(struct usb_interface *intf, DBG("probing..."); - info(DRIVER_DESC " compatible webcam plugged"); - info("model %04x:%04x detected", udev->descriptor.idVendor, - udev->descriptor.idProduct); + dev_info(&intf->dev, DRIVER_DESC " compatible webcam plugged\n"); + dev_info(&intf->dev, "model %04x:%04x detected\n", + le16_to_cpu(udev->descriptor.idVendor), + le16_to_cpu(udev->descriptor.idProduct)); cam = kzalloc(sizeof(struct zr364xx_camera), GFP_KERNEL); if (cam == NULL) { - info("cam: out of memory !"); + dev_err(&udev->dev, "cam: out of memory !\n"); return -ENOMEM; } /* save the init method used by this camera */ @@ -822,7 +825,7 @@ static int zr364xx_probe(struct usb_interface *intf, cam->vdev = video_device_alloc(); if (cam->vdev == NULL) { - info("cam->vdev: out of memory !"); + dev_err(&udev->dev, "cam->vdev: out of memory !\n"); kfree(cam); return -ENOMEM; } @@ -834,7 +837,7 @@ static int zr364xx_probe(struct usb_interface *intf, cam->udev = udev; if ((cam->buffer = kmalloc(BUFFER_SIZE, GFP_KERNEL)) == NULL) { - info("cam->buffer: out of memory !"); + dev_info(&udev->dev, "cam->buffer: out of memory !\n"); video_device_release(cam->vdev); kfree(cam); return -ENODEV; @@ -842,17 +845,17 @@ static int zr364xx_probe(struct usb_interface *intf, switch (mode) { case 1: - info("160x120 mode selected"); + dev_info(&udev->dev, "160x120 mode selected\n"); cam->width = 160; cam->height = 120; break; case 2: - info("640x480 mode selected"); + dev_info(&udev->dev, "640x480 mode selected\n"); cam->width = 640; cam->height = 480; break; default: - info("320x240 mode selected"); + dev_info(&udev->dev, "320x240 mode selected\n"); cam->width = 320; cam->height = 240; break; @@ -872,7 +875,7 @@ static int zr364xx_probe(struct usb_interface *intf, err = video_register_device(cam->vdev, VFL_TYPE_GRABBER, -1); if (err) { - info("video_register_device failed"); + dev_err(&udev->dev, "video_register_device failed\n"); video_device_release(cam->vdev); kfree(cam->buffer); kfree(cam); @@ -881,7 +884,8 @@ static int zr364xx_probe(struct usb_interface *intf, usb_set_intfdata(intf, cam); - info(DRIVER_DESC " controlling video device %d", cam->vdev->minor); + dev_info(&udev->dev, DRIVER_DESC " controlling video device %d\n", + cam->vdev->minor); return 0; } @@ -891,7 +895,7 @@ static void zr364xx_disconnect(struct usb_interface *intf) struct zr364xx_camera *cam = usb_get_intfdata(intf); usb_set_intfdata(intf, NULL); dev_set_drvdata(&intf->dev, NULL); - info(DRIVER_DESC " webcam unplugged"); + dev_info(&intf->dev, DRIVER_DESC " webcam unplugged\n"); if (cam->vdev) video_unregister_device(cam->vdev); cam->vdev = NULL; @@ -920,16 +924,16 @@ static int __init zr364xx_init(void) int retval; retval = usb_register(&zr364xx_driver); if (retval) - info("usb_register failed!"); + printk(KERN_ERR KBUILD_MODNAME ": usb_register failed!\n"); else - info(DRIVER_DESC " module loaded"); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n"); return retval; } static void __exit zr364xx_exit(void) { - info(DRIVER_DESC " module unloaded"); + printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC " module unloaded\n"); usb_deregister(&zr364xx_driver); } -- cgit v1.2.3-70-g09d2