Commit 2a96f60e authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] em28xx: convert the remaining printks to pr_foo

There are still several places with printk's called directly.

Convert them to pr_foo() macros, except for the debug printk's,
as those are enabled via modprobe vars.

While here, realign the pr_foo() arguments to match the
recommended CodingStyle.
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 8314d402
...@@ -56,9 +56,8 @@ MODULE_PARM_DESC(debug, "activates debug info"); ...@@ -56,9 +56,8 @@ MODULE_PARM_DESC(debug, "activates debug info");
#define dprintk(fmt, arg...) do { \ #define dprintk(fmt, arg...) do { \
if (debug) \ if (debug) \
printk(KERN_INFO "em28xx-audio %s: " fmt, \ printk(KERN_DEBUG pr_fmt("audio: %s: " fmt), \
__func__, ##arg); \ __func__, ##arg); } while (0)
} while (0)
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;
...@@ -902,9 +901,8 @@ static int em28xx_audio_init(struct em28xx *dev) ...@@ -902,9 +901,8 @@ static int em28xx_audio_init(struct em28xx *dev)
kref_get(&dev->ref); kref_get(&dev->ref);
printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n"); pr_info("em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n");
printk(KERN_INFO pr_info("em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");
"em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n");
err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio", err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio",
THIS_MODULE, 0, &card); THIS_MODULE, 0, &card);
......
...@@ -180,8 +180,7 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ...@@ -180,8 +180,7 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev)
dev->em28xx_sensor = EM28XX_MT9M001; dev->em28xx_sensor = EM28XX_MT9M001;
break; break;
default: default:
pr_info("unknown Micron sensor detected: 0x%04x\n", pr_info("unknown Micron sensor detected: 0x%04x\n", id);
id);
return 0; return 0;
} }
......
...@@ -2882,8 +2882,7 @@ static int em28xx_hint_board(struct em28xx *dev) ...@@ -2882,8 +2882,7 @@ static int em28xx_hint_board(struct em28xx *dev)
pr_err("Here is a list of valid choices for the card=<n> insmod option:\n"); pr_err("Here is a list of valid choices for the card=<n> insmod option:\n");
for (i = 0; i < em28xx_bcount; i++) { for (i = 0; i < em28xx_bcount; i++) {
pr_err(" card=%d -> %s\n", pr_err(" card=%d -> %s\n", i, em28xx_boards[i].name);
i, em28xx_boards[i].name);
} }
return -1; return -1;
} }
...@@ -3318,14 +3317,12 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, ...@@ -3318,14 +3317,12 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
dev->eeprom_addrwidth_16bit = 1; dev->eeprom_addrwidth_16bit = 1;
break; break;
default: default:
printk(KERN_INFO DRIVER_NAME pr_info("unknown em28xx chip ID (%d)\n", dev->chip_id);
": unknown em28xx chip ID (%d)\n", dev->chip_id);
} }
} }
if (chip_name != default_chip_name) if (chip_name != default_chip_name)
printk(KERN_INFO DRIVER_NAME pr_info("chip ID is %s\n", chip_name);
": chip ID is %s\n", chip_name);
/* /*
* For em2820/em2710, the name may change latter, after checking * For em2820/em2710, the name may change latter, after checking
...@@ -3418,8 +3415,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3418,8 +3415,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS); nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS);
if (nr >= EM28XX_MAXBOARDS) { if (nr >= EM28XX_MAXBOARDS) {
/* No free device slots */ /* No free device slots */
printk(DRIVER_NAME pr_err("Driver supports up to %i em28xx boards.\n",
": Supports only %i em28xx boards.\n",
EM28XX_MAXBOARDS); EM28XX_MAXBOARDS);
retval = -ENOMEM; retval = -ENOMEM;
goto err_no_slot; goto err_no_slot;
...@@ -3428,8 +3424,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3428,8 +3424,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
/* Don't register audio interfaces */ /* Don't register audio interfaces */
if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
pr_err(DRIVER_NAME pr_err("audio device (%04x:%04x): interface %i, class %i\n",
" audio device (%04x:%04x): interface %i, class %i\n",
le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idVendor),
le16_to_cpu(udev->descriptor.idProduct), le16_to_cpu(udev->descriptor.idProduct),
ifnum, ifnum,
...@@ -3489,8 +3484,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3489,8 +3484,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
if (usb_endpoint_xfer_isoc(e)) { if (usb_endpoint_xfer_isoc(e)) {
has_vendor_audio = true; has_vendor_audio = true;
} else { } else {
printk(KERN_INFO DRIVER_NAME pr_err("error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
} }
break; break;
case 0x84: case 0x84:
...@@ -3563,8 +3557,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3563,8 +3557,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
speed = "unknown"; speed = "unknown";
} }
printk(KERN_INFO DRIVER_NAME pr_info("New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n",
": New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n",
udev->manufacturer ? udev->manufacturer : "", udev->manufacturer ? udev->manufacturer : "",
udev->product ? udev->product : "", udev->product ? udev->product : "",
speed, speed,
...@@ -3579,8 +3572,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3579,8 +3572,8 @@ static int em28xx_usb_probe(struct usb_interface *interface,
* not enough even for most Digital TV streams. * not enough even for most Digital TV streams.
*/ */
if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) {
printk(DRIVER_NAME ": Device initialization failed.\n"); pr_err("Device initialization failed.\n");
printk(DRIVER_NAME ": Device must be connected to a high-speed USB 2.0 port.\n"); pr_err("Device must be connected to a high-speed USB 2.0 port.\n");
retval = -ENODEV; retval = -ENODEV;
goto err_free; goto err_free;
} }
...@@ -3593,8 +3586,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3593,8 +3586,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
dev->ifnum = ifnum; dev->ifnum = ifnum;
if (has_vendor_audio) { if (has_vendor_audio) {
printk(KERN_INFO DRIVER_NAME ": Audio interface %i found %s\n", pr_info("Audio interface %i found (Vendor Class)\n", ifnum);
ifnum, "(Vendor Class)");
dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
} }
/* Checks if audio is provided by a USB Audio Class interface */ /* Checks if audio is provided by a USB Audio Class interface */
...@@ -3611,14 +3603,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3611,14 +3603,12 @@ static int em28xx_usb_probe(struct usb_interface *interface,
} }
if (has_video) if (has_video)
printk(KERN_INFO DRIVER_NAME pr_info("Video interface %i found:%s%s\n",
": Video interface %i found:%s%s\n",
ifnum, ifnum,
dev->analog_ep_bulk ? " bulk" : "", dev->analog_ep_bulk ? " bulk" : "",
dev->analog_ep_isoc ? " isoc" : ""); dev->analog_ep_isoc ? " isoc" : "");
if (has_dvb) if (has_dvb)
printk(KERN_INFO DRIVER_NAME pr_info("DVB interface %i found:%s%s\n",
": DVB interface %i found:%s%s\n",
ifnum, ifnum,
dev->dvb_ep_bulk ? " bulk" : "", dev->dvb_ep_bulk ? " bulk" : "",
dev->dvb_ep_isoc ? " isoc" : ""); dev->dvb_ep_isoc ? " isoc" : "");
...@@ -3650,8 +3640,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3650,8 +3640,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
/* Disable V4L2 if the device doesn't have a decoder */ /* Disable V4L2 if the device doesn't have a decoder */
if (has_video && if (has_video &&
dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) { dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) {
printk(DRIVER_NAME pr_err("Currently, V4L2 is not supported on this model\n");
": Currently, V4L2 is not supported on this model\n");
has_video = false; has_video = false;
dev->has_video = false; dev->has_video = false;
} }
......
...@@ -48,12 +48,12 @@ MODULE_VERSION(EM28XX_VERSION); ...@@ -48,12 +48,12 @@ MODULE_VERSION(EM28XX_VERSION);
static unsigned int core_debug; static unsigned int core_debug;
module_param(core_debug, int, 0644); module_param(core_debug, int, 0644);
MODULE_PARM_DESC(core_debug, "enable debug messages [core]"); MODULE_PARM_DESC(core_debug, "enable debug messages [core and isoc]");
#define em28xx_coredbg(fmt, arg...) do {\ #define em28xx_coredbg(fmt, arg...) do {\
if (core_debug) \ if (core_debug) \
printk(KERN_INFO "%s %s :"fmt, \ printk(KERN_DEBUG pr_fmt("core: %s: " fmt), \
dev->name, __func__ , ##arg); } while (0) __func__, ##arg); } while (0)
static unsigned int reg_debug; static unsigned int reg_debug;
module_param(reg_debug, int, 0644); module_param(reg_debug, int, 0644);
...@@ -61,14 +61,14 @@ MODULE_PARM_DESC(reg_debug, "enable debug messages [URB reg]"); ...@@ -61,14 +61,14 @@ MODULE_PARM_DESC(reg_debug, "enable debug messages [URB reg]");
#define em28xx_regdbg(fmt, arg...) do {\ #define em28xx_regdbg(fmt, arg...) do {\
if (reg_debug) \ if (reg_debug) \
printk(KERN_INFO "%s %s :"fmt, \ printk(KERN_DEBUG pr_fmt("reg: %s: " fmt), \
dev->name, __func__ , ##arg); } while (0) __func__, ##arg); } while (0)
/* FIXME */ /* FIXME */
#define em28xx_isocdbg(fmt, arg...) do {\ #define em28xx_isocdbg(fmt, arg...) do {\
if (core_debug) \ if (core_debug) \
printk(KERN_INFO "%s %s :"fmt, \ printk(KERN_DEBUG pr_fmt("isoc: %s: " fmt), \
dev->name, __func__ , ##arg); } while (0) __func__, ##arg); } while (0)
/* /*
* em28xx_read_reg_req() * em28xx_read_reg_req()
...@@ -102,7 +102,7 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg, ...@@ -102,7 +102,7 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg,
0x0000, reg, dev->urb_buf, len, HZ); 0x0000, reg, dev->urb_buf, len, HZ);
if (ret < 0) { if (ret < 0) {
if (reg_debug) if (reg_debug)
printk(KERN_CONT " failed!\n"); pr_cont(" failed!\n");
mutex_unlock(&dev->ctrl_urb_lock); mutex_unlock(&dev->ctrl_urb_lock);
return usb_translate_errors(ret); return usb_translate_errors(ret);
} }
...@@ -115,10 +115,10 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg, ...@@ -115,10 +115,10 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg,
if (reg_debug) { if (reg_debug) {
int byte; int byte;
printk(KERN_CONT "<<<"); pr_cont("<<<");
for (byte = 0; byte < len; byte++) for (byte = 0; byte < len; byte++)
printk(KERN_CONT " %02x", (unsigned char)buf[byte]); pr_cont(" %02x", (unsigned char)buf[byte]);
printk(KERN_CONT "\n"); pr_cont("\n");
} }
return ret; return ret;
...@@ -174,8 +174,8 @@ int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf, ...@@ -174,8 +174,8 @@ int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf,
len & 0xff, len >> 8); len & 0xff, len >> 8);
for (byte = 0; byte < len; byte++) for (byte = 0; byte < len; byte++)
printk(KERN_CONT " %02x", (unsigned char)buf[byte]); pr_cont(" %02x", (unsigned char)buf[byte]);
printk(KERN_CONT "\n"); pr_cont("\n");
} }
mutex_lock(&dev->ctrl_urb_lock); mutex_lock(&dev->ctrl_urb_lock);
...@@ -1037,8 +1037,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode, ...@@ -1037,8 +1037,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode,
for (i = 0; i < usb_bufs->num_bufs; i++) { for (i = 0; i < usb_bufs->num_bufs; i++) {
rc = usb_submit_urb(usb_bufs->urb[i], GFP_ATOMIC); rc = usb_submit_urb(usb_bufs->urb[i], GFP_ATOMIC);
if (rc) { if (rc) {
pr_err("submit of urb %i failed (error=%i)\n", i, pr_err("submit of urb %i failed (error=%i)\n", i, rc);
rc);
em28xx_uninit_usb_xfer(dev, mode); em28xx_uninit_usb_xfer(dev, mode);
return rc; return rc;
} }
...@@ -1071,7 +1070,7 @@ int em28xx_register_extension(struct em28xx_ops *ops) ...@@ -1071,7 +1070,7 @@ int em28xx_register_extension(struct em28xx_ops *ops)
ops->init(dev); ops->init(dev);
} }
mutex_unlock(&em28xx_devlist_mutex); mutex_unlock(&em28xx_devlist_mutex);
printk(KERN_INFO "em28xx: Registered (%s) extension\n", ops->name); pr_info("em28xx: Registered (%s) extension\n", ops->name);
return 0; return 0;
} }
EXPORT_SYMBOL(em28xx_register_extension); EXPORT_SYMBOL(em28xx_register_extension);
...@@ -1086,7 +1085,7 @@ void em28xx_unregister_extension(struct em28xx_ops *ops) ...@@ -1086,7 +1085,7 @@ void em28xx_unregister_extension(struct em28xx_ops *ops)
} }
list_del(&ops->next); list_del(&ops->next);
mutex_unlock(&em28xx_devlist_mutex); mutex_unlock(&em28xx_devlist_mutex);
printk(KERN_INFO "Em28xx: Removed (%s) extension\n", ops->name); pr_info("Em28xx: Removed (%s) extension\n", ops->name);
} }
EXPORT_SYMBOL(em28xx_unregister_extension); EXPORT_SYMBOL(em28xx_unregister_extension);
......
...@@ -935,19 +935,19 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) ...@@ -935,19 +935,19 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev)
cfg.ctrl = &ctl; cfg.ctrl = &ctl;
if (!dev->dvb->fe[0]) { if (!dev->dvb->fe[0]) {
pr_err("/2: dvb frontend not attached. Can't attach xc3028\n"); pr_err("dvb frontend not attached. Can't attach xc3028\n");
return -EINVAL; return -EINVAL;
} }
fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg); fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg);
if (!fe) { if (!fe) {
pr_err("/2: xc3028 attach failed\n"); pr_err("xc3028 attach failed\n");
dvb_frontend_detach(dev->dvb->fe[0]); dvb_frontend_detach(dev->dvb->fe[0]);
dev->dvb->fe[0] = NULL; dev->dvb->fe[0] = NULL;
return -EINVAL; return -EINVAL;
} }
pr_info("%s/2: xc3028 attached\n", dev->name); pr_info("xc3028 attached\n");
return 0; return 0;
} }
...@@ -966,8 +966,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -966,8 +966,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
result = dvb_register_adapter(&dvb->adapter, dev->name, module, device, result = dvb_register_adapter(&dvb->adapter, dev->name, module, device,
adapter_nr); adapter_nr);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_adapter failed (errno = %d)\n", pr_warn("dvb_register_adapter failed (errno = %d)\n",
dev->name, result); result);
goto fail_adapter; goto fail_adapter;
} }
#ifdef CONFIG_MEDIA_CONTROLLER_DVB #ifdef CONFIG_MEDIA_CONTROLLER_DVB
...@@ -984,8 +984,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -984,8 +984,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
/* register frontend */ /* register frontend */
result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]); result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: dvb_register_frontend failed (errno = %d)\n", pr_warn("dvb_register_frontend failed (errno = %d)\n",
dev->name, result); result);
goto fail_frontend0; goto fail_frontend0;
} }
...@@ -993,8 +993,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -993,8 +993,8 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
if (dvb->fe[1]) { if (dvb->fe[1]) {
result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]); result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: 2nd dvb_register_frontend failed (errno = %d)\n", pr_warn("2nd dvb_register_frontend failed (errno = %d)\n",
dev->name, result); result);
goto fail_frontend1; goto fail_frontend1;
} }
} }
...@@ -1011,8 +1011,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -1011,8 +1011,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
result = dvb_dmx_init(&dvb->demux); result = dvb_dmx_init(&dvb->demux);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: dvb_dmx_init failed (errno = %d)\n", pr_warn("dvb_dmx_init failed (errno = %d)\n", result);
dev->name, result);
goto fail_dmx; goto fail_dmx;
} }
...@@ -1021,31 +1020,29 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -1021,31 +1020,29 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
dvb->dmxdev.capabilities = 0; dvb->dmxdev.capabilities = 0;
result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: dvb_dmxdev_init failed (errno = %d)\n", pr_warn("dvb_dmxdev_init failed (errno = %d)\n", result);
dev->name, result);
goto fail_dmxdev; goto fail_dmxdev;
} }
dvb->fe_hw.source = DMX_FRONTEND_0; dvb->fe_hw.source = DMX_FRONTEND_0;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", pr_warn("add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
dev->name, result); result);
goto fail_fe_hw; goto fail_fe_hw;
} }
dvb->fe_mem.source = DMX_MEMORY_FE; dvb->fe_mem.source = DMX_MEMORY_FE;
result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", pr_warn("add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
dev->name, result); result);
goto fail_fe_mem; goto fail_fe_mem;
} }
result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) { if (result < 0) {
printk(KERN_WARNING "%s: connect_frontend failed (errno = %d)\n", pr_warn("connect_frontend failed (errno = %d)\n", result);
dev->name, result);
goto fail_fe_conn; goto fail_fe_conn;
} }
...@@ -1936,11 +1933,11 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1936,11 +1933,11 @@ static int em28xx_dvb_init(struct em28xx *dev)
} }
break; break;
default: default:
pr_err("/2: The frontend of your DVB/ATSC card isn't supported yet\n"); pr_err("The frontend of your DVB/ATSC card isn't supported yet\n");
break; break;
} }
if (NULL == dvb->fe[0]) { if (NULL == dvb->fe[0]) {
pr_err("/2: frontend initialization failed\n"); pr_err("frontend initialization failed\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
......
...@@ -544,11 +544,11 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, ...@@ -544,11 +544,11 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap,
if (rc < 0) { if (rc < 0) {
if (rc == -ENXIO) { if (rc == -ENXIO) {
if (i2c_debug > 1) if (i2c_debug > 1)
printk(KERN_CONT " no device\n"); pr_cont(" no device\n");
rc = -ENODEV; rc = -ENODEV;
} else { } else {
if (i2c_debug > 1) if (i2c_debug > 1)
printk(KERN_CONT " ERROR: %i\n", rc); pr_cont(" ERROR: %i\n", rc);
} }
rt_mutex_unlock(&dev->i2c_bus_lock); rt_mutex_unlock(&dev->i2c_bus_lock);
return rc; return rc;
...@@ -558,11 +558,11 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, ...@@ -558,11 +558,11 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap,
rc = i2c_recv_bytes(i2c_bus, msgs[i]); rc = i2c_recv_bytes(i2c_bus, msgs[i]);
if (i2c_debug > 1 && rc >= 0) if (i2c_debug > 1 && rc >= 0)
printk(KERN_CONT " %*ph", pr_cont(" %*ph",
msgs[i].len, msgs[i].buf); msgs[i].len, msgs[i].buf);
} else { } else {
if (i2c_debug > 1) if (i2c_debug > 1)
printk(KERN_CONT " %*ph", pr_cont(" %*ph",
msgs[i].len, msgs[i].buf); msgs[i].len, msgs[i].buf);
/* write bytes */ /* write bytes */
...@@ -570,12 +570,12 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, ...@@ -570,12 +570,12 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap,
} }
if (rc < 0) { if (rc < 0) {
if (i2c_debug > 1) if (i2c_debug > 1)
printk(KERN_CONT " ERROR: %i\n", rc); pr_cont(" ERROR: %i\n", rc);
rt_mutex_unlock(&dev->i2c_bus_lock); rt_mutex_unlock(&dev->i2c_bus_lock);
return rc; return rc;
} }
if (i2c_debug > 1) if (i2c_debug > 1)
printk(KERN_CONT "\n"); pr_cont("\n");
} }
rt_mutex_unlock(&dev->i2c_bus_lock); rt_mutex_unlock(&dev->i2c_bus_lock);
......
...@@ -458,7 +458,7 @@ static int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type) ...@@ -458,7 +458,7 @@ static int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type)
case CHIP_ID_EM28178: case CHIP_ID_EM28178:
return em2874_ir_change_protocol(rc_dev, rc_type); return em2874_ir_change_protocol(rc_dev, rc_type);
default: default:
printk("Unrecognized em28xx chip id 0x%02x: IR not supported\n", pr_err("Unrecognized em28xx chip id 0x%02x: IR not supported\n",
dev->chip_id); dev->chip_id);
return -EINVAL; return -EINVAL;
} }
......
...@@ -21,12 +21,13 @@ ...@@ -21,12 +21,13 @@
02110-1301, USA. 02110-1301, USA.
*/ */
#include "em28xx.h"
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/hardirq.h> #include <linux/hardirq.h>
#include <linux/init.h> #include <linux/init.h>
#include "em28xx.h"
#include "em28xx-v4l.h" #include "em28xx-v4l.h"
/* ------------------------------------------------------------------ */ /* ------------------------------------------------------------------ */
...@@ -63,7 +64,7 @@ static int vbi_buffer_prepare(struct vb2_buffer *vb) ...@@ -63,7 +64,7 @@ static int vbi_buffer_prepare(struct vb2_buffer *vb)
size = v4l2->vbi_width * v4l2->vbi_height * 2; size = v4l2->vbi_width * v4l2->vbi_height * 2;
if (vb2_plane_size(vb, 0) < size) { if (vb2_plane_size(vb, 0) < size) {
printk(KERN_INFO "%s data will not fit into plane (%lu < %lu)\n", pr_info("%s data will not fit into plane (%lu < %lu)\n",
__func__, vb2_plane_size(vb, 0), size); __func__, vb2_plane_size(vb, 0), size);
return -EINVAL; return -EINVAL;
} }
......
...@@ -66,16 +66,13 @@ MODULE_PARM_DESC(alt, "alternate setting to use for video endpoint"); ...@@ -66,16 +66,13 @@ MODULE_PARM_DESC(alt, "alternate setting to use for video endpoint");
#define em28xx_videodbg(fmt, arg...) do {\ #define em28xx_videodbg(fmt, arg...) do {\
if (video_debug) \ if (video_debug) \
printk(KERN_INFO "%s %s :"fmt, \ printk(KERN_DEBUG pr_fmt("video: %s: " fmt), \
dev->name, __func__ , ##arg); } while (0) __func__, ##arg); } while (0)
#define em28xx_isocdbg(fmt, arg...) \ #define em28xx_isocdbg(fmt, arg...) do {\
do {\ if (isoc_debug) \
if (isoc_debug) { \ printk(KERN_DEBUG pr_fmt("isoc: %s: " fmt), \
printk(KERN_INFO "%s %s :"fmt, \ __func__, ##arg); } while (0)
dev->name, __func__ , ##arg); \
} \
} while (0)
MODULE_AUTHOR(DRIVER_AUTHOR); MODULE_AUTHOR(DRIVER_AUTHOR);
MODULE_DESCRIPTION(DRIVER_DESC " - v4l2 interface"); MODULE_DESCRIPTION(DRIVER_DESC " - v4l2 interface");
...@@ -2662,8 +2659,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2662,8 +2659,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER, ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER,
video_nr[dev->devno]); video_nr[dev->devno]);
if (ret) { if (ret) {
pr_err("unable to register video device (error=%i).\n", pr_err("unable to register video device (error=%i).\n", ret);
ret);
goto unregister_dev; goto unregister_dev;
} }
......
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