diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-12-07 13:48:10 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-12-12 07:29:08 -0200 |
commit | 29b05e22f5c68c657f5ec30a31023b81124287fb (patch) | |
tree | 3c76e467ae57e57ba1af14837b1f599b838fcf61 /drivers/media | |
parent | ea48c3680829c0c522a799a4a9e0fb6cc5afd0a4 (diff) |
[media] em28xx: use usb_interface for dev_foo() calls
The usb_device->dev is not the right device for dev_foo() calls.
Instead, it should use usb_interface->dev.
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-audio.c | 34 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-camera.c | 30 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 61 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-core.c | 48 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-dvb.c | 61 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-i2c.c | 92 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-input.c | 32 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-vbi.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 68 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 1 |
10 files changed, 216 insertions, 213 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 7060e5146e31..7f8601427b7f 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -56,7 +56,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); #define dprintk(fmt, arg...) do { \ if (debug) \ - dev_printk(KERN_DEBUG, &dev->udev->dev, \ + dev_printk(KERN_DEBUG, &dev->intf->dev, \ "video: %s: " fmt, __func__, ## arg); \ } while (0) @@ -166,7 +166,7 @@ static void em28xx_audio_isocirq(struct urb *urb) status = usb_submit_urb(urb, GFP_ATOMIC); if (status < 0) - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "resubmit of audio urb failed (error=%i)\n", status); return; @@ -185,7 +185,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev) errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); if (errCode) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "submit of audio urb failed (error=%i)\n", errCode); em28xx_deinit_isoc_audio(dev); @@ -322,7 +322,7 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) err: mutex_unlock(&dev->lock); - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Error while configuring em28xx mixer\n"); return ret; } @@ -761,7 +761,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) intf = usb_ifnum_to_if(dev->udev, dev->ifnum); if (intf->num_altsetting <= alt) { - dev_err(&dev->udev->dev, "alt %d doesn't exist on interface %d\n", + dev_err(&dev->intf->dev, "alt %d doesn't exist on interface %d\n", dev->ifnum, alt); return -ENODEV; } @@ -777,14 +777,14 @@ static int em28xx_audio_urb_init(struct em28xx *dev) } if (!ep) { - dev_err(&dev->udev->dev, "Couldn't find an audio endpoint"); + dev_err(&dev->intf->dev, "Couldn't find an audio endpoint"); return -ENODEV; } ep_size = em28xx_audio_ep_packet_size(dev->udev, ep); interval = 1 << (ep->bInterval - 1); - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "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, ep_size); @@ -824,7 +824,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) if (urb_size > ep_size * npackets) npackets = DIV_ROUND_UP(urb_size, ep_size); - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "Number of URBs: %d, with %d packets and %d size\n", num_urb, npackets, urb_size); @@ -863,7 +863,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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "usb_alloc_coherent failed!\n"); em28xx_audio_free_urb(dev); return -ENOMEM; @@ -904,16 +904,16 @@ static int em28xx_audio_init(struct em28xx *dev) return 0; } - dev_info(&dev->udev->dev, "Binding audio extension\n"); + dev_info(&dev->intf->dev, "Binding audio extension\n"); kref_get(&dev->ref); - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n"); - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "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->intf->dev, index[devnr], "Em28xx Audio", THIS_MODULE, 0, &card); if (err < 0) return err; @@ -961,7 +961,7 @@ static int em28xx_audio_init(struct em28xx *dev) if (err < 0) goto urb_free; - dev_info(&dev->udev->dev, "Audio extension successfully initialized\n"); + dev_info(&dev->intf->dev, "Audio extension successfully initialized\n"); return 0; urb_free: @@ -986,7 +986,7 @@ static int em28xx_audio_fini(struct em28xx *dev) return 0; } - dev_info(&dev->udev->dev, "Closing audio extension\n"); + dev_info(&dev->intf->dev, "Closing audio extension\n"); if (dev->adev.sndcard) { snd_card_disconnect(dev->adev.sndcard); @@ -1010,7 +1010,7 @@ static int em28xx_audio_suspend(struct em28xx *dev) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) return 0; - dev_info(&dev->udev->dev, "Suspending audio extension\n"); + dev_info(&dev->intf->dev, "Suspending audio extension\n"); em28xx_deinit_isoc_audio(dev); atomic_set(&dev->adev.stream_started, 0); return 0; @@ -1024,7 +1024,7 @@ static int em28xx_audio_resume(struct em28xx *dev) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) return 0; - dev_info(&dev->udev->dev, "Resuming audio extension\n"); + dev_info(&dev->intf->dev, "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 2e24b65901ec..89c890ba7dd6 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c @@ -121,14 +121,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ret = i2c_master_send(&client, ®, 1); if (ret < 0) { if (ret != -ENXIO) - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; @@ -138,14 +138,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) reg = 0xff; ret = i2c_master_send(&client, ®, 1); if (ret < 0) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; @@ -185,16 +185,16 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) dev->em28xx_sensor = EM28XX_MT9M001; break; default: - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "unknown Micron sensor detected: 0x%04x\n", id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "unsupported sensor detected: %s\n", name); else - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; @@ -225,7 +225,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { if (ret != -ENXIO) - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; @@ -234,7 +234,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x1d; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; @@ -247,7 +247,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x0a; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; @@ -256,7 +256,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) reg = 0x0b; ret = i2c_smbus_read_byte_data(&client, reg); if (ret < 0) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "couldn't read from i2c device 0x%02x: error %i\n", client.addr << 1, ret); continue; @@ -296,17 +296,17 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) name = "OV9655"; break; default: - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "unknown OmniVision sensor detected: 0x%04x\n", id); return 0; } if (dev->em28xx_sensor == EM28XX_NOSENSOR) - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "unsupported sensor detected: %s\n", name); else - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "sensor %s detected\n", name); dev->i2c_client[dev->def_i2c_bus].addr = client.addr; @@ -331,7 +331,7 @@ int em28xx_detect_sensor(struct em28xx *dev) */ if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) { - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "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 50e4c6e51ee7..56739ce6ce16 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -2677,7 +2677,7 @@ static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev, msleep(50); } - dev_warn(&dev->udev->dev, "AC97 registers access is not reliable !\n"); + dev_warn(&dev->intf->dev, "AC97 registers access is not reliable !\n"); return -ETIMEDOUT; } @@ -2831,7 +2831,7 @@ static int em28xx_hint_board(struct em28xx *dev) dev->model = em28xx_eeprom_hash[i].model; dev->tuner_type = em28xx_eeprom_hash[i].tuner; - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Your board has no unique USB ID.\n" "A hint were successfully done, based on eeprom hash.\n" "This method is not 100%% failproof.\n" @@ -2861,7 +2861,7 @@ 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; - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Your board has no unique USB ID.\n" "A hint were successfully done, based on i2c devicelist hash.\n" "This method is not 100%% failproof.\n" @@ -2874,7 +2874,7 @@ static int em28xx_hint_board(struct em28xx *dev) } } - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Your board has no unique USB ID and thus need a hint to be detected.\n" "You may try to use card=<n> insmod option to workaround that.\n" "Please send an email with this log to:\n" @@ -2883,10 +2883,10 @@ static int em28xx_hint_board(struct em28xx *dev) "Board i2c devicelist hash is 0x%08lx\n", dev->hash, dev->i2c_hash); - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "Here is a list of valid choices for the card=<n> insmod option:\n"); for (i = 0; i < em28xx_bcount; i++) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, " card=%d -> %s\n", i, em28xx_boards[i].name); } return -1; @@ -2921,7 +2921,7 @@ static void em28xx_card_setup(struct em28xx *dev) * hash identities which has not been determined as yet. */ if (em28xx_hint_board(dev) < 0) - dev_err(&dev->udev->dev, "Board not discovered\n"); + dev_err(&dev->intf->dev, "Board not discovered\n"); else { em28xx_set_model(dev); em28xx_pre_card_setup(dev); @@ -2931,7 +2931,7 @@ static void em28xx_card_setup(struct em28xx *dev) em28xx_set_model(dev); } - dev_info(&dev->udev->dev, "Identified as %s (card=%d)\n", + dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n", dev->board.name, dev->model); dev->tuner_type = em28xx_boards[dev->model].tuner_type; @@ -3030,7 +3030,7 @@ static void em28xx_card_setup(struct em28xx *dev) } if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "\n\n" "The support for this board weren't valid yet.\n" "Please send a report of having this working\n" @@ -3161,7 +3161,7 @@ static int em28xx_media_device_init(struct em28xx *dev, else if (udev->manufacturer) media_device_usb_init(mdev, udev, udev->manufacturer); else - media_device_usb_init(mdev, udev, dev_name(&dev->udev->dev)); + media_device_usb_init(mdev, udev, dev_name(&dev->intf->dev)); dev->media_dev = mdev; #endif @@ -3217,7 +3217,7 @@ void em28xx_free_device(struct kref *ref) { struct em28xx *dev = kref_to_dev(ref); - dev_info(&dev->udev->dev, "Freeing device\n"); + dev_info(&dev->intf->dev, "Freeing device\n"); if (!dev->disconnected) em28xx_release_resources(dev); @@ -3239,6 +3239,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, const char *chip_name = NULL; dev->udev = udev; + dev->intf = interface; mutex_init(&dev->ctrl_urb_lock); spin_lock_init(&dev->slock); @@ -3324,10 +3325,10 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, } } if (!chip_name) - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "unknown em28xx chip ID (%d)\n", dev->chip_id); else - dev_info(&dev->udev->dev, "chip ID is %s\n", chip_name); + dev_info(&dev->intf->dev, "chip ID is %s\n", chip_name); em28xx_media_device_init(dev, udev); @@ -3346,7 +3347,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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "%s: em28xx_write_reg failed! retval [%d]\n", __func__, retval); return retval; @@ -3361,7 +3362,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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "%s: em28xx_i2c_register bus 0 - error [%d]!\n", __func__, retval); return retval; @@ -3376,7 +3377,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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "%s: em28xx_i2c_register bus 1 - error [%d]!\n", __func__, retval); @@ -3417,7 +3418,7 @@ 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 */ - dev_err(&udev->dev, + dev_err(&interface->dev, "Driver supports up to %i em28xx boards.\n", EM28XX_MAXBOARDS); retval = -ENOMEM; @@ -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) { - dev_err(&udev->dev, + dev_err(&interface->dev, "audio device (%04x:%04x): interface %i, class %i\n", le16_to_cpu(udev->descriptor.idVendor), le16_to_cpu(udev->descriptor.idProduct), @@ -3488,7 +3489,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (usb_endpoint_xfer_isoc(e)) { has_vendor_audio = true; } else { - dev_err(&udev->dev, + dev_err(&interface->dev, "error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); } break; @@ -3562,7 +3563,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, speed = "unknown"; } - dev_err(&udev->dev, + dev_err(&interface->dev, "New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n", udev->manufacturer ? udev->manufacturer : "", udev->product ? udev->product : "", @@ -3578,8 +3579,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, * not enough even for most Digital TV streams. */ if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { - dev_err(&udev->dev, "Device initialization failed.\n"); - dev_err(&udev->dev, + dev_err(&interface->dev, "Device initialization failed.\n"); + dev_err(&interface->dev, "Device must be connected to a high-speed USB 2.0 port.\n"); retval = -ENODEV; goto err_free; @@ -3593,7 +3594,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, dev->ifnum = ifnum; if (has_vendor_audio) { - dev_err(&udev->dev, + dev_err(&interface->dev, "Audio interface %i found (Vendor Class)\n", ifnum); dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; } @@ -3603,7 +3604,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { if (has_vendor_audio) - dev_err(&udev->dev, + dev_err(&interface->dev, "em28xx: device seems to have vendor AND usb audio class interfaces !\n" "\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n"); dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS; @@ -3612,12 +3613,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, } if (has_video) - dev_err(&udev->dev, "Video interface %i found:%s%s\n", + dev_err(&interface->dev, "Video interface %i found:%s%s\n", ifnum, dev->analog_ep_bulk ? " bulk" : "", dev->analog_ep_isoc ? " isoc" : ""); if (has_dvb) - dev_err(&udev->dev, "DVB interface %i found:%s%s\n", + dev_err(&interface->dev, "DVB interface %i found:%s%s\n", ifnum, dev->dvb_ep_bulk ? " bulk" : "", dev->dvb_ep_isoc ? " isoc" : ""); @@ -3649,7 +3650,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, /* Disable V4L2 if the device doesn't have a decoder */ if (has_video && dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) { - dev_err(&udev->dev, + dev_err(&interface->dev, "Currently, V4L2 is not supported on this model\n"); has_video = false; dev->has_video = false; @@ -3659,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; - dev_err(&udev->dev, "analog set to %s mode.\n", + dev_err(&interface->dev, "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; - dev_err(&udev->dev, "dvb set to %s mode.\n", + dev_err(&interface->dev, "dvb set to %s mode.\n", dev->dvb_xfer_bulk ? "bulk" : "isoc"); } @@ -3713,7 +3714,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) dev->disconnected = 1; - dev_err(&dev->udev->dev, "Disconnecting\n"); + dev_err(&dev->intf->dev, "Disconnecting\n"); flush_request_modules(dev); diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 7f1fe5d9d685..f1b4681f3c90 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -52,7 +52,7 @@ MODULE_PARM_DESC(core_debug, "enable debug messages [core and isoc]"); #define em28xx_coredbg(fmt, arg...) do { \ if (core_debug) \ - dev_printk(KERN_DEBUG, &dev->udev->dev, \ + dev_printk(KERN_DEBUG, &dev->intf->dev, \ "core: %s: " fmt, __func__, ## arg); \ } while (0) @@ -63,14 +63,14 @@ MODULE_PARM_DESC(reg_debug, "enable debug messages [URB reg]"); #define em28xx_regdbg(fmt, arg...) do { \ if (reg_debug) \ - dev_printk(KERN_DEBUG, &dev->udev->dev, \ + dev_printk(KERN_DEBUG, &dev->intf->dev, \ "reg: %s: " fmt, __func__, ## arg); \ } while (0) /* FIXME: don't abuse core_debug */ #define em28xx_isocdbg(fmt, arg...) do { \ if (core_debug) \ - dev_printk(KERN_DEBUG, &dev->udev->dev, \ + dev_printk(KERN_DEBUG, &dev->intf->dev, \ "core: %s: " fmt, __func__, ## arg); \ } while (0) @@ -258,7 +258,7 @@ static int em28xx_is_ac97_ready(struct em28xx *dev) msleep(5); } - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "AC97 command still being executed: not handled properly!\n"); return -EBUSY; } @@ -352,7 +352,7 @@ static int set_ac97_input(struct em28xx *dev) ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); if (ret < 0) - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "couldn't setup AC97 register %d\n", inputs[i].reg); } @@ -437,7 +437,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) - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "couldn't setup AC97 register %d\n", outputs[i].reg); } @@ -476,7 +476,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) ret = em28xx_write_ac97(dev, outputs[i].reg, vol); if (ret < 0) - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "couldn't setup AC97 register %d\n", outputs[i].reg); } @@ -514,7 +514,7 @@ int em28xx_audio_setup(struct em28xx *dev) /* See how this device is configured */ cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG); - dev_info(&dev->udev->dev, "Config register raw data: 0x%02x\n", cfg); + dev_info(&dev->intf->dev, "Config register raw data: 0x%02x\n", cfg); if (cfg < 0) { /* Register read error */ /* Be conservative */ dev->int_audio_type = EM28XX_INT_AUDIO_AC97; @@ -535,7 +535,7 @@ int em28xx_audio_setup(struct em28xx *dev) i2s_samplerates = 5; else i2s_samplerates = 3; - dev_info(&dev->udev->dev, "I2S Audio (%d sample rate(s))\n", + dev_info(&dev->intf->dev, "I2S Audio (%d sample rate(s))\n", i2s_samplerates); /* Skip the code that does AC97 vendor detection */ dev->audio_mode.ac97 = EM28XX_NO_AC97; @@ -553,7 +553,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 */ - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "AC97 chip type couldn't be determined\n"); dev->audio_mode.ac97 = EM28XX_NO_AC97; if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR) @@ -567,13 +567,13 @@ int em28xx_audio_setup(struct em28xx *dev) goto init_audio; vid = vid1 << 16 | vid2; - dev_warn(&dev->udev->dev, "AC97 vendor ID = 0x%08x\n", vid); + dev_warn(&dev->intf->dev, "AC97 vendor ID = 0x%08x\n", vid); feat = em28xx_read_ac97(dev, AC97_RESET); if (feat < 0) goto init_audio; - dev_warn(&dev->udev->dev, "AC97 features = 0x%04x\n", feat); + dev_warn(&dev->intf->dev, "AC97 features = 0x%04x\n", feat); /* Try to identify what audio processor we have */ if (((vid == 0xffffffff) || (vid == 0x83847650)) && (feat == 0x6a90)) @@ -585,19 +585,19 @@ init_audio: /* Reports detected AC97 processor */ switch (dev->audio_mode.ac97) { case EM28XX_NO_AC97: - dev_info(&dev->udev->dev, "No AC97 audio processor\n"); + dev_info(&dev->intf->dev, "No AC97 audio processor\n"); break; case EM28XX_AC97_EM202: - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "Empia 202 AC97 audio processor detected\n"); break; case EM28XX_AC97_SIGMATEL: - dev_info(&dev->udev->dev, + dev_info(&dev->intf->dev, "Sigmatel audio processor detected (stac 97%02x)\n", vid & 0xff); break; case EM28XX_AC97_OTHER: - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "Unknown AC97 audio processor detected!\n"); break; default: @@ -882,7 +882,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)) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "no endpoint for DVB mode and transfer type %d\n", xfer_bulk > 0); return -EINVAL; @@ -891,14 +891,14 @@ 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)) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "no endpoint for analog mode and transfer type %d\n", xfer_bulk > 0); return -EINVAL; } usb_bufs = &dev->usb_ctl.analog_bufs; } else { - dev_err(&dev->udev->dev, "invalid mode selected\n"); + dev_err(&dev->intf->dev, "invalid mode selected\n"); return -EINVAL; } @@ -940,7 +940,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]) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "unable to allocate %i bytes for transfer buffer %i%s\n", sb_size, i, in_interrupt() ? " while in int" : ""); @@ -1023,7 +1023,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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "failed to clear USB bulk endpoint stall/halt condition (error=%i)\n", rc); em28xx_uninit_usb_xfer(dev, mode); @@ -1040,7 +1040,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) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "submit of urb %i failed (error=%i)\n", i, rc); em28xx_uninit_usb_xfer(dev, mode); return rc; @@ -1123,7 +1123,7 @@ int em28xx_suspend_extension(struct em28xx *dev) { const struct em28xx_ops *ops = NULL; - dev_info(&dev->udev->dev, "Suspending extensions\n"); + dev_info(&dev->intf->dev, "Suspending extensions\n"); mutex_lock(&em28xx_devlist_mutex); list_for_each_entry(ops, &em28xx_extension_devlist, next) { if (ops->suspend) @@ -1137,7 +1137,7 @@ int em28xx_resume_extension(struct em28xx *dev) { const struct em28xx_ops *ops = NULL; - dev_info(&dev->udev->dev, "Resuming extensions\n"); + dev_info(&dev->intf->dev, "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 445e51db636f..d7cfcbe3bf19 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -75,7 +75,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); #define dprintk(level, fmt, arg...) do { \ if (debug >= level) \ - dev_printk(KERN_DEBUG, &dev->udev->dev, \ + dev_printk(KERN_DEBUG, &dev->intf->dev, \ "dvb: " fmt, ## arg); \ } while (0) @@ -736,13 +736,13 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe) ret = gpio_request_one(dvb->lna_gpio, flags, NULL); if (ret) - dev_err(&dev->udev->dev, "gpio request failed %d\n", ret); + dev_err(&dev->intf->dev, "gpio request failed %d\n", ret); else gpio_free(dvb->lna_gpio); return ret; #else - dev_warn(&dev->udev->dev, "%s: LNA control is disabled (lna=%u)\n", + dev_warn(&dev->intf->dev, "%s: LNA control is disabled (lna=%u)\n", KBUILD_MODNAME, c->lna); return 0; #endif @@ -936,20 +936,20 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) cfg.ctrl = &ctl; if (!dev->dvb->fe[0]) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "dvb frontend not attached. Can't attach xc3028\n"); return -EINVAL; } fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg); if (!fe) { - dev_err(&dev->udev->dev, "xc3028 attach failed\n"); + dev_err(&dev->intf->dev, "xc3028 attach failed\n"); dvb_frontend_detach(dev->dvb->fe[0]); dev->dvb->fe[0] = NULL; return -EINVAL; } - dev_info(&dev->udev->dev, "xc3028 attached\n"); + dev_info(&dev->intf->dev, "xc3028 attached\n"); return 0; } @@ -966,10 +966,10 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, /* register adapter */ result = dvb_register_adapter(&dvb->adapter, - dev_name(&dev->udev->dev), module, + dev_name(&dev->intf->dev), module, device, adapter_nr); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "dvb_register_adapter failed (errno = %d)\n", result); goto fail_adapter; @@ -988,7 +988,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, /* register frontend */ result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "dvb_register_frontend failed (errno = %d)\n", result); goto fail_frontend0; @@ -998,7 +998,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, if (dvb->fe[1]) { result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "2nd dvb_register_frontend failed (errno = %d)\n", result); goto fail_frontend1; @@ -1017,7 +1017,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, result = dvb_dmx_init(&dvb->demux); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "dvb_dmx_init failed (errno = %d)\n", result); goto fail_dmx; @@ -1028,7 +1028,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, dvb->dmxdev.capabilities = 0; result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "dvb_dmxdev_init failed (errno = %d)\n", result); goto fail_dmxdev; @@ -1037,7 +1037,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, dvb->fe_hw.source = DMX_FRONTEND_0; result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", result); goto fail_fe_hw; @@ -1046,7 +1046,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, dvb->fe_mem.source = DMX_MEMORY_FE; result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", result); goto fail_fe_mem; @@ -1054,7 +1054,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); if (result < 0) { - dev_warn(&dev->udev->dev, + dev_warn(&dev->intf->dev, "connect_frontend failed (errno = %d)\n", result); goto fail_fe_conn; @@ -1128,7 +1128,7 @@ static int em28xx_dvb_init(struct em28xx *dev) return 0; } - dev_info(&dev->udev->dev, "Binding DVB extension\n"); + dev_info(&dev->intf->dev, "Binding DVB extension\n"); dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL); if (!dvb) @@ -1152,7 +1152,7 @@ static int em28xx_dvb_init(struct em28xx *dev) EM28XX_DVB_NUM_ISOC_PACKETS); } if (result) { - dev_err(&dev->udev->dev, + dev_err(&dev->intf->dev, "failed to pre-allocate USB transfer buffers for DVB.\n"); kfree(dvb); dev->dvb = NULL; @@ -1270,7 +1270,8 @@ static int em28xx_dvb_init(struct em28xx *dev) case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E: dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL, - &dev->i2c_adap[dev->def_i2c_bus], &dev->udev->dev); + &dev->i2c_adap[dev->def_i2c_bus], + |