From 11a1e0ed7908f04c896e69d0eb65e478c12f8519 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 7 Oct 2016 11:41:13 -0300 Subject: [media] dvb-usb: warn if return value for USB read/write routines is not checked the return values for dvb_usb_generic_rw() and dvb_usb_generic_write() should be checked, as otherwise the drivers won't be doing the right thing in the case of errors. So, add __must_check to both declarations. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/dvb-usb/dvb-usb.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/dvb-usb/dvb-usb.h b/drivers/media/usb/dvb-usb/dvb-usb.h index 639c4678c65b..1448c3d27ea2 100644 --- a/drivers/media/usb/dvb-usb/dvb-usb.h +++ b/drivers/media/usb/dvb-usb/dvb-usb.h @@ -462,8 +462,10 @@ extern int dvb_usb_device_init(struct usb_interface *, extern void dvb_usb_device_exit(struct usb_interface *); /* the generic read/write method for device control */ -extern int dvb_usb_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16,int); -extern int dvb_usb_generic_write(struct dvb_usb_device *, u8 *, u16); +extern int __must_check +dvb_usb_generic_rw(struct dvb_usb_device *, u8 *, u16, u8 *, u16, int); +extern int __must_check +dvb_usb_generic_write(struct dvb_usb_device *, u8 *, u16); /* commonly used remote control parsing */ extern int dvb_usb_nec_rc_key_to_event(struct dvb_usb_device *, u8[], u32 *, int *); -- cgit v1.2.3 From 43ea43b9d8b27b7acd443ec59319faa3cdb8a616 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 12 Oct 2016 08:21:43 -0300 Subject: [media] radio-bcm2048: don't ignore errors Remove this warning: drivers/staging/media/bcm2048/radio-bcm2048.c: In function 'bcm2048_set_rds_no_lock': drivers/staging/media/bcm2048/radio-bcm2048.c:467:6: warning: variable 'err' set but not used [-Wunused-but-set-variable] int err; ^~~ By returning the error code. Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/media/bcm2048/radio-bcm2048.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/bcm2048/radio-bcm2048.c b/drivers/staging/media/bcm2048/radio-bcm2048.c index ea15cc638097..4d9bd02ede47 100644 --- a/drivers/staging/media/bcm2048/radio-bcm2048.c +++ b/drivers/staging/media/bcm2048/radio-bcm2048.c @@ -482,6 +482,8 @@ static int bcm2048_set_rds_no_lock(struct bcm2048_device *bdev, u8 rds_on) flags); memset(&bdev->rds_info, 0, sizeof(bdev->rds_info)); } + if (err) + return err; return bcm2048_send_command(bdev, BCM2048_I2C_FM_RDS_SYSTEM, bdev->cache_fm_rds_system); -- cgit v1.2.3 From 15c8ffc41a1559e37e3ec7106b261f5706490f1e Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 12 Oct 2016 06:50:34 -0300 Subject: [media] tuner-xc2028: mark printk continuation lines as such This driver has a lot of printk continuation lines for debugging purposes. Since commit 563873318d32 ("Merge branch 'printk-cleanups"), this won't work as expected anymore. So, let's add KERN_CONT to those lines. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/tuner-xc2028.c | 93 +++++++++++++++++++------------------ 1 file changed, 48 insertions(+), 45 deletions(-) diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index 317ef63ee789..55f6c858b9c3 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c @@ -179,67 +179,67 @@ static int xc2028_get_reg(struct xc2028_data *priv, u16 reg, u16 *val) static void dump_firm_type_and_int_freq(unsigned int type, u16 int_freq) { if (type & BASE) - printk("BASE "); + printk(KERN_CONT "BASE "); if (type & INIT1) - printk("INIT1 "); + printk(KERN_CONT "INIT1 "); if (type & F8MHZ) - printk("F8MHZ "); + printk(KERN_CONT "F8MHZ "); if (type & MTS) - printk("MTS "); + printk(KERN_CONT "MTS "); if (type & D2620) - printk("D2620 "); + printk(KERN_CONT "D2620 "); if (type & D2633) - printk("D2633 "); + printk(KERN_CONT "D2633 "); if (type & DTV6) - printk("DTV6 "); + printk(KERN_CONT "DTV6 "); if (type & QAM) - printk("QAM "); + printk(KERN_CONT "QAM "); if (type & DTV7) - printk("DTV7 "); + printk(KERN_CONT "DTV7 "); if (type & DTV78) - printk("DTV78 "); + printk(KERN_CONT "DTV78 "); if (type & DTV8) - printk("DTV8 "); + printk(KERN_CONT "DTV8 "); if (type & FM) - printk("FM "); + printk(KERN_CONT "FM "); if (type & INPUT1) - printk("INPUT1 "); + printk(KERN_CONT "INPUT1 "); if (type & LCD) - printk("LCD "); + printk(KERN_CONT "LCD "); if (type & NOGD) - printk("NOGD "); + printk(KERN_CONT "NOGD "); if (type & MONO) - printk("MONO "); + printk(KERN_CONT "MONO "); if (type & ATSC) - printk("ATSC "); + printk(KERN_CONT "ATSC "); if (type & IF) - printk("IF "); + printk(KERN_CONT "IF "); if (type & LG60) - printk("LG60 "); + printk(KERN_CONT "LG60 "); if (type & ATI638) - printk("ATI638 "); + printk(KERN_CONT "ATI638 "); if (type & OREN538) - printk("OREN538 "); + printk(KERN_CONT "OREN538 "); if (type & OREN36) - printk("OREN36 "); + printk(KERN_CONT "OREN36 "); if (type & TOYOTA388) - printk("TOYOTA388 "); + printk(KERN_CONT "TOYOTA388 "); if (type & TOYOTA794) - printk("TOYOTA794 "); + printk(KERN_CONT "TOYOTA794 "); if (type & DIBCOM52) - printk("DIBCOM52 "); + printk(KERN_CONT "DIBCOM52 "); if (type & ZARLINK456) - printk("ZARLINK456 "); + printk(KERN_CONT "ZARLINK456 "); if (type & CHINA) - printk("CHINA "); + printk(KERN_CONT "CHINA "); if (type & F6MHZ) - printk("F6MHZ "); + printk(KERN_CONT "F6MHZ "); if (type & INPUT2) - printk("INPUT2 "); + printk(KERN_CONT "INPUT2 "); if (type & SCODE) - printk("SCODE "); + printk(KERN_CONT "SCODE "); if (type & HAS_IF) - printk("HAS_IF_%d ", int_freq); + printk(KERN_CONT "HAS_IF_%d ", int_freq); } static v4l2_std_id parse_audio_std_option(void) @@ -374,8 +374,8 @@ static int load_all_firmwares(struct dvb_frontend *fe, if (!size || size > endp - p) { tuner_err("Firmware type "); dump_firm_type(type); - printk("(%x), id %llx is corrupted " - "(size=%d, expected %d)\n", + printk(KERN_CONT + "(%x), id %llx is corrupted (size=%d, expected %d)\n", type, (unsigned long long)id, (unsigned)(endp - p), size); goto corrupt; @@ -390,7 +390,7 @@ static int load_all_firmwares(struct dvb_frontend *fe, tuner_dbg("Reading firmware type "); if (debug) { dump_firm_type_and_int_freq(type, int_freq); - printk("(%x), id %llx, size=%d.\n", + printk(KERN_CONT "(%x), id %llx, size=%d.\n", type, (unsigned long long)id, size); } @@ -439,7 +439,8 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type, tuner_dbg("%s called, want type=", __func__); if (debug) { dump_firm_type(type); - printk("(%x), id %016llx.\n", type, (unsigned long long)*id); + printk(KERN_CONT "(%x), id %016llx.\n", + type, (unsigned long long)*id); } if (!priv->firm) { @@ -498,7 +499,8 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type, tuner_dbg("Selecting best matching firmware (%d bits) for " "type=", best_nr_matches); dump_firm_type(type); - printk("(%x), id %016llx:\n", type, (unsigned long long)*id); + printk(KERN_CONT + "(%x), id %016llx:\n", type, (unsigned long long)*id); i = best_i; goto found; } @@ -515,7 +517,8 @@ ret: tuner_dbg("%s firmware for type=", (i < 0) ? "Can't find" : "Found"); if (debug) { dump_firm_type(type); - printk("(%x), id %016llx.\n", type, (unsigned long long)*id); + printk(KERN_CONT "(%x), id %016llx.\n", + type, (unsigned long long)*id); } return i; } @@ -555,8 +558,8 @@ static int load_firmware(struct dvb_frontend *fe, unsigned int type, tuner_info("Loading firmware for type="); dump_firm_type(priv->firm[pos].type); - printk("(%x), id %016llx.\n", priv->firm[pos].type, - (unsigned long long)*id); + printk(KERN_CONT "(%x), id %016llx.\n", + priv->firm[pos].type, (unsigned long long)*id); p = priv->firm[pos].ptr; endp = p + priv->firm[pos].size; @@ -689,7 +692,7 @@ static int load_scode(struct dvb_frontend *fe, unsigned int type, tuner_info("Loading SCODE for type="); dump_firm_type_and_int_freq(priv->firm[pos].type, priv->firm[pos].int_freq); - printk("(%x), id %016llx.\n", priv->firm[pos].type, + printk(KERN_CONT "(%x), id %016llx.\n", priv->firm[pos].type, (unsigned long long)*id); if (priv->firm_version < 0x0202) @@ -741,15 +744,15 @@ retry: tuner_dbg("checking firmware, user requested type="); if (debug) { dump_firm_type(new_fw.type); - printk("(%x), id %016llx, ", new_fw.type, + printk(KERN_CONT "(%x), id %016llx, ", new_fw.type, (unsigned long long)new_fw.std_req); if (!int_freq) { - printk("scode_tbl "); + printk(KERN_CONT "scode_tbl "); dump_firm_type(priv->ctrl.scode_table); - printk("(%x), ", priv->ctrl.scode_table); + printk(KERN_CONT "(%x), ", priv->ctrl.scode_table); } else - printk("int_freq %d, ", new_fw.int_freq); - printk("scode_nr %d\n", new_fw.scode_nr); + printk(KERN_CONT "int_freq %d, ", new_fw.int_freq); + printk(KERN_CONT "scode_nr %d\n", new_fw.scode_nr); } /* -- cgit v1.2.3 From 2af3eb647e9b90f679265a45a8fbb78048ba8889 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 12 Oct 2016 06:59:16 -0300 Subject: [media] tuner-xc2028: don't break long lines Due to the 80-cols checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. So, join those continuation lines. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/tuners/tuner-xc2028.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/drivers/media/tuners/tuner-xc2028.c b/drivers/media/tuners/tuner-xc2028.c index 55f6c858b9c3..e07c5fb59cc6 100644 --- a/drivers/media/tuners/tuner-xc2028.c +++ b/drivers/media/tuners/tuner-xc2028.c @@ -56,8 +56,7 @@ MODULE_PARM_DESC(no_poweroff, "0 (default) powers device off when not used.\n" static char audio_std[8]; module_param_string(audio_std, audio_std, sizeof(audio_std), 0); MODULE_PARM_DESC(audio_std, - "Audio standard. XC3028 audio decoder explicitly " - "needs to know what audio\n" + "Audio standard. XC3028 audio decoder explicitly needs to know what audio\n" "standard is needed for some video standards with audio A2 or NICAM.\n" "The valid values are:\n" "A2\n" @@ -69,8 +68,8 @@ MODULE_PARM_DESC(audio_std, static char firmware_name[30]; module_param_string(firmware_name, firmware_name, sizeof(firmware_name), 0); -MODULE_PARM_DESC(firmware_name, "Firmware file name. Allows overriding the " - "default firmware name\n"); +MODULE_PARM_DESC(firmware_name, + "Firmware file name. Allows overriding the default firmware name\n"); static LIST_HEAD(hybrid_tuner_instance_list); static DEFINE_MUTEX(xc2028_list_mutex); @@ -346,8 +345,7 @@ static int load_all_firmwares(struct dvb_frontend *fe, n++; if (n >= n_array) { - tuner_err("More firmware images in file than " - "were expected!\n"); + tuner_err("More firmware images in file than were expected!\n"); goto corrupt; } @@ -496,8 +494,8 @@ static int seek_firmware(struct dvb_frontend *fe, unsigned int type, } if (best_nr_matches > 0) { - tuner_dbg("Selecting best matching firmware (%d bits) for " - "type=", best_nr_matches); + tuner_dbg("Selecting best matching firmware (%d bits) for type=", + best_nr_matches); dump_firm_type(type); printk(KERN_CONT "(%x), id %016llx:\n", type, (unsigned long long)*id); @@ -840,8 +838,7 @@ check_device: goto fail; } - tuner_dbg("Device is Xceive %d version %d.%d, " - "firmware version %d.%d\n", + tuner_dbg("Device is Xceive %d version %d.%d, firmware version %d.%d\n", hwmodel, (version & 0xf000) >> 12, (version & 0xf00) >> 8, (version & 0xf0) >> 4, version & 0xf); @@ -855,8 +852,7 @@ check_device: tuner_err("Incorrect readback of firmware version.\n"); goto fail; } else { - tuner_err("Returned an incorrect version. However, " - "read is not reliable enough. Ignoring it.\n"); + tuner_err("Returned an incorrect version. However, read is not reliable enough. Ignoring it.\n"); hwmodel = 3028; } } @@ -867,8 +863,7 @@ check_device: priv->hwvers = version & 0xff00; } else if (priv->hwmodel == 0 || priv->hwmodel != hwmodel || priv->hwvers != (version & 0xff00)) { - tuner_err("Read invalid device hardware information - tuner " - "hung?\n"); + tuner_err("Read invalid device hardware information - tuner hung?\n"); goto fail; } -- cgit v1.2.3 From 5ccb197de29269ba854066c4f1a92eb71974e126 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 12 Oct 2016 07:05:48 -0300 Subject: [media] em28xx: don't break long lines Due to the 80-cols checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. So, join those continuation lines. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/em28xx/em28xx-audio.c | 10 +++---- drivers/media/usb/em28xx/em28xx-cards.c | 51 ++++++++++++--------------------- drivers/media/usb/em28xx/em28xx-core.c | 11 ++++--- drivers/media/usb/em28xx/em28xx-dvb.c | 6 ++-- drivers/media/usb/em28xx/em28xx-input.c | 3 +- drivers/media/usb/em28xx/em28xx-video.c | 6 ++-- 6 files changed, 33 insertions(+), 54 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index e11fe46a547c..2a3975b1aea5 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -3,7 +3,7 @@ * * Copyright (C) 2006 Markus Rechberger * - * Copyright (C) 2007-2014 Mauro Carvalho Chehab + * Copyright (C) 2007-2016 Mauro Carvalho Chehab * - Port to work with the in-kernel driver * - Cleanups, fixes, alsa-controls, etc. * @@ -254,8 +254,7 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) int nonblock, ret = 0; if (!dev) { - em28xx_err("BUG: em28xx can't find device struct." - " Can't proceed with open\n"); + em28xx_err("BUG: em28xx can't find device struct. Can't proceed with open\n"); return -ENODEV; } @@ -902,10 +901,9 @@ static int em28xx_audio_init(struct em28xx *dev) kref_get(&dev->ref); - printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2006 Markus " - "Rechberger\n"); + printk(KERN_INFO "em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n"); printk(KERN_INFO - "em28xx-audio.c: Copyright (C) 2007-2014 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", THIS_MODULE, 0, &card); diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index e397f544f108..bed41c1b4817 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -2832,13 +2832,10 @@ static int em28xx_hint_board(struct em28xx *dev) dev->tuner_type = em28xx_eeprom_hash[i].tuner; em28xx_errdev("Your board has no unique USB ID.\n"); - em28xx_errdev("A hint were successfully done, " - "based on eeprom hash.\n"); + em28xx_errdev("A hint were successfully done, based on eeprom hash.\n"); em28xx_errdev("This method is not 100%% failproof.\n"); - em28xx_errdev("If the board were missdetected, " - "please email this log to:\n"); - em28xx_errdev("\tV4L Mailing List " - " \n"); + em28xx_errdev("If the board were missdetected, please email this log to:\n"); + em28xx_errdev("\tV4L Mailing List \n"); em28xx_errdev("Board detected as %s\n", em28xx_boards[dev->model].name); @@ -2864,13 +2861,10 @@ static int em28xx_hint_board(struct em28xx *dev) dev->model = em28xx_i2c_hash[i].model; dev->tuner_type = em28xx_i2c_hash[i].tuner; em28xx_errdev("Your board has no unique USB ID.\n"); - em28xx_errdev("A hint were successfully done, " - "based on i2c devicelist hash.\n"); + em28xx_errdev("A hint were successfully done, based on i2c devicelist hash.\n"); em28xx_errdev("This method is not 100%% failproof.\n"); - em28xx_errdev("If the board were missdetected, " - "please email this log to:\n"); - em28xx_errdev("\tV4L Mailing List " - " \n"); + em28xx_errdev("If the board were missdetected, please email this log to:\n"); + em28xx_errdev("\tV4L Mailing List \n"); em28xx_errdev("Board detected as %s\n", em28xx_boards[dev->model].name); @@ -2878,17 +2872,14 @@ static int em28xx_hint_board(struct em28xx *dev) } } - em28xx_errdev("Your board has no unique USB ID and thus need a " - "hint to be detected.\n"); - em28xx_errdev("You may try to use card= insmod option to " - "workaround that.\n"); + em28xx_errdev("Your board has no unique USB ID and thus need a hint to be detected.\n"); + em28xx_errdev("You may try to use card= insmod option to workaround that.\n"); em28xx_errdev("Please send an email with this log to:\n"); em28xx_errdev("\tV4L Mailing List \n"); em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash); em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash); - em28xx_errdev("Here is a list of valid choices for the card=" - " insmod option:\n"); + em28xx_errdev("Here is a list of valid choices for the card= insmod option:\n"); for (i = 0; i < em28xx_bcount; i++) { em28xx_errdev(" card=%d -> %s\n", i, em28xx_boards[i].name); @@ -3035,11 +3026,9 @@ static void em28xx_card_setup(struct em28xx *dev) if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { em28xx_errdev("\n\n"); - em28xx_errdev("The support for this board weren't " - "valid yet.\n"); + em28xx_errdev("The support for this board weren't valid yet.\n"); em28xx_errdev("Please send a report of having this working\n"); - em28xx_errdev("not to V4L mailing list (and/or to other " - "addresses)\n\n"); + em28xx_errdev("not to V4L mailing list (and/or to other addresses)\n\n"); } /* Free eeprom data memory */ @@ -3360,8 +3349,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, /* Resets I2C speed */ retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); if (retval < 0) { - em28xx_errdev("%s: em28xx_write_reg failed!" - " retval [%d]\n", + em28xx_errdev("%s: em28xx_write_reg failed! retval [%d]\n", __func__, retval); return retval; } @@ -3429,7 +3417,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS); if (nr >= EM28XX_MAXBOARDS) { /* No free device slots */ - printk(DRIVER_NAME ": Supports only %i em28xx boards.\n", + printk(DRIVER_NAME + ": Supports only %i em28xx boards.\n", EM28XX_MAXBOARDS); retval = -ENOMEM; goto err_no_slot; @@ -3438,8 +3427,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, /* Don't register audio interfaces */ if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { - em28xx_err(DRIVER_NAME " audio device (%04x:%04x): " - "interface %i, class %i\n", + em28xx_err(DRIVER_NAME + " audio device (%04x:%04x): interface %i, class %i\n", le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idProduct), ifnum, @@ -3502,7 +3491,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, has_vendor_audio = true; } else { printk(KERN_INFO DRIVER_NAME - ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); + ": error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); } break; case 0x84: @@ -3576,8 +3565,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, } printk(KERN_INFO DRIVER_NAME - ": 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->product ? udev->product : "", speed, @@ -3593,8 +3581,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, */ if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { printk(DRIVER_NAME ": Device initialization failed.\n"); - printk(DRIVER_NAME ": Device must be connected to a high-speed" - " USB 2.0 port.\n"); + printk(DRIVER_NAME ": Device must be connected to a high-speed USB 2.0 port.\n"); retval = -ENODEV; goto err_free; } diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index eebd5d7088d0..a73e853e876e 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -87,8 +87,8 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg, return -EINVAL; if (reg_debug) { - printk(KERN_DEBUG "(pipe 0x%08x): " - "IN: %02x %02x %02x %02x %02x %02x %02x %02x ", + printk(KERN_DEBUG + "(pipe 0x%08x): IN: %02x %02x %02x %02x %02x %02x %02x %02x ", pipe, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, req, 0, 0, @@ -165,8 +165,8 @@ int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf, if (reg_debug) { int byte; - printk(KERN_DEBUG "(pipe 0x%08x): " - "OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>", + printk(KERN_DEBUG + "(pipe 0x%08x): OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>", pipe, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, req, 0, 0, @@ -942,8 +942,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, usb_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, &urb->transfer_dma); if (!usb_bufs->transfer_buffer[i]) { - em28xx_err("unable to allocate %i bytes for transfer" - " buffer %i%s\n", + em28xx_err("unable to allocate %i bytes for transfer buffer %i%s\n", sb_size, i, in_interrupt() ? " while in int" : ""); em28xx_uninit_usb_xfer(dev, mode); diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 8cedef0daae4..488c70e5ebde 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -934,8 +934,7 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) cfg.ctrl = &ctl; if (!dev->dvb->fe[0]) { - em28xx_errdev("/2: dvb frontend not attached. " - "Can't attach xc3028\n"); + em28xx_errdev("/2: dvb frontend not attached. Can't attach xc3028\n"); return -EINVAL; } @@ -1937,8 +1936,7 @@ static int em28xx_dvb_init(struct em28xx *dev) } break; default: - em28xx_errdev("/2: The frontend of your DVB/ATSC card" - " isn't supported yet\n"); + em28xx_errdev("/2: The frontend of your DVB/ATSC card isn't supported yet\n"); break; } if (NULL == dvb->fe[0]) { diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index 4007356d991d..580f3853505d 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c @@ -703,8 +703,7 @@ static int em28xx_ir_init(struct em28xx *dev) if (dev->board.ir_codes == NULL && !dev->board.has_ir_i2c) { /* No remote control support */ - em28xx_warn("Remote control support is not available for " - "this card.\n"); + em28xx_warn("Remote control support is not available for this card.\n"); return 0; } diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 1f7fa059eb34..119877bb8a1e 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c @@ -505,8 +505,7 @@ static void em28xx_copy_video(struct em28xx *dev, if ((char *)startwrite + lencopy > (char *)buf->vb_buf + buf->length) { - em28xx_isocdbg("Overflow of %zu bytes past buffer end" - "(2)\n", + em28xx_isocdbg("Overflow of %zu bytes past buffer end(2)\n", ((char *)startwrite + lencopy) - ((char *)buf->vb_buf + buf->length)); lencopy = remain = (char *)buf->vb_buf + buf->length - @@ -2204,8 +2203,7 @@ static int em28xx_v4l2_close(struct file *filp) em28xx_videodbg("setting alternate 0\n"); errCode = usb_set_interface(dev->udev, 0, 0); if (errCode < 0) { - em28xx_errdev("cannot change alternate number to " - "0 (error=%i)\n", errCode); + em28xx_errdev("cannot change alternate number to 0 (error=%i)\n", errCode); } } -- cgit v1.2.3 From 3e7974169a826fe20381302bddd7d531b30646ef Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 12 Oct 2016 07:10:10 -0300 Subject: [media] em28xx: mark printk continuation lines as such This driver has a lot of printk continuation lines for debugging purposes. Since commit 563873318d32 ("Merge branch 'printk-cleanups"), this won't work as expected anymore. So, let's add KERN_CONT to those lines. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/em28xx/em28xx-core.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index a73e853e876e..06bee2d67273 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -102,7 +102,7 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg, 0x0000, reg, dev->urb_buf, len, HZ); if (ret < 0) { if (reg_debug) - printk(" failed!\n"); + printk(KERN_CONT " failed!\n"); mutex_unlock(&dev->ctrl_urb_lock); return usb_translate_errors(ret); } @@ -115,10 +115,10 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg, if (reg_debug) { int byte; - printk("<<<"); + printk(KERN_CONT "<<<"); for (byte = 0; byte < len; byte++) - printk(" %02x", (unsigned char)buf[byte]); - printk("\n"); + printk(KERN_CONT " %02x", (unsigned char)buf[byte]); + printk(KERN_CONT "\n"); } return ret; @@ -174,8 +174,8 @@ int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf, len & 0xff, len >> 8); for (byte = 0; byte < len; byte++) - printk(" %02x", (unsigned char)buf[byte]); - printk("\n"); + printk(KERN_CONT " %02x", (unsigned char)buf[byte]); + printk(KERN_CONT "\n"); } mutex_lock(&dev->ctrl_urb_lock); -- cgit v1.2.3 From 8314d40233f3790e4cfa704087bb2a43c18144d7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Wed, 12 Oct 2016 07:26:47 -0300 Subject: [media] em28xx: use pr_foo instead of em28xx-specific printk macros There's no reason to keep using em28xx-specific printk macros here. Just use pr_foo(). Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/em28xx/em28xx-audio.c | 31 ++++----- drivers/media/usb/em28xx/em28xx-camera.c | 34 +++++----- drivers/media/usb/em28xx/em28xx-cards.c | 77 +++++++++++----------- drivers/media/usb/em28xx/em28xx-core.c | 51 +++++++-------- drivers/media/usb/em28xx/em28xx-dvb.c | 42 ++++++------ drivers/media/usb/em28xx/em28xx-i2c.c | 109 ++++++++++++++++--------------- drivers/media/usb/em28xx/em28xx-input.c | 26 ++++---- drivers/media/usb/em28xx/em28xx-video.c | 57 ++++++++-------- drivers/media/usb/em28xx/em28xx.h | 18 +---- 9 files changed, 215 insertions(+), 230 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 2a3975b1aea5..b5f35a25d870 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -25,6 +25,8 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "em28xx.h" + #include #include #include @@ -44,7 +46,6 @@ #include #include #include -#include "em28xx.h" static int debug; module_param(debug, int, 0644); @@ -164,7 +165,7 @@ static void em28xx_audio_isocirq(struct urb *urb) status = usb_submit_urb(urb, GFP_ATOMIC); if (status < 0) - em28xx_errdev("resubmit of audio urb failed (error=%i)\n", + pr_err("resubmit of audio urb failed (error=%i)\n", status); return; } @@ -182,7 +183,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev) errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); if (errCode) { - em28xx_errdev("submit of audio urb failed (error=%i)\n", + pr_err("submit of audio urb failed (error=%i)\n", errCode); em28xx_deinit_isoc_audio(dev); atomic_set(&dev->adev.stream_started, 0); @@ -254,7 +255,7 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) int nonblock, ret = 0; if (!dev) { - em28xx_err("BUG: em28xx can't find device struct. Can't proceed with open\n"); + pr_err("BUG: em28xx can't find device struct. Can't proceed with open\n"); return -ENODEV; } @@ -317,7 +318,7 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) err: mutex_unlock(&dev->lock); - em28xx_err("Error while configuring em28xx mixer\n"); + pr_err("Error while configuring em28xx mixer\n"); return ret; } @@ -755,7 +756,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) intf = usb_ifnum_to_if(dev->udev, dev->ifnum); if (intf->num_altsetting <= alt) { - em28xx_errdev("alt %d doesn't exist on interface %d\n", + pr_err("alt %d doesn't exist on interface %d\n", dev->ifnum, alt); return -ENODEV; } @@ -771,14 +772,14 @@ static int em28xx_audio_urb_init(struct em28xx *dev) } if (!ep) { - em28xx_errdev("Couldn't find an audio endpoint"); + pr_err("Couldn't find an audio endpoint"); return -ENODEV; } ep_size = em28xx_audio_ep_packet_size(dev->udev, ep); interval = 1 << (ep->bInterval - 1); - em28xx_info("Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n", + pr_info("Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n", EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed), dev->ifnum, alt, interval, @@ -819,7 +820,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) if (urb_size > ep_size * npackets) npackets = DIV_ROUND_UP(urb_size, ep_size); - em28xx_info("Number of URBs: %d, with %d packets and %d size\n", + pr_info("Number of URBs: %d, with %d packets and %d size\n", num_urb, npackets, urb_size); /* Estimate the bytes per period */ @@ -857,7 +858,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC, &urb->transfer_dma); if (!buf) { - em28xx_errdev("usb_alloc_coherent failed!\n"); + pr_err("usb_alloc_coherent failed!\n"); em28xx_audio_free_urb(dev); return -ENOMEM; } @@ -897,7 +898,7 @@ static int em28xx_audio_init(struct em28xx *dev) return 0; } - em28xx_info("Binding audio extension\n"); + pr_info("Binding audio extension\n"); kref_get(&dev->ref); @@ -953,7 +954,7 @@ static int em28xx_audio_init(struct em28xx *dev) if (err < 0) goto urb_free; - em28xx_info("Audio extension successfully initialized\n"); + pr_info("Audio extension successfully initialized\n"); return 0; urb_free: @@ -978,7 +979,7 @@ static int em28xx_audio_fini(struct em28xx *dev) return 0; } - em28xx_info("Closing audio extension\n"); + pr_info("Closing audio extension\n"); if (dev->adev.sndcard) { snd_card_disconnect(dev->adev.sndcard); @@ -1002,7 +1003,7 @@ static int em28xx_audio_suspend(struct em28xx *dev) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) return 0; - em28xx_info("Suspending audio extension\n"); + pr_info("Suspending audio extension\n"); em28xx_deinit_isoc_audio(dev); atomic_set(&dev->adev.stream_started, 0); return 0; @@ -1016,7 +1017,7 @@ static int em28xx_audio_resume(struct em28xx *dev) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) return 0; - em28xx_info("Resuming audio extension\n"); + pr_info("Resuming audio extension\n"); /* Nothing to do other than schedule_work() ?? */ schedule_work(&dev->adev.wq_trigger); return 0; diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 72f3f4d50253..bc07166e7df0 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -19,14 +19,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "em28xx.h" + #include #include #include #include #include -#include "em28xx.h" - /* Possible i2c addresses of Micron sensors */ static unsigned short micron_sensor_addrs[] = { 0xb8 >> 1, /* MT9V111, MT9V403 */ @@ -120,13 +120,13 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ret = i2c_master_send(&client, ®, 1); if (ret < 0) { if (ret != -ENXIO) - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } ret = i2c_master_recv(&client, (u8 *)&id_be, 2); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } @@ -135,13 +135,13 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) reg = 0xff; ret = i2c_master_send(&client, ®, 1); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } ret = i2c_master_recv(&client, (u8 *)&id_be, 2); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } @@ -180,15 +180,15 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) dev->em28xx_sensor = EM28XX_MT9M001; break; default: - em28xx_info("unknown Micron sensor detected: 0x%04x\n", + pr_info("unknown Micron sensor detected: 0x%04x\n", id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - em28xx_info("unsupported sensor detected: %s\n", name); + pr_info("unsupported sensor detected: %s\n", name); else - em28xx_info("sensor %s detected\n", name); + pr_info("sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; return 0; @@ -218,7 +218,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { if (ret != -ENXIO) - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } @@ -226,7 +226,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x1d; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } @@ -238,7 +238,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x0a; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } @@ -246,7 +246,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x0b; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - em28xx_errdev("couldn't read from i2c device 0x%02x: error %i\n", + pr_err("couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; } @@ -285,15 +285,15 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) name = "OV9655"; break; default: - em28xx_info("unknown OmniVision sensor detected: 0x%04x\n", + pr_info("unknown OmniVision sensor detected: 0x%04x\n", id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - em28xx_info("unsupported sensor detected: %s\n", name); + pr_info("unsupported sensor detected: %s\n", name); else - em28xx_info("sensor %s detected\n", name); + pr_info("sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; return 0; @@ -317,7 +317,7 @@ int em28xx_detect_sensor(struct em28xx *dev) */ if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) { - em28xx_info("No sensor detected\n"); + pr_info("No sensor detected\n"); return -ENODEV; } diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index bed41c1b4817..c73cf2012bf5 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -23,6 +23,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "em28xx.h" + #include #include #include @@ -39,7 +41,6 @@ #include #include -#include "em28xx.h" #define DRIVER_NAME "em28xx" @@ -2677,7 +2678,7 @@ static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev, msleep(50); } - em28xx_warn("AC97 registers access is not reliable !\n"); + pr_warn("AC97 registers access is not reliable !\n"); return -ETIMEDOUT; } @@ -2831,12 +2832,12 @@ static int em28xx_hint_board(struct em28xx *dev) dev->model = em28xx_eeprom_hash[i].model; dev->tuner_type = em28xx_eeprom_hash[i].tuner; - em28xx_errdev("Your board has no unique USB ID.\n"); - em28xx_errdev("A hint were successfully done, based on eeprom hash.\n"); - em28xx_errdev("This method is not 100%% failproof.\n"); - em28xx_errdev("If the board were missdetected, please email this log to:\n"); - em28xx_errdev("\tV4L Mailing List \n"); - em28xx_errdev("Board detected as %s\n", + pr_err("Your board has no unique USB ID.\n"); + pr_err("A hint were successfully done, based on eeprom hash.\n"); + pr_err("This method is not 100%% failproof.\n"); + pr_err("If the board were missdetected, please email this log to:\n"); + pr_err("\tV4L Mailing List \n"); + pr_err("Board detected as %s\n", em28xx_boards[dev->model].name); return 0; @@ -2860,28 +2861,28 @@ static int em28xx_hint_board(struct em28xx *dev) if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { dev->model = em28xx_i2c_hash[i].model; dev->tuner_type = em28xx_i2c_hash[i].tuner; - em28xx_errdev("Your board has no unique USB ID.\n"); - em28xx_errdev("A hint were successfully done, based on i2c devicelist hash.\n"); - em28xx_errdev("This method is not 100%% failproof.\n"); - em28xx_errdev("If the board were missdetected, please email this log to:\n"); - em28xx_errdev("\tV4L Mailing List \n"); - em28xx_errdev("Board detected as %s\n", + pr_err("Your board has no unique USB ID.\n"); + pr_err("A hint were successfully done, based on i2c devicelist hash.\n"); + pr_err("This method is not 100%% failproof.\n"); + pr_err("If the board were missdetected, please email this log to:\n"); + pr_err("\tV4L Mailing List \n"); + pr_err("Board detected as %s\n", em28xx_boards[dev->model].name); return 0; } } - em28xx_errdev("Your board has no unique USB ID and thus need a hint to be detected.\n"); - em28xx_errdev("You may try to use card= insmod option to workaround that.\n"); - em28xx_errdev("Please send an email with this log to:\n"); - em28xx_errdev("\tV4L Mailing List \n"); - em28xx_errdev("Board eeprom hash is 0x%08lx\n", dev->hash); - em28xx_errdev("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash); + pr_err("Your board has no unique USB ID and thus need a hint to be detected.\n"); + pr_err("You may try to use card= insmod option to workaround that.\n"); + pr_err("Please send an email with this log to:\n"); + pr_err("\tV4L Mailing List \n"); + pr_err("Board eeprom hash is 0x%08lx\n", dev->hash); + pr_err("Board i2c devicelist hash is 0x%08lx\n", dev->i2c_hash); - em28xx_errdev("Here is a list of valid choices for the card= insmod option:\n"); + pr_err("Here is a list of valid choices for the card= insmod option:\n"); for (i = 0; i < em28xx_bcount; i++) { - em28xx_errdev(" card=%d -> %s\n", + pr_err(" card=%d -> %s\n", i, em28xx_boards[i].name); } return -1; @@ -2916,7 +2917,7 @@ static void em28xx_card_setup(struct em28xx *dev) * hash identities which has not been determined as yet. */ if (em28xx_hint_board(dev) < 0) - em28xx_errdev("Board not discovered\n"); + pr_err("Board not discovered\n"); else { em28xx_set_model(dev); em28xx_pre_card_setup(dev); @@ -2926,7 +2927,7 @@ static void em28xx_card_setup(struct em28xx *dev) em28xx_set_model(dev); } - em28xx_info("Identified as %s (card=%d)\n", + pr_info("Identified as %s (card=%d)\n", dev->board.name, dev->model); dev->tuner_type = em28xx_boards[dev->model].tuner_type; @@ -3025,10 +3026,10 @@ static void em28xx_card_setup(struct em28xx *dev) } if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { - em28xx_errdev("\n\n"); - em28xx_errdev("The support for this board weren't valid yet.\n"); - em28xx_errdev("Please send a report of having this working\n"); - em28xx_errdev("not to V4L mailing list (and/or to other addresses)\n\n"); + pr_err("\n\n"); + pr_err("The support for this board weren't valid yet.\n"); + pr_err("Please send a report of having this working\n"); + pr_err("not to V4L mailing list (and/or to other addresses)\n\n"); } /* Free eeprom data memory */ @@ -3211,7 +3212,7 @@ void em28xx_free_device(struct kref *ref) { struct em28xx *dev = kref_to_dev(ref); - em28xx_info("Freeing device\n"); + pr_info("Freeing device\n"); if (!dev->disconnected) em28xx_release_resources(dev); @@ -3349,7 +3350,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, /* Resets I2C speed */ retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); if (retval < 0) { - em28xx_errdev("%s: em28xx_write_reg failed! retval [%d]\n", + pr_err("%s: em28xx_write_reg failed! retval [%d]\n", __func__, retval); return retval; } @@ -3363,7 +3364,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, else retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX); if (retval < 0) { - em28xx_errdev("%s: em28xx_i2c_register bus 0 - error [%d]!\n", + pr_err("%s: em28xx_i2c_register bus 0 - error [%d]!\n", __func__, retval); return retval; } @@ -3377,7 +3378,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, retval = em28xx_i2c_register(dev, 1, EM28XX_I2C_ALGO_EM28XX); if (retval < 0) { - em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n", + pr_err("%s: em28xx_i2c_register bus 1 - error [%d]!\n", __func__, retval); em28xx_i2c_unregister(dev, 0); @@ -3427,7 +3428,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, /* Don't register audio interfaces */ if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { - em28xx_err(DRIVER_NAME + pr_err(DRIVER_NAME " audio device (%04x:%04x): interface %i, class %i\n", le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idProduct), @@ -3441,7 +3442,6 @@ static int em28xx_usb_probe(struct usb_interface *interface, /* allocate memory for our device state and initialize it */ dev = kzalloc(sizeof(*dev), GFP_KERNEL); if (dev == NULL) { - em28xx_err(DRIVER_NAME ": out of memory!\n"); retval = -ENOMEM; goto err; } @@ -3451,7 +3451,6 @@ static int em28xx_usb_probe(struct usb_interface *interface, kmalloc(sizeof(dev->alt_max_pkt_size_isoc[0]) * interface->num_altsetting, GFP_KERNEL); if (dev->alt_max_pkt_size_isoc == NULL) { - em28xx_errdev("out of memory!\n"); kfree(dev); retval = -ENOMEM; goto err; @@ -3604,7 +3603,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { if (has_vendor_audio) - em28xx_err("em28xx: device seems to have vendor AND usb audio class interfaces !\n" + pr_err("em28xx: device seems to have vendor AND usb audio class interfaces !\n" "\t\tThe vendor interface will be ignored. Please contact the developers \n"); dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS; break; @@ -3661,13 +3660,13 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (has_video) { if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) dev->analog_xfer_bulk = 1; - em28xx_info("analog set to %s mode.\n", + pr_info("analog set to %s mode.\n", dev->analog_xfer_bulk ? "bulk" : "isoc"); } if (has_dvb) { if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) dev->dvb_xfer_bulk = 1; - em28xx_info("dvb set to %s mode.\n", + pr_info("dvb set to %s mode.\n", dev->dvb_xfer_bulk ? "bulk" : "isoc"); } @@ -3715,7 +3714,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) dev->disconnected = 1; - em28xx_info("Disconnecting %s\n", dev->name); + pr_info("Disconnecting %s\n", dev->name); flush_request_modules(dev); diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 06bee2d67273..8897cde9894b 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -22,6 +22,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "em28xx.h" + #include #include #include @@ -32,8 +34,6 @@ #include #include -#include "em28xx.h" - #define DRIVER_AUTHOR "Ludovico Cavedon , " \ "Markus Rechberger , " \ "Mauro Carvalho Chehab , " \ @@ -267,7 +267,7 @@ static int em28xx_is_ac97_ready(struct em28xx *dev) msleep(5); } - em28xx_warn("AC97 command still being executed: not handled properly!\n"); + pr_warn("AC97 command still being executed: not handled properly!\n"); return -EBUSY; } @@ -360,7 +360,7 @@ static int set_ac97_input(struct em28xx *dev) ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); if (ret < 0) - em28xx_warn("couldn't setup AC97 register %d\n", + pr_warn("couldn't setup AC97 register %d\n", inputs[i].reg); } return 0; @@ -444,7 +444,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) for (i = 0; i < ARRAY_SIZE(outputs); i++) { ret = em28xx_write_ac97(dev, outputs[i].reg, 0x8000); if (ret < 0) - em28xx_warn("couldn't setup AC97 register %d\n", + pr_warn("couldn't setup AC97 register %d\n", outputs[i].reg); } } @@ -482,7 +482,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) ret = em28xx_write_ac97(dev, outputs[i].reg, vol); if (ret < 0) - em28xx_warn("couldn't setup AC97 register %d\n", + pr_warn("couldn't setup AC97 register %d\n", outputs[i].reg); } @@ -519,7 +519,7 @@ int em28xx_audio_setup(struct em28xx *dev) /* See how this device is configured */ cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG); - em28xx_info("Config register raw data: 0x%02x\n", cfg); + pr_info("Config register raw data: 0x%02x\n", cfg); if (cfg < 0) { /* Register read error */ /* Be conservative */ dev->int_audio_type = EM28XX_INT_AUDIO_AC97; @@ -540,7 +540,7 @@ int em28xx_audio_setup(struct em28xx *dev) i2s_samplerates = 5; else i2s_samplerates = 3; - em28xx_info("I2S Audio (%d sample rate(s))\n", + pr_info("I2S Audio (%d sample rate(s))\n", i2s_samplerates); /* Skip the code that does AC97 vendor detection */ dev->audio_mode.ac97 = EM28XX_NO_AC97; @@ -558,7 +558,7 @@ int em28xx_audio_setup(struct em28xx *dev) * Note: (some) em2800 devices without eeprom reports 0x91 on * CHIPCFG register, even not having an AC97 chip */ - em28xx_warn("AC97 chip type couldn't be determined\n"); + pr_warn("AC97 chip type couldn't be determined\n"); dev->audio_mode.ac97 = EM28XX_NO_AC97; if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR) dev->usb_audio_type = EM28XX_USB_AUDIO_NONE; @@ -571,13 +571,13 @@ int em28xx_audio_setup(struct em28xx *dev) goto init_audio; vid = vid1 << 16 | vid2; - em28xx_warn("AC97 vendor ID = 0x%08x\n", vid); + pr_warn("AC97 vendor ID = 0x%08x\n", vid); feat = em28xx_read_ac97(dev, AC97_RESET); if (feat < 0) goto init_audio; - em28xx_warn("AC97 features = 0x%04x\n", feat); + pr_warn("AC97 features = 0x%04x\n", feat); /* Try to identify what audio processor we have */ if (((vid == 0xffffffff) || (vid == 0x83847650)) && (feat == 0x6a90)) @@ -589,17 +589,17 @@ init_audio: /* Reports detected AC97 processor */ switch (dev->audio_mode.ac97) { case EM28XX_NO_AC97: - em28xx_info("No AC97 audio processor\n"); + pr_info("No AC97 audio processor\n"); break; case EM28XX_AC97_EM202: - em28xx_info("Empia 202 AC97 audio processor detected\n"); + pr_info("Empia 202 AC97 audio processor detected\n"); break; case EM28XX_AC97_SIGMATEL: - em28xx_info("Sigmatel audio processor detected (stac 97%02x)\n", + pr_info("Sigmatel audio processor detected (stac 97%02x)\n", vid & 0xff); break; case EM28XX_AC97_OTHER: - em28xx_warn("Unknown AC97 audio processor detected!\n"); + pr_warn("Unknown AC97 audio processor detected!\n"); break; default: break; @@ -883,7 +883,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, if (mode == EM28XX_DIGITAL_MODE) { if ((xfer_bulk && !dev->dvb_ep_bulk) || (!xfer_bulk && !dev->dvb_ep_isoc)) { - em28xx_errdev("no endpoint for DVB mode and transfer type %d\n", + pr_err("no endpoint for DVB mode and transfer type %d\n", xfer_bulk > 0); return -EINVAL; } @@ -891,13 +891,13 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, } else if (mode == EM28XX_ANALOG_MODE) { if ((xfer_bulk && !dev->analog_ep_bulk) || (!xfer_bulk && !dev->analog_ep_isoc)) { - em28xx_errdev("no endpoint for analog mode and transfer type %d\n", + pr_err("no endpoint for analog mode and transfer type %d\n", xfer_bulk > 0); return -EINVAL; } usb_bufs = &dev->usb_ctl.analog_bufs; } else { - em28xx_errdev("invalid mode selected\n"); + pr_err("invalid mode selected\n"); return -EINVAL; } @@ -907,15 +907,12 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, usb_bufs->num_bufs = num_bufs; usb_bufs->urb = kzalloc(sizeof(void *)*num_bufs, GFP_KERNEL); - if (!usb_bufs->urb) { - em28xx_errdev("cannot alloc memory for usb buffers\n"); + if (!usb_bufs->urb) return -ENOMEM; - } usb_bufs->transfer_buffer = kzalloc(sizeof(void *)*num_bufs, GFP_KERNEL); if (!usb_bufs->transfer_buffer) { - em28xx_errdev("cannot allocate memory for usb transfer\n"); kfree(usb_bufs->urb); return -ENOMEM; } @@ -942,7 +939,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, usb_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev, sb_size, GFP_KERNEL, &urb->transfer_dma); if (!usb_bufs->transfer_buffer[i]) { - em28xx_err("unable to allocate %i bytes for transfer buffer %i%s\n", + pr_err("unable to allocate %i bytes for transfer buffer %i%s\n", sb_size, i, in_interrupt() ? " while in int" : ""); em28xx_uninit_usb_xfer(dev, mode); @@ -1024,7 +1021,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode, if (xfer_bulk) { rc = usb_clear_halt(dev->udev, usb_bufs->urb[0]->pipe); if (rc < 0) { - em28xx_err("failed to clear USB bulk endpoint stall/halt condition (error=%i)\n", + pr_err("failed to clear USB bulk endpoint stall/halt condition (error=%i)\n", rc); em28xx_uninit_usb_xfer(dev, mode); return rc; @@ -1040,7 +1037,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode, for (i = 0; i < usb_bufs->num_bufs; i++) { rc = usb_submit_urb(usb_bufs->urb[i], GFP_ATOMIC); if (rc) { - em28xx_err("submit of urb %i failed (error=%i)\n", i, + pr_err("submit of urb %i failed (error=%i)\n", i, rc); em28xx_uninit_usb_xfer(dev, mode); return rc; @@ -1123,7 +1120,7 @@ int em28xx_suspend_extension(struct em28xx *dev) { const struct em28xx_ops *ops = NULL; - em28xx_info("Suspending extensions\n"); + pr_info("Suspending extensions\n"); mutex_lock(&em28xx_devlist_mutex); list_for_each_entry(ops, &em28xx_extension_devlist, next) { if (ops->suspend) @@ -1137,7 +1134,7 @@ int em28xx_resume_extension(struct em28xx *dev) { const struct em28xx_ops *ops = NULL; - em28xx_info("Resuming extensions\n"); + pr_info("Resuming extensions\n"); mutex_lock(&em28xx_devlist_mutex); list_for_each_entry(ops, &em28xx_extension_devlist, next) { if (ops->resume) diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 488c70e5ebde..cbece65899b5 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -21,11 +21,12 @@ the Free Software Foundation; either version 2 of the License. */ +#include "em28xx.h" + #include #include #include -#include "em28xx.h" #include #include #include @@ -734,7 +735,7 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe) ret = gpio_request_one(dvb->lna_gpio, flags, NULL); if (ret) - em28xx_errdev("gpio request failed %d\n", ret); + pr_err("gpio request failed %d\n", ret); else gpio_free(dvb->lna_gpio); @@ -934,19 +935,19 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) cfg.ctrl = &ctl; if (!dev->dvb->fe[0]) { - em28xx_errdev("/2: dvb frontend not attached. Can't attach xc3028\n"); + pr_err("/2: dvb frontend not attached. Can't attach xc3028\n"); return -EINVAL; } fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg); if (!fe) { - em28xx_errdev("/2: xc3028 attach failed\n"); + pr_err("/2: xc3028 attach failed\n"); dvb_frontend_detach(dev->dvb->fe[0]); dev->dvb->fe[0] = NULL; return -EINVAL; } - em28xx_info("%s/2: xc3028 attached\n", dev->name); + pr_info("%s/2: xc3028 attached\n", dev->name); return 0; } @@ -1116,13 +1117,12 @@ static int em28xx_dvb_init(struct em28xx *dev) return 0; } - em28xx_info("Binding DVB extension\n"); + pr_info("Binding DVB extension\n"); dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL); - if (dvb == NULL) { - em28xx_info("em28xx_dvb: memory allocation failed\n"); + if (!dvb) return -ENOMEM; - } + dev->dvb = dvb; dvb->fe[0] = dvb->fe[1] = NULL; @@ -1141,7 +1141,7 @@ static int em28xx_dvb_init(struct em28xx *dev) EM28XX_DVB_NUM_ISOC_PACKETS); } if (result) { - em28xx_errdev("em28xx_dvb: failed to pre-allocate USB transfer buffers for DVB.\n"); + pr_err("em28xx_dvb: failed to pre-allocate USB transfer buffers for DVB.\n"); kfree(dvb); dev->dvb = NULL; return result; @@ -1320,7 +1320,7 @@ static int em28xx_dvb_init(struct em28xx *dev) result = gpio_request_one(dvb->lna_gpio, GPIOF_OUT_INIT_LOW, NULL); if (result) - em28xx_errdev("gpio request failed %d\n", + pr_err("gpio request failed %d\n", result); else gpio_free(dvb->lna_gpio); @@ -1936,11 +1936,11 @@ static int em28xx_dvb_init(struct em28xx *dev) } break; default: - em28xx_errdev("/2: The frontend of your DVB/ATSC card isn't supported yet\n"); + pr_err("/2: The frontend of your DVB/ATSC card isn't supported yet\n"); break; } if (NULL == dvb->fe[0]) { - em28xx_errdev("/2: frontend initialization failed\n"); + pr_err("/2: frontend initialization failed\n"); result = -EINVAL; goto out_free; } @@ -1955,7 +1955,7 @@ static int em28xx_dvb_init(struct em28xx *dev) if (result < 0) goto out_free; - em28xx_info("DVB extension successfully initialized\n"); + pr_info("DVB extension successfully initialized\n"); kref_get(&dev->ref); @@ -1995,7 +1995,7 @@ static int em28xx_dvb_fini(struct em28xx *dev) if (!dev->dvb) return 0; - em28xx_info("Closing DVB extension\n"); + pr_info("Closing DVB extension\n"); dvb = dev->dvb; @@ -2053,17 +2053,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev) if (!dev->board.has_dvb) return 0; - em28xx_info("Suspending DVB extension\n"); + pr_info("Suspending DVB extension\n"); if (dev->dvb) { struct em28xx_dvb *dvb = dev->dvb; if (dvb->fe[0]) { ret = dvb_frontend_suspend(dvb->fe[0]); - em28xx_info("fe0 suspend %d\n", ret); + pr_info("fe0 suspend %d\n", ret); } if (dvb->fe[1]) { dvb_frontend_suspend(dvb->fe[1]); - em28xx_info("fe1 suspend %d\n", ret); + pr_info("fe1 suspend %d\n", ret); } } @@ -2080,18 +2080,18 @@ static int em28xx_dvb_resume(struct em28xx *dev) if (!dev->board.has_dvb) return 0; - em28xx_info("Resuming DVB extension\n"); + pr_info("Resuming DVB extension\n"); if (dev->dvb) { struct em28xx_dvb *dvb = dev->dvb; if (dvb->fe[0]) { ret = dvb_frontend_resume(dvb->fe[0]); - em28xx_info("fe0 resume %d\n", ret); + pr_info("fe0 resume %d\n", ret); } if (dvb->fe[1]) { ret = dvb_frontend_resume(dvb->fe[1]); - em28xx_info("fe1 resume %d\n", ret); + pr_info("fe1 resume %d\n", ret); } } diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index 8b690ac908a4..5185fed9fbf0 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -22,13 +22,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#include "em28xx.h" + #include #include #include #include #include -#include "em28xx.h" #include "tuner-xc2028.h" #include #include @@ -70,7 +71,7 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) /* trigger write */ ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len); if (ret != 2 + len) { - em28xx_warn("failed to trigger write to i2c address 0x%x (error=%i)\n", + pr_warn("failed to trigger write to i2c address 0x%x (error=%i)\n", addr, ret); return (ret < 0) ? ret : -EIO; } @@ -81,19 +82,19 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) return len; if (ret == 0x94 + len - 1) { if (i2c_debug == 1) - em28xx_warn("R05 returned 0x%02x: I2C ACK error\n", + pr_warn("R05 returned 0x%02x: I2C ACK error\n", ret); return -ENXIO; } if (ret < 0) { - em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n", + pr_warn("failed to get i2c transfer status from bridge register (error=%i)\n", ret); return ret; } msleep(5); } if (i2c_debug) - em28xx_warn("write to i2c device at 0x%x timed out\n", addr); + pr_warn("write to i2c device at 0x%x timed out\n", addr); return -ETIMEDOUT; } @@ -116,7 +117,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) buf2[0] = addr; ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2); if (ret != 2) { - em28xx_warn("failed to trigger read from i2c address 0x%x (error=%i)\n", + pr_warn("failed to trigger read from i2c address 0x%x (error=%i)\n", addr, ret); return (ret < 0) ? ret : -EIO; } @@ -128,12 +129,12 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) break; if (ret == 0x94 + len - 1) { if (i2c_debug == 1) - em28xx_warn("R05 returned 0x%02x: I2C ACK error\n", + pr_warn("R05 returned 0x%02x: I2C ACK error\n", ret); return -ENXIO; } if (ret < 0) { - em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n", + pr_warn("failed to get i2c transfer status from bridge register (error=%i)\n", ret); return ret; } @@ -141,14 +142,14 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) } if (ret != 0x84 + len - 1) { if (i2c_debug) - em28xx_warn("read from i2c device at 0x%x timed out\n", + pr_warn("read from i2c device at 0x%x timed out\n", addr); } /* get the received message */ ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len); if (ret != len) { - em28xx_warn("reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n", + pr_warn("reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n", addr, ret); return (ret < 0) ? ret : -EIO; } @@ -193,11 +194,11 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, ret = dev->em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len); if (ret != len) { if (ret < 0) { - em28xx_warn("writing to i2c device at 0x%x failed (error=%i)\n", + pr_warn("writing to i2c device at 0x%x failed (error=%i)\n", addr, ret); return ret; } else { - em28xx_warn("%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", + pr_warn("%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", len, addr, ret); return -EIO; } @@ -210,12 +211,12 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, return len; if (ret == 0x10) { if (i2c_debug == 1) - em28xx_warn("I2C ACK error on writing to addr 0x%02x\n", + pr_warn("I2C ACK error on writing to addr 0x%02x\n", addr); return -ENXIO; } if (ret < 0) { - em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n", + pr_warn("failed to get i2c transfer status from bridge register (error=%i)\n", ret); return ret; } @@ -230,12 +231,12 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, if (ret == 0x02 || ret == 0x04) { /* NOTE: these errors seem to be related to clock stretching */ if (i2c_debug) - em28xx_warn("write to i2c device at 0x%x timed out (status=%i)\n", + pr_warn("write to i2c device at 0x%x timed out (status=%i)\n", addr, ret); return -ETIMEDOUT; } - em28xx_warn("write to i2c device at 0x%x failed with unknown error (status=%i)\n", + pr_warn("write to i2c device at 0x%x failed with unknown error (status=%i)\n", addr, ret); return -EIO; } @@ -258,7 +259,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) /* Read data from i2c device */ ret = dev->em28xx_read_reg_req_len(dev, 2, addr, buf, len); if (ret < 0) { - em28xx_warn("reading from i2c device at 0x%x failed (error=%i)\n", + pr_warn("reading from i2c device at 0x%x failed (error=%i)\n", addr, ret); return ret; } @@ -276,13 +277,13 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) if (ret == 0) /* success */ return len; if (ret < 0) { - em28xx_warn("failed to get i2c transfer status from bridge register (error=%i)\n", + pr_warn("failed to get i2c transfer status from bridge register (error=%i)\n", ret); return ret; } if (ret == 0x10) { if (i2c_debug == 1) - em28xx_warn("I2C ACK error on writing to addr 0x%02x\n", + pr_warn("I2C ACK error on writing to addr 0x%02x\n", addr); return -ENXIO; } @@ -290,12 +2