Commit 29b05e22 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab Committed by Mauro Carvalho Chehab

[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: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent ea48c368
...@@ -56,7 +56,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); ...@@ -56,7 +56,7 @@ MODULE_PARM_DESC(debug, "activates debug info");
#define dprintk(fmt, arg...) do { \ #define dprintk(fmt, arg...) do { \
if (debug) \ if (debug) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"video: %s: " fmt, __func__, ## arg); \ "video: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
...@@ -166,7 +166,7 @@ static void em28xx_audio_isocirq(struct urb *urb) ...@@ -166,7 +166,7 @@ static void em28xx_audio_isocirq(struct urb *urb)
status = usb_submit_urb(urb, GFP_ATOMIC); status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0) if (status < 0)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"resubmit of audio urb failed (error=%i)\n", "resubmit of audio urb failed (error=%i)\n",
status); status);
return; return;
...@@ -185,7 +185,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev) ...@@ -185,7 +185,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC);
if (errCode) { if (errCode) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"submit of audio urb failed (error=%i)\n", "submit of audio urb failed (error=%i)\n",
errCode); errCode);
em28xx_deinit_isoc_audio(dev); em28xx_deinit_isoc_audio(dev);
...@@ -322,7 +322,7 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) ...@@ -322,7 +322,7 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
err: err:
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"Error while configuring em28xx mixer\n"); "Error while configuring em28xx mixer\n");
return ret; return ret;
} }
...@@ -761,7 +761,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) ...@@ -761,7 +761,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
intf = usb_ifnum_to_if(dev->udev, dev->ifnum); intf = usb_ifnum_to_if(dev->udev, dev->ifnum);
if (intf->num_altsetting <= alt) { 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); dev->ifnum, alt);
return -ENODEV; return -ENODEV;
} }
...@@ -777,14 +777,14 @@ static int em28xx_audio_urb_init(struct em28xx *dev) ...@@ -777,14 +777,14 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
} }
if (!ep) { 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; return -ENODEV;
} }
ep_size = em28xx_audio_ep_packet_size(dev->udev, ep); ep_size = em28xx_audio_ep_packet_size(dev->udev, ep);
interval = 1 << (ep->bInterval - 1); 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", "Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n",
EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed), EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed),
dev->ifnum, alt, interval, ep_size); dev->ifnum, alt, interval, ep_size);
...@@ -824,7 +824,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) ...@@ -824,7 +824,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
if (urb_size > ep_size * npackets) if (urb_size > ep_size * npackets)
npackets = DIV_ROUND_UP(urb_size, ep_size); 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", "Number of URBs: %d, with %d packets and %d size\n",
num_urb, npackets, urb_size); num_urb, npackets, urb_size);
...@@ -863,7 +863,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) ...@@ -863,7 +863,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev)
buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC, buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC,
&urb->transfer_dma); &urb->transfer_dma);
if (!buf) { if (!buf) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"usb_alloc_coherent failed!\n"); "usb_alloc_coherent failed!\n");
em28xx_audio_free_urb(dev); em28xx_audio_free_urb(dev);
return -ENOMEM; return -ENOMEM;
...@@ -904,16 +904,16 @@ static int em28xx_audio_init(struct em28xx *dev) ...@@ -904,16 +904,16 @@ static int em28xx_audio_init(struct em28xx *dev)
return 0; return 0;
} }
dev_info(&dev->udev->dev, "Binding audio extension\n"); dev_info(&dev->intf->dev, "Binding audio extension\n");
kref_get(&dev->ref); kref_get(&dev->ref);
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n"); "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"); "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); THIS_MODULE, 0, &card);
if (err < 0) if (err < 0)
return err; return err;
...@@ -961,7 +961,7 @@ static int em28xx_audio_init(struct em28xx *dev) ...@@ -961,7 +961,7 @@ static int em28xx_audio_init(struct em28xx *dev)
if (err < 0) if (err < 0)
goto urb_free; 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; return 0;
urb_free: urb_free:
...@@ -986,7 +986,7 @@ static int em28xx_audio_fini(struct em28xx *dev) ...@@ -986,7 +986,7 @@ static int em28xx_audio_fini(struct em28xx *dev)
return 0; return 0;
} }
dev_info(&dev->udev->dev, "Closing audio extension\n"); dev_info(&dev->intf->dev, "Closing audio extension\n");
if (dev->adev.sndcard) { if (dev->adev.sndcard) {
snd_card_disconnect(dev->adev.sndcard); snd_card_disconnect(dev->adev.sndcard);
...@@ -1010,7 +1010,7 @@ static int em28xx_audio_suspend(struct em28xx *dev) ...@@ -1010,7 +1010,7 @@ static int em28xx_audio_suspend(struct em28xx *dev)
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0; 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); em28xx_deinit_isoc_audio(dev);
atomic_set(&dev->adev.stream_started, 0); atomic_set(&dev->adev.stream_started, 0);
return 0; return 0;
...@@ -1024,7 +1024,7 @@ static int em28xx_audio_resume(struct em28xx *dev) ...@@ -1024,7 +1024,7 @@ static int em28xx_audio_resume(struct em28xx *dev)
if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR)
return 0; 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() ?? */ /* Nothing to do other than schedule_work() ?? */
schedule_work(&dev->adev.wq_trigger); schedule_work(&dev->adev.wq_trigger);
return 0; return 0;
......
...@@ -121,14 +121,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ...@@ -121,14 +121,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev)
ret = i2c_master_send(&client, &reg, 1); ret = i2c_master_send(&client, &reg, 1);
if (ret < 0) { if (ret < 0) {
if (ret != -ENXIO) if (ret != -ENXIO)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
} }
ret = i2c_master_recv(&client, (u8 *)&id_be, 2); ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
...@@ -138,14 +138,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ...@@ -138,14 +138,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev)
reg = 0xff; reg = 0xff;
ret = i2c_master_send(&client, &reg, 1); ret = i2c_master_send(&client, &reg, 1);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
} }
ret = i2c_master_recv(&client, (u8 *)&id_be, 2); ret = i2c_master_recv(&client, (u8 *)&id_be, 2);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
...@@ -185,16 +185,16 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) ...@@ -185,16 +185,16 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev)
dev->em28xx_sensor = EM28XX_MT9M001; dev->em28xx_sensor = EM28XX_MT9M001;
break; break;
default: default:
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"unknown Micron sensor detected: 0x%04x\n", id); "unknown Micron sensor detected: 0x%04x\n", id);
return 0; return 0;
} }
if (dev->em28xx_sensor == EM28XX_NOSENSOR) if (dev->em28xx_sensor == EM28XX_NOSENSOR)
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"unsupported sensor detected: %s\n", name); "unsupported sensor detected: %s\n", name);
else else
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"sensor %s detected\n", name); "sensor %s detected\n", name);
dev->i2c_client[dev->def_i2c_bus].addr = client.addr; dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
...@@ -225,7 +225,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ...@@ -225,7 +225,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
ret = i2c_smbus_read_byte_data(&client, reg); ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) { if (ret < 0) {
if (ret != -ENXIO) if (ret != -ENXIO)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
...@@ -234,7 +234,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ...@@ -234,7 +234,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
reg = 0x1d; reg = 0x1d;
ret = i2c_smbus_read_byte_data(&client, reg); ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
...@@ -247,7 +247,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ...@@ -247,7 +247,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
reg = 0x0a; reg = 0x0a;
ret = i2c_smbus_read_byte_data(&client, reg); ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
...@@ -256,7 +256,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ...@@ -256,7 +256,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
reg = 0x0b; reg = 0x0b;
ret = i2c_smbus_read_byte_data(&client, reg); ret = i2c_smbus_read_byte_data(&client, reg);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"couldn't read from i2c device 0x%02x: error %i\n", "couldn't read from i2c device 0x%02x: error %i\n",
client.addr << 1, ret); client.addr << 1, ret);
continue; continue;
...@@ -296,17 +296,17 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) ...@@ -296,17 +296,17 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev)
name = "OV9655"; name = "OV9655";
break; break;
default: default:
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"unknown OmniVision sensor detected: 0x%04x\n", "unknown OmniVision sensor detected: 0x%04x\n",
id); id);
return 0; return 0;
} }
if (dev->em28xx_sensor == EM28XX_NOSENSOR) if (dev->em28xx_sensor == EM28XX_NOSENSOR)
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"unsupported sensor detected: %s\n", name); "unsupported sensor detected: %s\n", name);
else else
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"sensor %s detected\n", name); "sensor %s detected\n", name);
dev->i2c_client[dev->def_i2c_bus].addr = client.addr; dev->i2c_client[dev->def_i2c_bus].addr = client.addr;
...@@ -331,7 +331,7 @@ int em28xx_detect_sensor(struct em28xx *dev) ...@@ -331,7 +331,7 @@ int em28xx_detect_sensor(struct em28xx *dev)
*/ */
if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) { if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) {
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"No sensor detected\n"); "No sensor detected\n");
return -ENODEV; return -ENODEV;
} }
......
...@@ -2677,7 +2677,7 @@ static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev, ...@@ -2677,7 +2677,7 @@ static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev,
msleep(50); 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; return -ETIMEDOUT;
} }
...@@ -2831,7 +2831,7 @@ static int em28xx_hint_board(struct em28xx *dev) ...@@ -2831,7 +2831,7 @@ static int em28xx_hint_board(struct em28xx *dev)
dev->model = em28xx_eeprom_hash[i].model; dev->model = em28xx_eeprom_hash[i].model;
dev->tuner_type = em28xx_eeprom_hash[i].tuner; 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" "Your board has no unique USB ID.\n"
"A hint were successfully done, based on eeprom hash.\n" "A hint were successfully done, based on eeprom hash.\n"
"This method is not 100%% failproof.\n" "This method is not 100%% failproof.\n"
...@@ -2861,7 +2861,7 @@ static int em28xx_hint_board(struct em28xx *dev) ...@@ -2861,7 +2861,7 @@ static int em28xx_hint_board(struct em28xx *dev)
if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { if (dev->i2c_hash == em28xx_i2c_hash[i].hash) {
dev->model = em28xx_i2c_hash[i].model; dev->model = em28xx_i2c_hash[i].model;
dev->tuner_type = em28xx_i2c_hash[i].tuner; 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" "Your board has no unique USB ID.\n"
"A hint were successfully done, based on i2c devicelist hash.\n" "A hint were successfully done, based on i2c devicelist hash.\n"
"This method is not 100%% failproof.\n" "This method is not 100%% failproof.\n"
...@@ -2874,7 +2874,7 @@ static int em28xx_hint_board(struct em28xx *dev) ...@@ -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" "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" "You may try to use card=<n> insmod option to workaround that.\n"
"Please send an email with this log to:\n" "Please send an email with this log to:\n"
...@@ -2883,10 +2883,10 @@ static int em28xx_hint_board(struct em28xx *dev) ...@@ -2883,10 +2883,10 @@ static int em28xx_hint_board(struct em28xx *dev)
"Board i2c devicelist hash is 0x%08lx\n", "Board i2c devicelist hash is 0x%08lx\n",
dev->hash, dev->i2c_hash); 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"); "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++) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
" card=%d -> %s\n", i, em28xx_boards[i].name); " card=%d -> %s\n", i, em28xx_boards[i].name);
} }
return -1; return -1;
...@@ -2921,7 +2921,7 @@ static void em28xx_card_setup(struct em28xx *dev) ...@@ -2921,7 +2921,7 @@ static void em28xx_card_setup(struct em28xx *dev)
* hash identities which has not been determined as yet. * hash identities which has not been determined as yet.
*/ */
if (em28xx_hint_board(dev) < 0) 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 { else {
em28xx_set_model(dev); em28xx_set_model(dev);
em28xx_pre_card_setup(dev); em28xx_pre_card_setup(dev);
...@@ -2931,7 +2931,7 @@ static void em28xx_card_setup(struct em28xx *dev) ...@@ -2931,7 +2931,7 @@ static void em28xx_card_setup(struct em28xx *dev)
em28xx_set_model(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->board.name, dev->model);
dev->tuner_type = em28xx_boards[dev->model].tuner_type; dev->tuner_type = em28xx_boards[dev->model].tuner_type;
...@@ -3030,7 +3030,7 @@ static void em28xx_card_setup(struct em28xx *dev) ...@@ -3030,7 +3030,7 @@ static void em28xx_card_setup(struct em28xx *dev)
} }
if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"\n\n" "\n\n"
"The support for this board weren't valid yet.\n" "The support for this board weren't valid yet.\n"
"Please send a report of having this working\n" "Please send a report of having this working\n"
...@@ -3161,7 +3161,7 @@ static int em28xx_media_device_init(struct em28xx *dev, ...@@ -3161,7 +3161,7 @@ static int em28xx_media_device_init(struct em28xx *dev,
else if (udev->manufacturer) else if (udev->manufacturer)
media_device_usb_init(mdev, udev, udev->manufacturer); media_device_usb_init(mdev, udev, udev->manufacturer);
else 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; dev->media_dev = mdev;
#endif #endif
...@@ -3217,7 +3217,7 @@ void em28xx_free_device(struct kref *ref) ...@@ -3217,7 +3217,7 @@ void em28xx_free_device(struct kref *ref)
{ {
struct em28xx *dev = kref_to_dev(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) if (!dev->disconnected)
em28xx_release_resources(dev); em28xx_release_resources(dev);
...@@ -3239,6 +3239,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, ...@@ -3239,6 +3239,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
const char *chip_name = NULL; const char *chip_name = NULL;
dev->udev = udev; dev->udev = udev;
dev->intf = interface;
mutex_init(&dev->ctrl_urb_lock); mutex_init(&dev->ctrl_urb_lock);
spin_lock_init(&dev->slock); spin_lock_init(&dev->slock);
...@@ -3324,10 +3325,10 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, ...@@ -3324,10 +3325,10 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
} }
} }
if (!chip_name) if (!chip_name)
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"unknown em28xx chip ID (%d)\n", dev->chip_id); "unknown em28xx chip ID (%d)\n", dev->chip_id);
else 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); em28xx_media_device_init(dev, udev);
...@@ -3346,7 +3347,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, ...@@ -3346,7 +3347,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
/* Resets I2C speed */ /* Resets I2C speed */
retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
if (retval < 0) { if (retval < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: em28xx_write_reg failed! retval [%d]\n", "%s: em28xx_write_reg failed! retval [%d]\n",
__func__, retval); __func__, retval);
return retval; return retval;
...@@ -3361,7 +3362,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, ...@@ -3361,7 +3362,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
else else
retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX); retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX);
if (retval < 0) { if (retval < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: em28xx_i2c_register bus 0 - error [%d]!\n", "%s: em28xx_i2c_register bus 0 - error [%d]!\n",
__func__, retval); __func__, retval);
return retval; return retval;
...@@ -3376,7 +3377,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, ...@@ -3376,7 +3377,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
retval = em28xx_i2c_register(dev, 1, retval = em28xx_i2c_register(dev, 1,
EM28XX_I2C_ALGO_EM28XX); EM28XX_I2C_ALGO_EM28XX);
if (retval < 0) { if (retval < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: em28xx_i2c_register bus 1 - error [%d]!\n", "%s: em28xx_i2c_register bus 1 - error [%d]!\n",
__func__, retval); __func__, retval);
...@@ -3417,7 +3418,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3417,7 +3418,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 */
dev_err(&udev->dev, dev_err(&interface->dev,
"Driver supports up to %i em28xx boards.\n", "Driver supports up to %i em28xx boards.\n",
EM28XX_MAXBOARDS); EM28XX_MAXBOARDS);
retval = -ENOMEM; retval = -ENOMEM;
...@@ -3427,7 +3428,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3427,7 +3428,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) {
dev_err(&udev->dev, dev_err(&interface->dev,
"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),
...@@ -3488,7 +3489,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3488,7 +3489,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 {
dev_err(&udev->dev, dev_err(&interface->dev,
"error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); "error: skipping audio endpoint 0x83, because it uses bulk transfers !\n");
} }
break; break;
...@@ -3562,7 +3563,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3562,7 +3563,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
speed = "unknown"; speed = "unknown";
} }
dev_err(&udev->dev, dev_err(&interface->dev,
"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 : "",
...@@ -3578,8 +3579,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3578,8 +3579,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) {
dev_err(&udev->dev, "Device initialization failed.\n"); dev_err(&interface->dev, "Device initialization failed.\n");
dev_err(&udev->dev, dev_err(&interface->dev,
"Device must be connected to a high-speed USB 2.0 port.\n"); "Device must be connected to a high-speed USB 2.0 port.\n");
retval = -ENODEV; retval = -ENODEV;
goto err_free; goto err_free;
...@@ -3593,7 +3594,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3593,7 +3594,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
dev->ifnum = ifnum; dev->ifnum = ifnum;
if (has_vendor_audio) { if (has_vendor_audio) {
dev_err(&udev->dev, dev_err(&interface->dev,
"Audio interface %i found (Vendor Class)\n", ifnum); "Audio interface %i found (Vendor Class)\n", ifnum);
dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR;
} }
...@@ -3603,7 +3604,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3603,7 +3604,7 @@ static int em28xx_usb_probe(struct usb_interface *interface,
if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) {
if (has_vendor_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" "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"); "\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; dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS;
...@@ -3612,12 +3613,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3612,12 +3613,12 @@ static int em28xx_usb_probe(struct usb_interface *interface,
} }
if (has_video) 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, 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)
dev_err(&udev->dev, "DVB interface %i found:%s%s\n", dev_err(&interface->dev, "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" : "");
...@@ -3649,7 +3650,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3649,7 +3650,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) {
dev_err(&udev->dev, dev_err(&interface->dev,
"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;
...@@ -3659,13 +3660,13 @@ static int em28xx_usb_probe(struct usb_interface *interface, ...@@ -3659,13 +3660,13 @@ static int em28xx_usb_probe(struct usb_interface *interface,
if (has_video) { if (has_video) {
if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk))
dev->analog_xfer_bulk = 1; 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"); dev->analog_xfer_bulk ? "bulk" : "isoc");
} }
if (has_dvb) { if (has_dvb) {
if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk))
dev->dvb_xfer_bulk = 1; 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"); dev->dvb_xfer_bulk ? "bulk" : "isoc");
} }
...@@ -3713,7 +3714,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) ...@@ -3713,7 +3714,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface)
dev->disconnected = 1; dev->disconnected = 1;
dev_err(&dev->udev->dev, "Disconnecting\n"); dev_err(&dev->intf->dev, "Disconnecting\n");
flush_request_modules(dev); flush_request_modules(dev);
......
...@@ -52,7 +52,7 @@ MODULE_PARM_DESC(core_debug, "enable debug messages [core and isoc]"); ...@@ -52,7 +52,7 @@ 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) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"core: %s: " fmt, __func__, ## arg); \ "core: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
...@@ -63,14 +63,14 @@ MODULE_PARM_DESC(reg_debug, "enable debug messages [URB reg]"); ...@@ -63,14 +63,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) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"reg: %s: " fmt, __func__, ## arg); \ "reg: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
/* FIXME: don't abuse core_debug */ /* FIXME: don't abuse core_debug */
#define em28xx_isocdbg(fmt, arg...) do { \ #define em28xx_isocdbg(fmt, arg...) do { \
if (core_debug) \ if (core_debug) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"core: %s: " fmt, __func__, ## arg); \ "core: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
...@@ -258,7 +258,7 @@ static int em28xx_is_ac97_ready(struct em28xx *dev) ...@@ -258,7 +258,7 @@ static int em28xx_is_ac97_ready(struct em28xx *dev)
msleep(5); msleep(5);
} }
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"AC97 command still being executed: not handled properly!\n"); "AC97 command still being executed: not handled properly!\n");
return -EBUSY; return -EBUSY;
} }
...@@ -352,7 +352,7 @@ static int set_ac97_input(struct em28xx *dev) ...@@ -352,7 +352,7 @@ static int set_ac97_input(struct em28xx *dev)
ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000);
if (ret < 0) if (ret < 0)
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"couldn't setup AC97 register %d\n", "couldn't setup AC97 register %d\n",
inputs[i].reg); inputs[i].reg);
} }
...@@ -437,7 +437,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) ...@@ -437,7 +437,7 @@ int em28xx_audio_analog_set(struct em28xx *dev)
for (i = 0; i < ARRAY_SIZE(outputs); i++) { for (i = 0; i < ARRAY_SIZE(outputs); i++) {
ret = em28xx_write_ac97(dev, outputs[i].reg, 0x8000); ret = em28xx_write_ac97(dev, outputs[i].reg, 0x8000);
if (ret < 0) if (ret < 0)
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"couldn't setup AC97 register %d\n", "couldn't setup AC97 register %d\n",
outputs[i].reg); outputs[i].reg);
} }
...@@ -476,7 +476,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) ...@@ -476,7 +476,7 @@ int em28xx_audio_analog_set(struct em28xx *dev)
ret = em28xx_write_ac97(dev, outputs[i].reg, ret = em28xx_write_ac97(dev, outputs[i].reg,
vol); vol);
if (ret < 0) if (ret < 0)
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"couldn't setup AC97 register %d\n", "couldn't setup AC97 register %d\n",
outputs[i].reg); outputs[i].reg);
} }
...@@ -514,7 +514,7 @@ int em28xx_audio_setup(struct em28xx *dev) ...@@ -514,7 +514,7 @@ int em28xx_audio_setup(struct em28xx *dev)
/* See how this device is configured */ /* See how this device is configured */
cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG); 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 */ if (cfg < 0) { /* Register read error */
/* Be conservative */ /* Be conservative */
dev->int_audio_type = EM28XX_INT_AUDIO_AC97; dev->int_audio_type = EM28XX_INT_AUDIO_AC97;
...@@ -535,7 +535,7 @@ int em28xx_audio_setup(struct em28xx *dev) ...@@ -535,7 +535,7 @@ int em28xx_audio_setup(struct em28xx *dev)
i2s_samplerates = 5; i2s_samplerates = 5;
else else
i2s_samplerates = 3; 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); i2s_samplerates);
/* Skip the code that does AC97 vendor detection */ /* Skip the code that does AC97 vendor detection */
dev->audio_mode.ac97 = EM28XX_NO_AC97; dev->audio_mode.ac97 = EM28XX_NO_AC97;
...@@ -553,7 +553,7 @@ int em28xx_audio_setup(struct em28xx *dev) ...@@ -553,7 +553,7 @@ int em28xx_audio_setup(struct em28xx *dev)
* Note: (some) em2800 devices without eeprom reports 0x91 on * Note: (some) em2800 devices without eeprom reports 0x91 on
* CHIPCFG register, even not having an AC97 chip * 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"); "AC97 chip type couldn't be determined\n");
dev->audio_mode.ac97 = EM28XX_NO_AC97; dev->audio_mode.ac97 = EM28XX_NO_AC97;
if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR) if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR)
...@@ -567,13 +567,13 @@ int em28xx_audio_setup(struct em28xx *dev) ...@@ -567,13 +567,13 @@ int em28xx_audio_setup(struct em28xx *dev)
goto init_audio; goto init_audio;
vid = vid1 << 16 | vid2; 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); feat = em28xx_read_ac97(dev, AC97_RESET);
if (feat < 0) if (feat < 0)
goto init_audio; 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 */ /* Try to identify what audio processor we have */
if (((vid == 0xffffffff) || (vid == 0x83847650)) && (feat == 0x6a90)) if (((vid == 0xffffffff) || (vid == 0x83847650)) && (feat == 0x6a90))
...@@ -585,19 +585,19 @@ int em28xx_audio_setup(struct em28xx *dev) ...@@ -585,19 +585,19 @@ int em28xx_audio_setup(struct em28xx *dev)
/* Reports detected AC97 processor */ /* Reports detected AC97 processor */
switch (dev->audio_mode.ac97) { switch (dev->audio_mode.ac97) {
case EM28XX_NO_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; break;
case EM28XX_AC97_EM202: case EM28XX_AC97_EM202:
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"Empia 202 AC97 audio processor detected\n"); "Empia 202 AC97 audio processor detected\n");
break; break;
case EM28XX_AC97_SIGMATEL: case EM28XX_AC97_SIGMATEL:
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"Sigmatel audio processor detected (stac 97%02x)\n", "Sigmatel audio processor detected (stac 97%02x)\n",
vid & 0xff); vid & 0xff);
break; break;
case EM28XX_AC97_OTHER: case EM28XX_AC97_OTHER:
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"Unknown AC97 audio processor detected!\n"); "Unknown AC97 audio processor detected!\n");
break; break;
default: default:
...@@ -882,7 +882,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, ...@@ -882,7 +882,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk,
if (mode == EM28XX_DIGITAL_MODE) { if (mode == EM28XX_DIGITAL_MODE) {
if ((xfer_bulk && !dev->dvb_ep_bulk) || if ((xfer_bulk && !dev->dvb_ep_bulk) ||
(!xfer_bulk && !dev->dvb_ep_isoc)) { (!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", "no endpoint for DVB mode and transfer type %d\n",
xfer_bulk > 0); xfer_bulk > 0);
return -EINVAL; return -EINVAL;
...@@ -891,14 +891,14 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, ...@@ -891,14 +891,14 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk,
} else if (mode == EM28XX_ANALOG_MODE) { } else if (mode == EM28XX_ANALOG_MODE) {
if ((xfer_bulk && !dev->analog_ep_bulk) || if ((xfer_bulk && !dev->analog_ep_bulk) ||
(!xfer_bulk && !dev->analog_ep_isoc)) { (!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", "no endpoint for analog mode and transfer type %d\n",
xfer_bulk > 0); xfer_bulk > 0);
return -EINVAL; return -EINVAL;
} }
usb_bufs = &dev->usb_ctl.analog_bufs; usb_bufs = &dev->usb_ctl.analog_bufs;
} else { } else {
dev_err(&dev->udev->dev, "invalid mode selected\n"); dev_err(&dev->intf->dev, "invalid mode selected\n");
return -EINVAL; return -EINVAL;
} }
...@@ -940,7 +940,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, ...@@ -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, usb_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev,
sb_size, GFP_KERNEL, &urb->transfer_dma); sb_size, GFP_KERNEL, &urb->transfer_dma);
if (!usb_bufs->transfer_buffer[i]) { 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", "unable to allocate %i bytes for transfer buffer %i%s\n",
sb_size, i, sb_size, i,
in_interrupt() ? " while in int" : ""); in_interrupt() ? " while in int" : "");
...@@ -1023,7 +1023,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode, ...@@ -1023,7 +1023,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode,
if (xfer_bulk) { if (xfer_bulk) {
rc = usb_clear_halt(dev->udev, usb_bufs->urb[0]->pipe); rc = usb_clear_halt(dev->udev, usb_bufs->urb[0]->pipe);
if (rc < 0) { 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", "failed to clear USB bulk endpoint stall/halt condition (error=%i)\n",
rc); rc);
em28xx_uninit_usb_xfer(dev, mode); em28xx_uninit_usb_xfer(dev, mode);
...@@ -1040,7 +1040,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode 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++) { 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) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"submit of urb %i failed (error=%i)\n", i, rc); "submit of urb %i failed (error=%i)\n", i, rc);
em28xx_uninit_usb_xfer(dev, mode); em28xx_uninit_usb_xfer(dev, mode);
return rc; return rc;
...@@ -1123,7 +1123,7 @@ int em28xx_suspend_extension(struct em28xx *dev) ...@@ -1123,7 +1123,7 @@ int em28xx_suspend_extension(struct em28xx *dev)
{ {
const struct em28xx_ops *ops = NULL; 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); mutex_lock(&em28xx_devlist_mutex);
list_for_each_entry(ops, &em28xx_extension_devlist, next) { list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->suspend) if (ops->suspend)
...@@ -1137,7 +1137,7 @@ int em28xx_resume_extension(struct em28xx *dev) ...@@ -1137,7 +1137,7 @@ int em28xx_resume_extension(struct em28xx *dev)
{ {
const struct em28xx_ops *ops = NULL; 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); mutex_lock(&em28xx_devlist_mutex);
list_for_each_entry(ops, &em28xx_extension_devlist, next) { list_for_each_entry(ops, &em28xx_extension_devlist, next) {
if (ops->resume) if (ops->resume)
......
...@@ -75,7 +75,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); ...@@ -75,7 +75,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
#define dprintk(level, fmt, arg...) do { \ #define dprintk(level, fmt, arg...) do { \
if (debug >= level) \ if (debug >= level) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"dvb: " fmt, ## arg); \ "dvb: " fmt, ## arg); \
} while (0) } while (0)
...@@ -736,13 +736,13 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe) ...@@ -736,13 +736,13 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe)
ret = gpio_request_one(dvb->lna_gpio, flags, NULL); ret = gpio_request_one(dvb->lna_gpio, flags, NULL);
if (ret) 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 else
gpio_free(dvb->lna_gpio); gpio_free(dvb->lna_gpio);
return ret; return ret;
#else #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); KBUILD_MODNAME, c->lna);
return 0; return 0;
#endif #endif
...@@ -936,20 +936,20 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) ...@@ -936,20 +936,20 @@ 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]) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"dvb frontend not attached. Can't attach xc3028\n"); "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) {
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]); dvb_frontend_detach(dev->dvb->fe[0]);
dev->dvb->fe[0] = NULL; dev->dvb->fe[0] = NULL;
return -EINVAL; return -EINVAL;
} }
dev_info(&dev->udev->dev, "xc3028 attached\n"); dev_info(&dev->intf->dev, "xc3028 attached\n");
return 0; return 0;
} }
...@@ -966,10 +966,10 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -966,10 +966,10 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
/* register adapter */ /* register adapter */
result = dvb_register_adapter(&dvb->adapter, result = dvb_register_adapter(&dvb->adapter,
dev_name(&dev->udev->dev), module, dev_name(&dev->intf->dev), module,
device, adapter_nr); device, adapter_nr);
if (result < 0) { if (result < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"dvb_register_adapter failed (errno = %d)\n", "dvb_register_adapter failed (errno = %d)\n",
result); result);
goto fail_adapter; goto fail_adapter;
...@@ -988,7 +988,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -988,7 +988,7 @@ 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) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"dvb_register_frontend failed (errno = %d)\n", "dvb_register_frontend failed (errno = %d)\n",
result); result);
goto fail_frontend0; goto fail_frontend0;
...@@ -998,7 +998,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -998,7 +998,7 @@ 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) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"2nd dvb_register_frontend failed (errno = %d)\n", "2nd dvb_register_frontend failed (errno = %d)\n",
result); result);
goto fail_frontend1; goto fail_frontend1;
...@@ -1017,7 +1017,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -1017,7 +1017,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) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"dvb_dmx_init failed (errno = %d)\n", "dvb_dmx_init failed (errno = %d)\n",
result); result);
goto fail_dmx; goto fail_dmx;
...@@ -1028,7 +1028,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -1028,7 +1028,7 @@ 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) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"dvb_dmxdev_init failed (errno = %d)\n", "dvb_dmxdev_init failed (errno = %d)\n",
result); result);
goto fail_dmxdev; goto fail_dmxdev;
...@@ -1037,7 +1037,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -1037,7 +1037,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
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) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", "add_frontend failed (DMX_FRONTEND_0, errno = %d)\n",
result); result);
goto fail_fe_hw; goto fail_fe_hw;
...@@ -1046,7 +1046,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -1046,7 +1046,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module,
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) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", "add_frontend failed (DMX_MEMORY_FE, errno = %d)\n",
result); result);
goto fail_fe_mem; goto fail_fe_mem;
...@@ -1054,7 +1054,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, ...@@ -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); result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw);
if (result < 0) { if (result < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"connect_frontend failed (errno = %d)\n", "connect_frontend failed (errno = %d)\n",
result); result);
goto fail_fe_conn; goto fail_fe_conn;
...@@ -1128,7 +1128,7 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1128,7 +1128,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
return 0; 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); dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL);
if (!dvb) if (!dvb)
...@@ -1152,7 +1152,7 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1152,7 +1152,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
EM28XX_DVB_NUM_ISOC_PACKETS); EM28XX_DVB_NUM_ISOC_PACKETS);
} }
if (result) { if (result) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to pre-allocate USB transfer buffers for DVB.\n"); "failed to pre-allocate USB transfer buffers for DVB.\n");
kfree(dvb); kfree(dvb);
dev->dvb = NULL; dev->dvb = NULL;
...@@ -1270,7 +1270,8 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1270,7 +1270,8 @@ static int em28xx_dvb_init(struct em28xx *dev)
case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2:
case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E: case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E:
dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL, 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],
&dev->intf->dev);
if (em28xx_attach_xc3028(0x61, dev) < 0) { if (em28xx_attach_xc3028(0x61, dev) < 0) {
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
...@@ -1332,7 +1333,7 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1332,7 +1333,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
result = gpio_request_one(dvb->lna_gpio, result = gpio_request_one(dvb->lna_gpio,
GPIOF_OUT_INIT_LOW, NULL); GPIOF_OUT_INIT_LOW, NULL);
if (result) if (result)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"gpio request failed %d\n", "gpio request failed %d\n",
result); result);
else else
...@@ -1949,12 +1950,12 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1949,12 +1950,12 @@ static int em28xx_dvb_init(struct em28xx *dev)
} }
break; break;
default: default:
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"The frontend of your DVB/ATSC card isn't supported yet\n"); "The frontend of your DVB/ATSC card isn't supported yet\n");
break; break;
} }
if (NULL == dvb->fe[0]) { if (NULL == dvb->fe[0]) {
dev_err(&dev->udev->dev, "frontend initialization failed\n"); dev_err(&dev->intf->dev, "frontend initialization failed\n");
result = -EINVAL; result = -EINVAL;
goto out_free; goto out_free;
} }
...@@ -1964,12 +1965,12 @@ static int em28xx_dvb_init(struct em28xx *dev) ...@@ -1964,12 +1965,12 @@ static int em28xx_dvb_init(struct em28xx *dev)
dvb->fe[1]->callback = em28xx_tuner_callback; dvb->fe[1]->callback = em28xx_tuner_callback;
/* register everything */ /* register everything */
result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev); result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->intf->dev);
if (result < 0) if (result < 0)
goto out_free; goto out_free;
dev_info(&dev->udev->dev, "DVB extension successfully initialized\n"); dev_info(&dev->intf->dev, "DVB extension successfully initialized\n");
kref_get(&dev->ref); kref_get(&dev->ref);
...@@ -2009,7 +2010,7 @@ static int em28xx_dvb_fini(struct em28xx *dev) ...@@ -2009,7 +2010,7 @@ static int em28xx_dvb_fini(struct em28xx *dev)
if (!dev->dvb) if (!dev->dvb)
return 0; return 0;
dev_info(&dev->udev->dev, "Closing DVB extension\n"); dev_info(&dev->intf->dev, "Closing DVB extension\n");
dvb = dev->dvb; dvb = dev->dvb;
...@@ -2067,17 +2068,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev) ...@@ -2067,17 +2068,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev)
if (!dev->board.has_dvb) if (!dev->board.has_dvb)
return 0; return 0;
dev_info(&dev->udev->dev, "Suspending DVB extension\n"); dev_info(&dev->intf->dev, "Suspending DVB extension\n");
if (dev->dvb) { if (dev->dvb) {
struct em28xx_dvb *dvb = dev->dvb; struct em28xx_dvb *dvb = dev->dvb;
if (dvb->fe[0]) { if (dvb->fe[0]) {
ret = dvb_frontend_suspend(dvb->fe[0]); ret = dvb_frontend_suspend(dvb->fe[0]);
dev_info(&dev->udev->dev, "fe0 suspend %d\n", ret); dev_info(&dev->intf->dev, "fe0 suspend %d\n", ret);
} }
if (dvb->fe[1]) { if (dvb->fe[1]) {
dvb_frontend_suspend(dvb->fe[1]); dvb_frontend_suspend(dvb->fe[1]);
dev_info(&dev->udev->dev, "fe1 suspend %d\n", ret); dev_info(&dev->intf->dev, "fe1 suspend %d\n", ret);
} }
} }
...@@ -2094,18 +2095,18 @@ static int em28xx_dvb_resume(struct em28xx *dev) ...@@ -2094,18 +2095,18 @@ static int em28xx_dvb_resume(struct em28xx *dev)
if (!dev->board.has_dvb) if (!dev->board.has_dvb)
return 0; return 0;
dev_info(&dev->udev->dev, "Resuming DVB extension\n"); dev_info(&dev->intf->dev, "Resuming DVB extension\n");
if (dev->dvb) { if (dev->dvb) {
struct em28xx_dvb *dvb = dev->dvb; struct em28xx_dvb *dvb = dev->dvb;
if (dvb->fe[0]) { if (dvb->fe[0]) {
ret = dvb_frontend_resume(dvb->fe[0]); ret = dvb_frontend_resume(dvb->fe[0]);
dev_info(&dev->udev->dev, "fe0 resume %d\n", ret); dev_info(&dev->intf->dev, "fe0 resume %d\n", ret);
} }
if (dvb->fe[1]) { if (dvb->fe[1]) {
ret = dvb_frontend_resume(dvb->fe[1]); ret = dvb_frontend_resume(dvb->fe[1]);
dev_info(&dev->udev->dev, "fe1 resume %d\n", ret); dev_info(&dev->intf->dev, "fe1 resume %d\n", ret);
} }
} }
......
...@@ -46,7 +46,7 @@ MODULE_PARM_DESC(i2c_debug, "i2c debug message level (1: normal debug, 2: show I ...@@ -46,7 +46,7 @@ MODULE_PARM_DESC(i2c_debug, "i2c debug message level (1: normal debug, 2: show I
#define dprintk(level, fmt, arg...) do { \ #define dprintk(level, fmt, arg...) do { \
if (i2c_debug > level) \ if (i2c_debug > level) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"i2c: %s: " fmt, __func__, ## arg); \ "i2c: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
...@@ -78,7 +78,7 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -78,7 +78,7 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
/* trigger write */ /* trigger write */
ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len); ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len);
if (ret != 2 + len) { if (ret != 2 + len) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"failed to trigger write to i2c address 0x%x (error=%i)\n", "failed to trigger write to i2c address 0x%x (error=%i)\n",
addr, ret); addr, ret);
return (ret < 0) ? ret : -EIO; return (ret < 0) ? ret : -EIO;
...@@ -93,7 +93,7 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -93,7 +93,7 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
return -ENXIO; return -ENXIO;
} }
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n", "failed to get i2c transfer status from bridge register (error=%i)\n",
ret); ret);
return ret; return ret;
...@@ -123,7 +123,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -123,7 +123,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
buf2[0] = addr; buf2[0] = addr;
ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2); ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2);
if (ret != 2) { if (ret != 2) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"failed to trigger read from i2c address 0x%x (error=%i)\n", "failed to trigger read from i2c address 0x%x (error=%i)\n",
addr, ret); addr, ret);
return (ret < 0) ? ret : -EIO; return (ret < 0) ? ret : -EIO;
...@@ -140,7 +140,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -140,7 +140,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
return -ENXIO; return -ENXIO;
} }
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n", "failed to get i2c transfer status from bridge register (error=%i)\n",
ret); ret);
return ret; return ret;
...@@ -154,7 +154,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) ...@@ -154,7 +154,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len)
/* get the received message */ /* get the received message */
ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len); ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len);
if (ret != len) { if (ret != len) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n", "reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n",
addr, ret); addr, ret);
return (ret < 0) ? ret : -EIO; return (ret < 0) ? ret : -EIO;
...@@ -200,12 +200,12 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, ...@@ -200,12 +200,12 @@ 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); ret = dev->em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len);
if (ret != len) { if (ret != len) {
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"writing to i2c device at 0x%x failed (error=%i)\n", "writing to i2c device at 0x%x failed (error=%i)\n",
addr, ret); addr, ret);
return ret; return ret;
} else { } else {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", "%i bytes write to i2c device at 0x%x requested, but %i bytes written\n",
len, addr, ret); len, addr, ret);
return -EIO; return -EIO;
...@@ -223,7 +223,7 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, ...@@ -223,7 +223,7 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
return -ENXIO; return -ENXIO;
} }
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n", "failed to get i2c transfer status from bridge register (error=%i)\n",
ret); ret);
return ret; return ret;
...@@ -244,7 +244,7 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, ...@@ -244,7 +244,7 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
return -ETIMEDOUT; return -ETIMEDOUT;
} }
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"write to i2c device at 0x%x failed with unknown error (status=%i)\n", "write to i2c device at 0x%x failed with unknown error (status=%i)\n",
addr, ret); addr, ret);
return -EIO; return -EIO;
...@@ -268,7 +268,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) ...@@ -268,7 +268,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len)
/* Read data from i2c device */ /* Read data from i2c device */
ret = dev->em28xx_read_reg_req_len(dev, 2, addr, buf, len); ret = dev->em28xx_read_reg_req_len(dev, 2, addr, buf, len);
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"reading from i2c device at 0x%x failed (error=%i)\n", "reading from i2c device at 0x%x failed (error=%i)\n",
addr, ret); addr, ret);
return ret; return ret;
...@@ -287,7 +287,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) ...@@ -287,7 +287,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len)
if (ret == 0) /* success */ if (ret == 0) /* success */
return len; return len;
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"failed to get i2c transfer status from bridge register (error=%i)\n", "failed to get i2c transfer status from bridge register (error=%i)\n",
ret); ret);
return ret; return ret;
...@@ -306,7 +306,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) ...@@ -306,7 +306,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len)
return -ETIMEDOUT; return -ETIMEDOUT;
} }
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"write to i2c device at 0x%x failed with unknown error (status=%i)\n", "write to i2c device at 0x%x failed with unknown error (status=%i)\n",
addr, ret); addr, ret);
return -EIO; return -EIO;
...@@ -347,12 +347,12 @@ static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, ...@@ -347,12 +347,12 @@ static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf,
ret = dev->em28xx_write_regs_req(dev, 0x06, addr, buf, len); ret = dev->em28xx_write_regs_req(dev, 0x06, addr, buf, len);
if (ret != len) { if (ret != len) {
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"writing to i2c device at 0x%x failed (error=%i)\n", "writing to i2c device at 0x%x failed (error=%i)\n",
addr, ret); addr, ret);
return ret; return ret;
} else { } else {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", "%i bytes write to i2c device at 0x%x requested, but %i bytes written\n",
len, addr, ret); len, addr, ret);
return -EIO; return -EIO;
...@@ -398,7 +398,7 @@ static int em25xx_bus_B_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, ...@@ -398,7 +398,7 @@ static int em25xx_bus_B_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf,
/* Read value */ /* Read value */
ret = dev->em28xx_read_reg_req_len(dev, 0x06, addr, buf, len); ret = dev->em28xx_read_reg_req_len(dev, 0x06, addr, buf, len);
if (ret < 0) { if (ret < 0) {
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"reading from i2c device at 0x%x failed (error=%i)\n", "reading from i2c device at 0x%x failed (error=%i)\n",
addr, ret); addr, ret);
return ret; return ret;
...@@ -672,7 +672,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -672,7 +672,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
/* Check if board has eeprom */ /* Check if board has eeprom */
err = i2c_master_recv(&dev->i2c_client[bus], &buf, 0); err = i2c_master_recv(&dev->i2c_client[bus], &buf, 0);
if (err < 0) { if (err < 0) {
dev_info(&dev->udev->dev, "board has no eeprom\n"); dev_info(&dev->intf->dev, "board has no eeprom\n");
return -ENODEV; return -ENODEV;
} }
...@@ -685,7 +685,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -685,7 +685,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
dev->eeprom_addrwidth_16bit, dev->eeprom_addrwidth_16bit,
len, data); len, data);
if (err != len) { if (err != len) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to read eeprom (err=%d)\n", err); "failed to read eeprom (err=%d)\n", err);
goto error; goto error;
} }
...@@ -696,7 +696,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -696,7 +696,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
16, 1, data, len, true); 16, 1, data, len, true);
if (dev->eeprom_addrwidth_16bit) if (dev->eeprom_addrwidth_16bit)
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"eeprom %06x: ... (skipped)\n", 256); "eeprom %06x: ... (skipped)\n", 256);
} }
...@@ -709,12 +709,12 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -709,12 +709,12 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
dev->hash = em28xx_hash_mem(data, len, 32); dev->hash = em28xx_hash_mem(data, len, 32);
mc_start = (data[1] << 8) + 4; /* usually 0x0004 */ mc_start = (data[1] << 8) + 4; /* usually 0x0004 */
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n", "EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash); data[0], data[1], data[2], data[3], dev->hash);
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"EEPROM info:\n"); "EEPROM info:\n");
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"\tmicrocode start address = 0x%04x, boot configuration = 0x%02x\n", "\tmicrocode start address = 0x%04x, boot configuration = 0x%02x\n",
mc_start, data[2]); mc_start, data[2]);
/* /*
...@@ -734,7 +734,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -734,7 +734,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
err = em28xx_i2c_read_block(dev, bus, mc_start + 46, 1, 2, err = em28xx_i2c_read_block(dev, bus, mc_start + 46, 1, 2,
data); data);
if (err != 2) { if (err != 2) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to read hardware configuration data from eeprom (err=%d)\n", "failed to read hardware configuration data from eeprom (err=%d)\n",
err); err);
goto error; goto error;
...@@ -753,7 +753,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -753,7 +753,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
err = em28xx_i2c_read_block(dev, bus, hwconf_offset, 1, len, err = em28xx_i2c_read_block(dev, bus, hwconf_offset, 1, len,
data); data);
if (err != len) { if (err != len) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to read hardware configuration data from eeprom (err=%d)\n", "failed to read hardware configuration data from eeprom (err=%d)\n",
err); err);
goto error; goto error;
...@@ -763,7 +763,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -763,7 +763,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
/* NOTE: not all devices provide this type of dataset */ /* NOTE: not all devices provide this type of dataset */
if (data[0] != 0x1a || data[1] != 0xeb || if (data[0] != 0x1a || data[1] != 0xeb ||
data[2] != 0x67 || data[3] != 0x95) { data[2] != 0x67 || data[3] != 0x95) {
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"\tno hardware configuration dataset found in eeprom\n"); "\tno hardware configuration dataset found in eeprom\n");
kfree(data); kfree(data);
return 0; return 0;
...@@ -775,13 +775,13 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -775,13 +775,13 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
data[0] == 0x1a && data[1] == 0xeb && data[0] == 0x1a && data[1] == 0xeb &&
data[2] == 0x67 && data[3] == 0x95) { data[2] == 0x67 && data[3] == 0x95) {
dev->hash = em28xx_hash_mem(data, len, 32); dev->hash = em28xx_hash_mem(data, len, 32);
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n", "EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n",
data[0], data[1], data[2], data[3], dev->hash); data[0], data[1], data[2], data[3], dev->hash);
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"EEPROM info:\n"); "EEPROM info:\n");
} else { } else {
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"unknown eeprom format or eeprom corrupted !\n"); "unknown eeprom format or eeprom corrupted !\n");
err = -ENODEV; err = -ENODEV;
goto error; goto error;
...@@ -793,50 +793,50 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, ...@@ -793,50 +793,50 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus,
switch (le16_to_cpu(dev_config->chip_conf) >> 4 & 0x3) { switch (le16_to_cpu(dev_config->chip_conf) >> 4 & 0x3) {
case 0: case 0:
dev_info(&dev->udev->dev, "\tNo audio on board.\n"); dev_info(&dev->intf->dev, "\tNo audio on board.\n");
break; break;
case 1: case 1:
dev_info(&dev->udev->dev, "\tAC97 audio (5 sample rates)\n"); dev_info(&dev->intf->dev, "\tAC97 audio (5 sample rates)\n");
break; break;
case 2: case 2:
if (dev->chip_id < CHIP_ID_EM2860) if (dev->chip_id < CHIP_ID_EM2860)
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"\tI2S audio, sample rate=32k\n"); "\tI2S audio, sample rate=32k\n");
else else
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"\tI2S audio, 3 sample rates\n"); "\tI2S audio, 3 sample rates\n");
break; break;
case 3: case 3:
if (dev->chip_id < CHIP_ID_EM2860) if (dev->chip_id < CHIP_ID_EM2860)
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"\tI2S audio, 3 sample rates\n"); "\tI2S audio, 3 sample rates\n");
else else
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"\tI2S audio, 5 sample rates\n"); "\tI2S audio, 5 sample rates\n");
break; break;
} }
if (le16_to_cpu(dev_config->chip_conf) & 1 << 3) if (le16_to_cpu(dev_config->chip_conf) & 1 << 3)
dev_info(&dev->udev->dev, "\tUSB Remote wakeup capable\n"); dev_info(&dev->intf->dev, "\tUSB Remote wakeup capable\n");
if (le16_to_cpu(dev_config->chip_conf) & 1 << 2) if (le16_to_cpu(dev_config->chip_conf) & 1 << 2)
dev_info(&dev->udev->dev, "\tUSB Self power capable\n"); dev_info(&dev->intf->dev, "\tUSB Self power capable\n");
switch (le16_to_cpu(dev_config->chip_conf) & 0x3) { switch (le16_to_cpu(dev_config->chip_conf) & 0x3) {
case 0: case 0:
dev_info(&dev->udev->dev, "\t500mA max power\n"); dev_info(&dev->intf->dev, "\t500mA max power\n");
break; break;
case 1: case 1:
dev_info(&dev->udev->dev, "\t400mA max power\n"); dev_info(&dev->intf->dev, "\t400mA max power\n");
break; break;
case 2: case 2:
dev_info(&dev->udev->dev, "\t300mA max power\n"); dev_info(&dev->intf->dev, "\t300mA max power\n");
break; break;
case 3: case 3:
dev_info(&dev->udev->dev, "\t200mA max power\n"); dev_info(&dev->intf->dev, "\t200mA max power\n");
break; break;
} }
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"\tTable at offset 0x%02x, strings=0x%04x, 0x%04x, 0x%04x\n", "\tTable at offset 0x%02x, strings=0x%04x, 0x%04x, 0x%04x\n",
dev_config->string_idx_table, dev_config->string_idx_table,
le16_to_cpu(dev_config->string1), le16_to_cpu(dev_config->string1),
...@@ -930,7 +930,7 @@ void em28xx_do_i2c_scan(struct em28xx *dev, unsigned bus) ...@@ -930,7 +930,7 @@ void em28xx_do_i2c_scan(struct em28xx *dev, unsigned bus)
if (rc < 0) if (rc < 0)
continue; continue;
i2c_devicelist[i] = i; i2c_devicelist[i] = i;
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"found i2c device @ 0x%x on bus %d [%s]\n", "found i2c device @ 0x%x on bus %d [%s]\n",
i << 1, bus, i2c_devs[i] ? i2c_devs[i] : "???"); i << 1, bus, i2c_devs[i] ? i2c_devs[i] : "???");
} }
...@@ -956,8 +956,8 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus, ...@@ -956,8 +956,8 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus,
return -ENODEV; return -ENODEV;
dev->i2c_adap[bus] = em28xx_adap_template; dev->i2c_adap[bus] = em28xx_adap_template;
dev->i2c_adap[bus].dev.parent = &dev->udev->dev; dev->i2c_adap[bus].dev.parent = &dev->intf->dev;
strcpy(dev->i2c_adap[bus].name, dev_name(&dev->udev->dev)); strcpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev));
dev->i2c_bus[bus].bus = bus; dev->i2c_bus[bus].bus = bus;
dev->i2c_bus[bus].algo_type = algo_type; dev->i2c_bus[bus].algo_type = algo_type;
...@@ -966,7 +966,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus, ...@@ -966,7 +966,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus,
retval = i2c_add_adapter(&dev->i2c_adap[bus]); retval = i2c_add_adapter(&dev->i2c_adap[bus]);
if (retval < 0) { if (retval < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: i2c_add_adapter failed! retval [%d]\n", "%s: i2c_add_adapter failed! retval [%d]\n",
__func__, retval); __func__, retval);
return retval; return retval;
...@@ -979,7 +979,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus, ...@@ -979,7 +979,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus,
if (!bus) { if (!bus) {
retval = em28xx_i2c_eeprom(dev, bus, &dev->eedata, &dev->eedata_len); retval = em28xx_i2c_eeprom(dev, bus, &dev->eedata, &dev->eedata_len);
if ((retval < 0) && (retval != -ENODEV)) { if ((retval < 0) && (retval != -ENODEV)) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: em28xx_i2_eeprom failed! retval [%d]\n", "%s: em28xx_i2_eeprom failed! retval [%d]\n",
__func__, retval); __func__, retval);
......
...@@ -43,7 +43,7 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); ...@@ -43,7 +43,7 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]");
#define dprintk( fmt, arg...) do { \ #define dprintk( fmt, arg...) do { \
if (ir_debug) \ if (ir_debug) \
dev_printk(KERN_DEBUG, &ir->dev->udev->dev, \ dev_printk(KERN_DEBUG, &ir->dev->intf->dev, \
"input: %s: " fmt, __func__, ## arg); \ "input: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
...@@ -459,7 +459,7 @@ static int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type) ...@@ -459,7 +459,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:
dev_err(&ir->dev->udev->dev, dev_err(&ir->dev->intf->dev,
"Unrecognized em28xx chip id 0x%02x: IR not supported\n", "Unrecognized em28xx chip id 0x%02x: IR not supported\n",
dev->chip_id); dev->chip_id);
return -EINVAL; return -EINVAL;
...@@ -569,7 +569,7 @@ static int em28xx_register_snapshot_button(struct em28xx *dev) ...@@ -569,7 +569,7 @@ static int em28xx_register_snapshot_button(struct em28xx *dev)
struct input_dev *input_dev; struct input_dev *input_dev;
int err; int err;
dev_info(&dev->udev->dev, "Registering snapshot button...\n"); dev_info(&dev->intf->dev, "Registering snapshot button...\n");
input_dev = input_allocate_device(); input_dev = input_allocate_device();
if (!input_dev) if (!input_dev)
return -ENOMEM; return -ENOMEM;
...@@ -589,11 +589,11 @@ static int em28xx_register_snapshot_button(struct em28xx *dev) ...@@ -589,11 +589,11 @@ static int em28xx_register_snapshot_button(struct em28xx *dev)
input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);
input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct); input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct);
input_dev->id.version = 1; input_dev->id.version = 1;
input_dev->dev.parent = &dev->udev->dev; input_dev->dev.parent = &dev->intf->dev;
err = input_register_device(input_dev); err = input_register_device(input_dev);
if (err) { if (err) {
dev_err(&dev->udev->dev, "input_register_device failed\n"); dev_err(&dev->intf->dev, "input_register_device failed\n");
input_free_device(input_dev); input_free_device(input_dev);
return err; return err;
} }
...@@ -633,7 +633,7 @@ static void em28xx_init_buttons(struct em28xx *dev) ...@@ -633,7 +633,7 @@ static void em28xx_init_buttons(struct em28xx *dev)
} else if (button->role == EM28XX_BUTTON_ILLUMINATION) { } else if (button->role == EM28XX_BUTTON_ILLUMINATION) {
/* Check sanity */ /* Check sanity */
if (!em28xx_find_led(dev, EM28XX_LED_ILLUMINATION)) { if (!em28xx_find_led(dev, EM28XX_LED_ILLUMINATION)) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"BUG: illumination button defined, but no illumination LED.\n"); "BUG: illumination button defined, but no illumination LED.\n");
goto next_button; goto next_button;
} }
...@@ -670,7 +670,7 @@ static void em28xx_shutdown_buttons(struct em28xx *dev) ...@@ -670,7 +670,7 @@ static void em28xx_shutdown_buttons(struct em28xx *dev)
dev->num_button_polling_addresses = 0; dev->num_button_polling_addresses = 0;
/* Deregister input devices */ /* Deregister input devices */
if (dev->sbutton_input_dev != NULL) { if (dev->sbutton_input_dev != NULL) {
dev_info(&dev->udev->dev, "Deregistering snapshot button\n"); dev_info(&dev->intf->dev, "Deregistering snapshot button\n");
input_unregister_device(dev->sbutton_input_dev); input_unregister_device(dev->sbutton_input_dev);
dev->sbutton_input_dev = NULL; dev->sbutton_input_dev = NULL;
} }
...@@ -699,7 +699,7 @@ static int em28xx_ir_init(struct em28xx *dev) ...@@ -699,7 +699,7 @@ static int em28xx_ir_init(struct em28xx *dev)
i2c_rc_dev_addr = em28xx_probe_i2c_ir(dev); i2c_rc_dev_addr = em28xx_probe_i2c_ir(dev);
if (!i2c_rc_dev_addr) { if (!i2c_rc_dev_addr) {
dev->board.has_ir_i2c = 0; dev->board.has_ir_i2c = 0;
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"No i2c IR remote control device found.\n"); "No i2c IR remote control device found.\n");
return -ENODEV; return -ENODEV;
} }
...@@ -707,12 +707,12 @@ static int em28xx_ir_init(struct em28xx *dev) ...@@ -707,12 +707,12 @@ static int em28xx_ir_init(struct em28xx *dev)
if (dev->board.ir_codes == NULL && !dev->board.has_ir_i2c) { if (dev->board.ir_codes == NULL && !dev->board.has_ir_i2c) {
/* No remote control support */ /* No remote control support */
dev_warn(&dev->udev->dev, dev_warn(&dev->intf->dev,
"Remote control support is not available for this card.\n"); "Remote control support is not available for this card.\n");
return 0; return 0;
} }
dev_info(&dev->udev->dev, "Registering input extension\n"); dev_info(&dev->intf->dev, "Registering input extension\n");
ir = kzalloc(sizeof(*ir), GFP_KERNEL); ir = kzalloc(sizeof(*ir), GFP_KERNEL);
if (!ir) if (!ir)
...@@ -797,7 +797,7 @@ static int em28xx_ir_init(struct em28xx *dev) ...@@ -797,7 +797,7 @@ static int em28xx_ir_init(struct em28xx *dev)
/* init input device */ /* init input device */
snprintf(ir->name, sizeof(ir->name), "%s IR", snprintf(ir->name, sizeof(ir->name), "%s IR",
dev_name(&dev->udev->dev)); dev_name(&dev->intf->dev));
usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); usb_make_path(dev->udev, ir->phys, sizeof(ir->phys));
strlcat(ir->phys, "/input0", sizeof(ir->phys)); strlcat(ir->phys, "/input0", sizeof(ir->phys));
...@@ -808,7 +808,7 @@ static int em28xx_ir_init(struct em28xx *dev) ...@@ -808,7 +808,7 @@ static int em28xx_ir_init(struct em28xx *dev)
rc->input_id.version = 1; rc->input_id.version = 1;
rc->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); rc->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);
rc->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct); rc->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct);
rc->dev.parent = &dev->udev->dev; rc->dev.parent = &dev->intf->dev;
rc->driver_name = MODULE_NAME; rc->driver_name = MODULE_NAME;
/* all done */ /* all done */
...@@ -816,7 +816,7 @@ static int em28xx_ir_init(struct em28xx *dev) ...@@ -816,7 +816,7 @@ static int em28xx_ir_init(struct em28xx *dev)
if (err) if (err)
goto error; goto error;
dev_info(&dev->udev->dev, "Input extension successfully initalized\n"); dev_info(&dev->intf->dev, "Input extension successfully initalized\n");
return 0; return 0;
...@@ -837,7 +837,7 @@ static int em28xx_ir_fini(struct em28xx *dev) ...@@ -837,7 +837,7 @@ static int em28xx_ir_fini(struct em28xx *dev)
return 0; return 0;
} }
dev_info(&dev->udev->dev, "Closing input extension\n"); dev_info(&dev->intf->dev, "Closing input extension\n");
em28xx_shutdown_buttons(dev); em28xx_shutdown_buttons(dev);
...@@ -866,7 +866,7 @@ static int em28xx_ir_suspend(struct em28xx *dev) ...@@ -866,7 +866,7 @@ static int em28xx_ir_suspend(struct em28xx *dev)
if (dev->is_audio_only) if (dev->is_audio_only)
return 0; return 0;
dev_info(&dev->udev->dev, "Suspending input extension\n"); dev_info(&dev->intf->dev, "Suspending input extension\n");
if (ir) if (ir)
cancel_delayed_work_sync(&ir->work); cancel_delayed_work_sync(&ir->work);
cancel_delayed_work_sync(&dev->buttons_query_work); cancel_delayed_work_sync(&dev->buttons_query_work);
...@@ -883,7 +883,7 @@ static int em28xx_ir_resume(struct em28xx *dev) ...@@ -883,7 +883,7 @@ static int em28xx_ir_resume(struct em28xx *dev)
if (dev->is_audio_only) if (dev->is_audio_only)
return 0; return 0;
dev_info(&dev->udev->dev, "Resuming input extension\n"); dev_info(&dev->intf->dev, "Resuming input extension\n");
/* if suspend calls ir_raw_event_unregister(), the should call /* if suspend calls ir_raw_event_unregister(), the should call
ir_raw_event_register() */ ir_raw_event_register() */
if (ir) if (ir)
......
...@@ -65,7 +65,7 @@ static int vbi_buffer_prepare(struct vb2_buffer *vb) ...@@ -65,7 +65,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) {
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"%s data will not fit into plane (%lu < %lu)\n", "%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,13 +66,13 @@ MODULE_PARM_DESC(alt, "alternate setting to use for video endpoint"); ...@@ -66,13 +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) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"video: %s: " fmt, __func__, ## arg); \ "video: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
#define em28xx_isocdbg(fmt, arg...) do {\ #define em28xx_isocdbg(fmt, arg...) do {\
if (isoc_debug) \ if (isoc_debug) \
dev_printk(KERN_DEBUG, &dev->udev->dev, \ dev_printk(KERN_DEBUG, &dev->intf->dev, \
"isoc: %s: " fmt, __func__, ## arg); \ "isoc: %s: " fmt, __func__, ## arg); \
} while (0) } while (0)
...@@ -413,7 +413,7 @@ static int em28xx_set_alternate(struct em28xx *dev) ...@@ -413,7 +413,7 @@ static int em28xx_set_alternate(struct em28xx *dev)
dev->alt, dev->max_pkt_size); dev->alt, dev->max_pkt_size);
errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt); errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt);
if (errCode < 0) { if (errCode < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"cannot change alternate number to %d (error=%i)\n", "cannot change alternate number to %d (error=%i)\n",
dev->alt, errCode); dev->alt, errCode);
return errCode; return errCode;
...@@ -926,7 +926,7 @@ static int em28xx_enable_analog_tuner(struct em28xx *dev) ...@@ -926,7 +926,7 @@ static int em28xx_enable_analog_tuner(struct em28xx *dev)
ret = media_entity_setup_link(link, flags); ret = media_entity_setup_link(link, flags);
if (ret) { if (ret) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"Couldn't change link %s->%s to %s. Error %d\n", "Couldn't change link %s->%s to %s. Error %d\n",
source->name, sink->name, source->name, sink->name,
flags ? "enabled" : "disabled", flags ? "enabled" : "disabled",
...@@ -958,7 +958,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev) ...@@ -958,7 +958,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev)
v4l2->video_pad.flags = MEDIA_PAD_FL_SINK; v4l2->video_pad.flags = MEDIA_PAD_FL_SINK;
ret = media_entity_pads_init(&v4l2->vdev.entity, 1, &v4l2->video_pad); ret = media_entity_pads_init(&v4l2->vdev.entity, 1, &v4l2->video_pad);
if (ret < 0) if (ret < 0)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to initialize video media entity!\n"); "failed to initialize video media entity!\n");
if (em28xx_vbi_supported(dev)) { if (em28xx_vbi_supported(dev)) {
...@@ -966,7 +966,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev) ...@@ -966,7 +966,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev)
ret = media_entity_pads_init(&v4l2->vbi_dev.entity, 1, ret = media_entity_pads_init(&v4l2->vbi_dev.entity, 1,
&v4l2->vbi_pad); &v4l2->vbi_pad);
if (ret < 0) if (ret < 0)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to initialize vbi media entity!\n"); "failed to initialize vbi media entity!\n");
} }
...@@ -1000,12 +1000,12 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev) ...@@ -1000,12 +1000,12 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev)
ret = media_entity_pads_init(ent, 1, &dev->input_pad[i]); ret = media_entity_pads_init(ent, 1, &dev->input_pad[i]);
if (ret < 0) if (ret < 0)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to initialize input pad[%d]!\n", i); "failed to initialize input pad[%d]!\n", i);
ret = media_device_register_entity(dev->media_dev, ent); ret = media_device_register_entity(dev->media_dev, ent);
if (ret < 0) if (ret < 0)
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to register input entity %d!\n", i); "failed to register input entity %d!\n", i);
} }
#endif #endif
...@@ -2053,7 +2053,7 @@ static int em28xx_v4l2_open(struct file *filp) ...@@ -2053,7 +2053,7 @@ static int em28xx_v4l2_open(struct file *filp)
ret = v4l2_fh_open(filp); ret = v4l2_fh_open(filp);
if (ret) { if (ret) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: v4l2_fh_open() returned error %d\n", "%s: v4l2_fh_open() returned error %d\n",
__func__, ret); __func__, ret);
mutex_unlock(&dev->lock); mutex_unlock(&dev->lock);
...@@ -2109,7 +2109,7 @@ static int em28xx_v4l2_fini(struct em28xx *dev) ...@@ -2109,7 +2109,7 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
if (v4l2 == NULL) if (v4l2 == NULL)
return 0; return 0;
dev_info(&dev->udev->dev, "Closing video extension\n"); dev_info(&dev->intf->dev, "Closing video extension\n");
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
...@@ -2120,17 +2120,17 @@ static int em28xx_v4l2_fini(struct em28xx *dev) ...@@ -2120,17 +2120,17 @@ static int em28xx_v4l2_fini(struct em28xx *dev)
em28xx_v4l2_media_release(dev); em28xx_v4l2_media_release(dev);
if (video_is_registered(&v4l2->radio_dev)) { if (video_is_registered(&v4l2->radio_dev)) {
dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->radio_dev)); video_device_node_name(&v4l2->radio_dev));
video_unregister_device(&v4l2->radio_dev); video_unregister_device(&v4l2->radio_dev);
} }
if (video_is_registered(&v4l2->vbi_dev)) { if (video_is_registered(&v4l2->vbi_dev)) {
dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vbi_dev)); video_device_node_name(&v4l2->vbi_dev));
video_unregister_device(&v4l2->vbi_dev); video_unregister_device(&v4l2->vbi_dev);
} }
if (video_is_registered(&v4l2->vdev)) { if (video_is_registered(&v4l2->vdev)) {
dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vdev)); video_device_node_name(&v4l2->vdev));
video_unregister_device(&v4l2->vdev); video_unregister_device(&v4l2->vdev);
} }
...@@ -2160,7 +2160,7 @@ static int em28xx_v4l2_suspend(struct em28xx *dev) ...@@ -2160,7 +2160,7 @@ static int em28xx_v4l2_suspend(struct em28xx *dev)
if (!dev->has_video) if (!dev->has_video)
return 0; return 0;
dev_info(&dev->udev->dev, "Suspending video extension\n"); dev_info(&dev->intf->dev, "Suspending video extension\n");
em28xx_stop_urbs(dev); em28xx_stop_urbs(dev);
return 0; return 0;
} }
...@@ -2173,7 +2173,7 @@ static int em28xx_v4l2_resume(struct em28xx *dev) ...@@ -2173,7 +2173,7 @@ static int em28xx_v4l2_resume(struct em28xx *dev)
if (!dev->has_video) if (!dev->has_video)
return 0; return 0;
dev_info(&dev->udev->dev, "Resuming video extension\n"); dev_info(&dev->intf->dev, "Resuming video extension\n");
/* what do we do here */ /* what do we do here */
return 0; return 0;
} }
...@@ -2210,7 +2210,7 @@ static int em28xx_v4l2_close(struct file *filp) ...@@ -2210,7 +2210,7 @@ static int em28xx_v4l2_close(struct file *filp)
em28xx_videodbg("setting alternate 0\n"); em28xx_videodbg("setting alternate 0\n");
errCode = usb_set_interface(dev->udev, 0, 0); errCode = usb_set_interface(dev->udev, 0, 0);
if (errCode < 0) { if (errCode < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"cannot change alternate number to 0 (error=%i)\n", "cannot change alternate number to 0 (error=%i)\n",
errCode); errCode);
} }
...@@ -2345,7 +2345,7 @@ static void em28xx_vdev_init(struct em28xx *dev, ...@@ -2345,7 +2345,7 @@ static void em28xx_vdev_init(struct em28xx *dev,
vfd->tvnorms = 0; vfd->tvnorms = 0;
snprintf(vfd->name, sizeof(vfd->name), "%s %s", snprintf(vfd->name, sizeof(vfd->name), "%s %s",
dev_name(&dev->udev->dev), type_name); dev_name(&dev->intf->dev), type_name);
video_set_drvdata(vfd, dev); video_set_drvdata(vfd, dev);
} }
...@@ -2429,7 +2429,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2429,7 +2429,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
return 0; return 0;
} }
dev_info(&dev->udev->dev, "Registering V4L2 extension\n"); dev_info(&dev->intf->dev, "Registering V4L2 extension\n");
mutex_lock(&dev->lock); mutex_lock(&dev->lock);
...@@ -2445,9 +2445,9 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2445,9 +2445,9 @@ static int em28xx_v4l2_init(struct em28xx *dev)
#ifdef CONFIG_MEDIA_CONTROLLER #ifdef CONFIG_MEDIA_CONTROLLER
v4l2->v4l2_dev.mdev = dev->media_dev; v4l2->v4l2_dev.mdev = dev->media_dev;
#endif #endif
ret = v4l2_device_register(&dev->udev->dev, &v4l2->v4l2_dev); ret = v4l2_device_register(&dev->intf->dev, &v4l2->v4l2_dev);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"Call to v4l2_device_register() failed!\n"); "Call to v4l2_device_register() failed!\n");
goto err; goto err;
} }
...@@ -2532,7 +2532,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2532,7 +2532,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* Configure audio */ /* Configure audio */
ret = em28xx_audio_setup(dev); ret = em28xx_audio_setup(dev);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: Error while setting audio - error [%d]!\n", "%s: Error while setting audio - error [%d]!\n",
__func__, ret); __func__, ret);
goto unregister_dev; goto unregister_dev;
...@@ -2561,7 +2561,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2561,7 +2561,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* Send a reset to other chips via gpio */ /* Send a reset to other chips via gpio */
ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7); ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: em28xx_write_reg - msp34xx(1) failed! error [%d]\n", "%s: em28xx_write_reg - msp34xx(1) failed! error [%d]\n",
__func__, ret); __func__, ret);
goto unregister_dev; goto unregister_dev;
...@@ -2570,7 +2570,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2570,7 +2570,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff); ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"%s: em28xx_write_reg - msp34xx(2) failed! error [%d]\n", "%s: em28xx_write_reg - msp34xx(2) failed! error [%d]\n",
__func__, ret); __func__, ret);
goto unregister_dev; goto unregister_dev;
...@@ -2673,7 +2673,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2673,7 +2673,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) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"unable to register video device (error=%i).\n", ret); "unable to register video device (error=%i).\n", ret);
goto unregister_dev; goto unregister_dev;
} }
...@@ -2703,7 +2703,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2703,7 +2703,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = video_register_device(&v4l2->vbi_dev, VFL_TYPE_VBI, ret = video_register_device(&v4l2->vbi_dev, VFL_TYPE_VBI,
vbi_nr[dev->devno]); vbi_nr[dev->devno]);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"unable to register vbi device\n"); "unable to register vbi device\n");
goto unregister_dev; goto unregister_dev;
} }
...@@ -2715,11 +2715,11 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2715,11 +2715,11 @@ static int em28xx_v4l2_init(struct em28xx *dev)
ret = video_register_device(&v4l2->radio_dev, VFL_TYPE_RADIO, ret = video_register_device(&v4l2->radio_dev, VFL_TYPE_RADIO,
radio_nr[dev->devno]); radio_nr[dev->devno]);
if (ret < 0) { if (ret < 0) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"can't register radio device\n"); "can't register radio device\n");
goto unregister_dev; goto unregister_dev;
} }
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"Registered radio device as %s\n", "Registered radio device as %s\n",
video_device_node_name(&v4l2->radio_dev)); video_device_node_name(&v4l2->radio_dev));
} }
...@@ -2730,19 +2730,19 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2730,19 +2730,19 @@ static int em28xx_v4l2_init(struct em28xx *dev)
#ifdef CONFIG_MEDIA_CONTROLLER #ifdef CONFIG_MEDIA_CONTROLLER
ret = v4l2_mc_create_media_graph(dev->media_dev); ret = v4l2_mc_create_media_graph(dev->media_dev);
if (ret) { if (ret) {
dev_err(&dev->udev->dev, dev_err(&dev->intf->dev,
"failed to create media graph\n"); "failed to create media graph\n");
em28xx_v4l2_media_release(dev); em28xx_v4l2_media_release(dev);
goto unregister_dev; goto unregister_dev;
} }
#endif #endif
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"V4L2 video device registered as %s\n", "V4L2 video device registered as %s\n",
video_device_node_name(&v4l2->vdev)); video_device_node_name(&v4l2->vdev));
if (video_is_registered(&v4l2->vbi_dev)) if (video_is_registered(&v4l2->vbi_dev))
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"V4L2 VBI device registered as %s\n", "V4L2 VBI device registered as %s\n",
video_device_node_name(&v4l2->vbi_dev)); video_device_node_name(&v4l2->vbi_dev));
...@@ -2752,7 +2752,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2752,7 +2752,7 @@ static int em28xx_v4l2_init(struct em28xx *dev)
/* initialize videobuf2 stuff */ /* initialize videobuf2 stuff */
em28xx_vb2_setup(dev); em28xx_vb2_setup(dev);
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"V4L2 extension successfully initialized\n"); "V4L2 extension successfully initialized\n");
kref_get(&dev->ref); kref_get(&dev->ref);
...@@ -2762,19 +2762,19 @@ static int em28xx_v4l2_init(struct em28xx *dev) ...@@ -2762,19 +2762,19 @@ static int em28xx_v4l2_init(struct em28xx *dev)
unregister_dev: unregister_dev:
if (video_is_registered(&v4l2->radio_dev)) { if (video_is_registered(&v4l2->radio_dev)) {
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"V4L2 device %s deregistered\n", "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->radio_dev)); video_device_node_name(&v4l2->radio_dev));
video_unregister_device(&v4l2->radio_dev); video_unregister_device(&v4l2->radio_dev);
} }
if (video_is_registered(&v4l2->vbi_dev)) { if (video_is_registered(&v4l2->vbi_dev)) {
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"V4L2 device %s deregistered\n", "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vbi_dev)); video_device_node_name(&v4l2->vbi_dev));
video_unregister_device(&v4l2->vbi_dev); video_unregister_device(&v4l2->vbi_dev);
} }
if (video_is_registered(&v4l2->vdev)) { if (video_is_registered(&v4l2->vdev)) {
dev_info(&dev->udev->dev, dev_info(&dev->intf->dev,
"V4L2 device %s deregistered\n", "V4L2 device %s deregistered\n",
video_device_node_name(&v4l2->vdev)); video_device_node_name(&v4l2->vdev));
video_unregister_device(&v4l2->vdev); video_unregister_device(&v4l2->vdev);
......
...@@ -678,6 +678,7 @@ struct em28xx { ...@@ -678,6 +678,7 @@ struct em28xx {
/* usb transfer */ /* usb transfer */
struct usb_device *udev; /* the usb device */ struct usb_device *udev; /* the usb device */
struct usb_interface *intf; /* the usb interface */
u8 ifnum; /* number of the assigned usb interface */ u8 ifnum; /* number of the assigned usb interface */
u8 analog_ep_isoc; /* address of isoc endpoint for analog */ u8 analog_ep_isoc; /* address of isoc endpoint for analog */
u8 analog_ep_bulk; /* address of bulk endpoint for analog */ u8 analog_ep_bulk; /* address of bulk endpoint for analog */
......
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