diff options
author | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2016-12-07 10:48:10 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-12-12 04:29:08 -0500 |
commit | 29b05e22f5c68c657f5ec30a31023b81124287fb (patch) | |
tree | 3c76e467ae57e57ba1af14837b1f599b838fcf61 | |
parent | ea48c3680829c0c522a799a4a9e0fb6cc5afd0a4 (diff) |
[media] em28xx: use usb_interface for dev_foo() calls
The usb_device->dev is not the right device for dev_foo() calls.
Instead, it should use usb_interface->dev.
Tested-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-audio.c | 34 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-camera.c | 30 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-cards.c | 61 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-core.c | 48 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-dvb.c | 61 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-i2c.c | 92 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-input.c | 32 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-vbi.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx-video.c | 68 | ||||
-rw-r--r-- | drivers/media/usb/em28xx/em28xx.h | 1 |
10 files changed, 216 insertions, 213 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 7060e5146e31..7f8601427b7f 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c | |||
@@ -56,7 +56,7 @@ MODULE_PARM_DESC(debug, "activates debug info"); | |||
56 | 56 | ||
57 | #define dprintk(fmt, arg...) do { \ | 57 | #define dprintk(fmt, arg...) do { \ |
58 | if (debug) \ | 58 | if (debug) \ |
59 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 59 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
60 | "video: %s: " fmt, __func__, ## arg); \ | 60 | "video: %s: " fmt, __func__, ## arg); \ |
61 | } while (0) | 61 | } while (0) |
62 | 62 | ||
@@ -166,7 +166,7 @@ static void em28xx_audio_isocirq(struct urb *urb) | |||
166 | 166 | ||
167 | status = usb_submit_urb(urb, GFP_ATOMIC); | 167 | status = usb_submit_urb(urb, GFP_ATOMIC); |
168 | if (status < 0) | 168 | if (status < 0) |
169 | dev_err(&dev->udev->dev, | 169 | dev_err(&dev->intf->dev, |
170 | "resubmit of audio urb failed (error=%i)\n", | 170 | "resubmit of audio urb failed (error=%i)\n", |
171 | status); | 171 | status); |
172 | return; | 172 | return; |
@@ -185,7 +185,7 @@ static int em28xx_init_audio_isoc(struct em28xx *dev) | |||
185 | 185 | ||
186 | errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); | 186 | errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); |
187 | if (errCode) { | 187 | if (errCode) { |
188 | dev_err(&dev->udev->dev, | 188 | dev_err(&dev->intf->dev, |
189 | "submit of audio urb failed (error=%i)\n", | 189 | "submit of audio urb failed (error=%i)\n", |
190 | errCode); | 190 | errCode); |
191 | em28xx_deinit_isoc_audio(dev); | 191 | em28xx_deinit_isoc_audio(dev); |
@@ -322,7 +322,7 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream) | |||
322 | err: | 322 | err: |
323 | mutex_unlock(&dev->lock); | 323 | mutex_unlock(&dev->lock); |
324 | 324 | ||
325 | dev_err(&dev->udev->dev, | 325 | dev_err(&dev->intf->dev, |
326 | "Error while configuring em28xx mixer\n"); | 326 | "Error while configuring em28xx mixer\n"); |
327 | return ret; | 327 | return ret; |
328 | } | 328 | } |
@@ -761,7 +761,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) | |||
761 | intf = usb_ifnum_to_if(dev->udev, dev->ifnum); | 761 | intf = usb_ifnum_to_if(dev->udev, dev->ifnum); |
762 | 762 | ||
763 | if (intf->num_altsetting <= alt) { | 763 | if (intf->num_altsetting <= alt) { |
764 | dev_err(&dev->udev->dev, "alt %d doesn't exist on interface %d\n", | 764 | dev_err(&dev->intf->dev, "alt %d doesn't exist on interface %d\n", |
765 | dev->ifnum, alt); | 765 | dev->ifnum, alt); |
766 | return -ENODEV; | 766 | return -ENODEV; |
767 | } | 767 | } |
@@ -777,14 +777,14 @@ static int em28xx_audio_urb_init(struct em28xx *dev) | |||
777 | } | 777 | } |
778 | 778 | ||
779 | if (!ep) { | 779 | if (!ep) { |
780 | dev_err(&dev->udev->dev, "Couldn't find an audio endpoint"); | 780 | dev_err(&dev->intf->dev, "Couldn't find an audio endpoint"); |
781 | return -ENODEV; | 781 | return -ENODEV; |
782 | } | 782 | } |
783 | 783 | ||
784 | ep_size = em28xx_audio_ep_packet_size(dev->udev, ep); | 784 | ep_size = em28xx_audio_ep_packet_size(dev->udev, ep); |
785 | interval = 1 << (ep->bInterval - 1); | 785 | interval = 1 << (ep->bInterval - 1); |
786 | 786 | ||
787 | dev_info(&dev->udev->dev, | 787 | dev_info(&dev->intf->dev, |
788 | "Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n", | 788 | "Endpoint 0x%02x %s on intf %d alt %d interval = %d, size %d\n", |
789 | EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed), | 789 | EM28XX_EP_AUDIO, usb_speed_string(dev->udev->speed), |
790 | dev->ifnum, alt, interval, ep_size); | 790 | dev->ifnum, alt, interval, ep_size); |
@@ -824,7 +824,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) | |||
824 | if (urb_size > ep_size * npackets) | 824 | if (urb_size > ep_size * npackets) |
825 | npackets = DIV_ROUND_UP(urb_size, ep_size); | 825 | npackets = DIV_ROUND_UP(urb_size, ep_size); |
826 | 826 | ||
827 | dev_info(&dev->udev->dev, | 827 | dev_info(&dev->intf->dev, |
828 | "Number of URBs: %d, with %d packets and %d size\n", | 828 | "Number of URBs: %d, with %d packets and %d size\n", |
829 | num_urb, npackets, urb_size); | 829 | num_urb, npackets, urb_size); |
830 | 830 | ||
@@ -863,7 +863,7 @@ static int em28xx_audio_urb_init(struct em28xx *dev) | |||
863 | buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC, | 863 | buf = usb_alloc_coherent(dev->udev, npackets * ep_size, GFP_ATOMIC, |
864 | &urb->transfer_dma); | 864 | &urb->transfer_dma); |
865 | if (!buf) { | 865 | if (!buf) { |
866 | dev_err(&dev->udev->dev, | 866 | dev_err(&dev->intf->dev, |
867 | "usb_alloc_coherent failed!\n"); | 867 | "usb_alloc_coherent failed!\n"); |
868 | em28xx_audio_free_urb(dev); | 868 | em28xx_audio_free_urb(dev); |
869 | return -ENOMEM; | 869 | return -ENOMEM; |
@@ -904,16 +904,16 @@ static int em28xx_audio_init(struct em28xx *dev) | |||
904 | return 0; | 904 | return 0; |
905 | } | 905 | } |
906 | 906 | ||
907 | dev_info(&dev->udev->dev, "Binding audio extension\n"); | 907 | dev_info(&dev->intf->dev, "Binding audio extension\n"); |
908 | 908 | ||
909 | kref_get(&dev->ref); | 909 | kref_get(&dev->ref); |
910 | 910 | ||
911 | dev_info(&dev->udev->dev, | 911 | dev_info(&dev->intf->dev, |
912 | "em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n"); | 912 | "em28xx-audio.c: Copyright (C) 2006 Markus Rechberger\n"); |
913 | dev_info(&dev->udev->dev, | 913 | dev_info(&dev->intf->dev, |
914 | "em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n"); | 914 | "em28xx-audio.c: Copyright (C) 2007-2016 Mauro Carvalho Chehab\n"); |
915 | 915 | ||
916 | err = snd_card_new(&dev->udev->dev, index[devnr], "Em28xx Audio", | 916 | err = snd_card_new(&dev->intf->dev, index[devnr], "Em28xx Audio", |
917 | THIS_MODULE, 0, &card); | 917 | THIS_MODULE, 0, &card); |
918 | if (err < 0) | 918 | if (err < 0) |
919 | return err; | 919 | return err; |
@@ -961,7 +961,7 @@ static int em28xx_audio_init(struct em28xx *dev) | |||
961 | if (err < 0) | 961 | if (err < 0) |
962 | goto urb_free; | 962 | goto urb_free; |
963 | 963 | ||
964 | dev_info(&dev->udev->dev, "Audio extension successfully initialized\n"); | 964 | dev_info(&dev->intf->dev, "Audio extension successfully initialized\n"); |
965 | return 0; | 965 | return 0; |
966 | 966 | ||
967 | urb_free: | 967 | urb_free: |
@@ -986,7 +986,7 @@ static int em28xx_audio_fini(struct em28xx *dev) | |||
986 | return 0; | 986 | return 0; |
987 | } | 987 | } |
988 | 988 | ||
989 | dev_info(&dev->udev->dev, "Closing audio extension\n"); | 989 | dev_info(&dev->intf->dev, "Closing audio extension\n"); |
990 | 990 | ||
991 | if (dev->adev.sndcard) { | 991 | if (dev->adev.sndcard) { |
992 | snd_card_disconnect(dev->adev.sndcard); | 992 | snd_card_disconnect(dev->adev.sndcard); |
@@ -1010,7 +1010,7 @@ static int em28xx_audio_suspend(struct em28xx *dev) | |||
1010 | if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) | 1010 | if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) |
1011 | return 0; | 1011 | return 0; |
1012 | 1012 | ||
1013 | dev_info(&dev->udev->dev, "Suspending audio extension\n"); | 1013 | dev_info(&dev->intf->dev, "Suspending audio extension\n"); |
1014 | em28xx_deinit_isoc_audio(dev); | 1014 | em28xx_deinit_isoc_audio(dev); |
1015 | atomic_set(&dev->adev.stream_started, 0); | 1015 | atomic_set(&dev->adev.stream_started, 0); |
1016 | return 0; | 1016 | return 0; |
@@ -1024,7 +1024,7 @@ static int em28xx_audio_resume(struct em28xx *dev) | |||
1024 | if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) | 1024 | if (dev->usb_audio_type != EM28XX_USB_AUDIO_VENDOR) |
1025 | return 0; | 1025 | return 0; |
1026 | 1026 | ||
1027 | dev_info(&dev->udev->dev, "Resuming audio extension\n"); | 1027 | dev_info(&dev->intf->dev, "Resuming audio extension\n"); |
1028 | /* Nothing to do other than schedule_work() ?? */ | 1028 | /* Nothing to do other than schedule_work() ?? */ |
1029 | schedule_work(&dev->adev.wq_trigger); | 1029 | schedule_work(&dev->adev.wq_trigger); |
1030 | return 0; | 1030 | return 0; |
diff --git a/drivers/media/usb/em28xx/em28xx-camera.c b/drivers/media/usb/em28xx/em28xx-camera.c index 2e24b65901ec..89c890ba7dd6 100644 --- a/drivers/media/usb/em28xx/em28xx-camera.c +++ b/drivers/media/usb/em28xx/em28xx-camera.c | |||
@@ -121,14 +121,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) | |||
121 | ret = i2c_master_send(&client, ®, 1); | 121 | ret = i2c_master_send(&client, ®, 1); |
122 | if (ret < 0) { | 122 | if (ret < 0) { |
123 | if (ret != -ENXIO) | 123 | if (ret != -ENXIO) |
124 | dev_err(&dev->udev->dev, | 124 | dev_err(&dev->intf->dev, |
125 | "couldn't read from i2c device 0x%02x: error %i\n", | 125 | "couldn't read from i2c device 0x%02x: error %i\n", |
126 | client.addr << 1, ret); | 126 | client.addr << 1, ret); |
127 | continue; | 127 | continue; |
128 | } | 128 | } |
129 | ret = i2c_master_recv(&client, (u8 *)&id_be, 2); | 129 | ret = i2c_master_recv(&client, (u8 *)&id_be, 2); |
130 | if (ret < 0) { | 130 | if (ret < 0) { |
131 | dev_err(&dev->udev->dev, | 131 | dev_err(&dev->intf->dev, |
132 | "couldn't read from i2c device 0x%02x: error %i\n", | 132 | "couldn't read from i2c device 0x%02x: error %i\n", |
133 | client.addr << 1, ret); | 133 | client.addr << 1, ret); |
134 | continue; | 134 | continue; |
@@ -138,14 +138,14 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) | |||
138 | reg = 0xff; | 138 | reg = 0xff; |
139 | ret = i2c_master_send(&client, ®, 1); | 139 | ret = i2c_master_send(&client, ®, 1); |
140 | if (ret < 0) { | 140 | if (ret < 0) { |
141 | dev_err(&dev->udev->dev, | 141 | dev_err(&dev->intf->dev, |
142 | "couldn't read from i2c device 0x%02x: error %i\n", | 142 | "couldn't read from i2c device 0x%02x: error %i\n", |
143 | client.addr << 1, ret); | 143 | client.addr << 1, ret); |
144 | continue; | 144 | continue; |
145 | } | 145 | } |
146 | ret = i2c_master_recv(&client, (u8 *)&id_be, 2); | 146 | ret = i2c_master_recv(&client, (u8 *)&id_be, 2); |
147 | if (ret < 0) { | 147 | if (ret < 0) { |
148 | dev_err(&dev->udev->dev, | 148 | dev_err(&dev->intf->dev, |
149 | "couldn't read from i2c device 0x%02x: error %i\n", | 149 | "couldn't read from i2c device 0x%02x: error %i\n", |
150 | client.addr << 1, ret); | 150 | client.addr << 1, ret); |
151 | continue; | 151 | continue; |
@@ -185,16 +185,16 @@ static int em28xx_probe_sensor_micron(struct em28xx *dev) | |||
185 | dev->em28xx_sensor = EM28XX_MT9M001; | 185 | dev->em28xx_sensor = EM28XX_MT9M001; |
186 | break; | 186 | break; |
187 | default: | 187 | default: |
188 | dev_info(&dev->udev->dev, | 188 | dev_info(&dev->intf->dev, |
189 | "unknown Micron sensor detected: 0x%04x\n", id); | 189 | "unknown Micron sensor detected: 0x%04x\n", id); |
190 | return 0; | 190 | return 0; |
191 | } | 191 | } |
192 | 192 | ||
193 | if (dev->em28xx_sensor == EM28XX_NOSENSOR) | 193 | if (dev->em28xx_sensor == EM28XX_NOSENSOR) |
194 | dev_info(&dev->udev->dev, | 194 | dev_info(&dev->intf->dev, |
195 | "unsupported sensor detected: %s\n", name); | 195 | "unsupported sensor detected: %s\n", name); |
196 | else | 196 | else |
197 | dev_info(&dev->udev->dev, | 197 | dev_info(&dev->intf->dev, |
198 | "sensor %s detected\n", name); | 198 | "sensor %s detected\n", name); |
199 | 199 | ||
200 | dev->i2c_client[dev->def_i2c_bus].addr = client.addr; | 200 | dev->i2c_client[dev->def_i2c_bus].addr = client.addr; |
@@ -225,7 +225,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) | |||
225 | ret = i2c_smbus_read_byte_data(&client, reg); | 225 | ret = i2c_smbus_read_byte_data(&client, reg); |
226 | if (ret < 0) { | 226 | if (ret < 0) { |
227 | if (ret != -ENXIO) | 227 | if (ret != -ENXIO) |
228 | dev_err(&dev->udev->dev, | 228 | dev_err(&dev->intf->dev, |
229 | "couldn't read from i2c device 0x%02x: error %i\n", | 229 | "couldn't read from i2c device 0x%02x: error %i\n", |
230 | client.addr << 1, ret); | 230 | client.addr << 1, ret); |
231 | continue; | 231 | continue; |
@@ -234,7 +234,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) | |||
234 | reg = 0x1d; | 234 | reg = 0x1d; |
235 | ret = i2c_smbus_read_byte_data(&client, reg); | 235 | ret = i2c_smbus_read_byte_data(&client, reg); |
236 | if (ret < 0) { | 236 | if (ret < 0) { |
237 | dev_err(&dev->udev->dev, | 237 | dev_err(&dev->intf->dev, |
238 | "couldn't read from i2c device 0x%02x: error %i\n", | 238 | "couldn't read from i2c device 0x%02x: error %i\n", |
239 | client.addr << 1, ret); | 239 | client.addr << 1, ret); |
240 | continue; | 240 | continue; |
@@ -247,7 +247,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) | |||
247 | reg = 0x0a; | 247 | reg = 0x0a; |
248 | ret = i2c_smbus_read_byte_data(&client, reg); | 248 | ret = i2c_smbus_read_byte_data(&client, reg); |
249 | if (ret < 0) { | 249 | if (ret < 0) { |
250 | dev_err(&dev->udev->dev, | 250 | dev_err(&dev->intf->dev, |
251 | "couldn't read from i2c device 0x%02x: error %i\n", | 251 | "couldn't read from i2c device 0x%02x: error %i\n", |
252 | client.addr << 1, ret); | 252 | client.addr << 1, ret); |
253 | continue; | 253 | continue; |
@@ -256,7 +256,7 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) | |||
256 | reg = 0x0b; | 256 | reg = 0x0b; |
257 | ret = i2c_smbus_read_byte_data(&client, reg); | 257 | ret = i2c_smbus_read_byte_data(&client, reg); |
258 | if (ret < 0) { | 258 | if (ret < 0) { |
259 | dev_err(&dev->udev->dev, | 259 | dev_err(&dev->intf->dev, |
260 | "couldn't read from i2c device 0x%02x: error %i\n", | 260 | "couldn't read from i2c device 0x%02x: error %i\n", |
261 | client.addr << 1, ret); | 261 | client.addr << 1, ret); |
262 | continue; | 262 | continue; |
@@ -296,17 +296,17 @@ static int em28xx_probe_sensor_omnivision(struct em28xx *dev) | |||
296 | name = "OV9655"; | 296 | name = "OV9655"; |
297 | break; | 297 | break; |
298 | default: | 298 | default: |
299 | dev_info(&dev->udev->dev, | 299 | dev_info(&dev->intf->dev, |
300 | "unknown OmniVision sensor detected: 0x%04x\n", | 300 | "unknown OmniVision sensor detected: 0x%04x\n", |
301 | id); | 301 | id); |
302 | return 0; | 302 | return 0; |
303 | } | 303 | } |
304 | 304 | ||
305 | if (dev->em28xx_sensor == EM28XX_NOSENSOR) | 305 | if (dev->em28xx_sensor == EM28XX_NOSENSOR) |
306 | dev_info(&dev->udev->dev, | 306 | dev_info(&dev->intf->dev, |
307 | "unsupported sensor detected: %s\n", name); | 307 | "unsupported sensor detected: %s\n", name); |
308 | else | 308 | else |
309 | dev_info(&dev->udev->dev, | 309 | dev_info(&dev->intf->dev, |
310 | "sensor %s detected\n", name); | 310 | "sensor %s detected\n", name); |
311 | 311 | ||
312 | dev->i2c_client[dev->def_i2c_bus].addr = client.addr; | 312 | dev->i2c_client[dev->def_i2c_bus].addr = client.addr; |
@@ -331,7 +331,7 @@ int em28xx_detect_sensor(struct em28xx *dev) | |||
331 | */ | 331 | */ |
332 | 332 | ||
333 | if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) { | 333 | if (dev->em28xx_sensor == EM28XX_NOSENSOR && ret < 0) { |
334 | dev_info(&dev->udev->dev, | 334 | dev_info(&dev->intf->dev, |
335 | "No sensor detected\n"); | 335 | "No sensor detected\n"); |
336 | return -ENODEV; | 336 | return -ENODEV; |
337 | } | 337 | } |
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 50e4c6e51ee7..56739ce6ce16 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c | |||
@@ -2677,7 +2677,7 @@ static int em28xx_wait_until_ac97_features_equals(struct em28xx *dev, | |||
2677 | msleep(50); | 2677 | msleep(50); |
2678 | } | 2678 | } |
2679 | 2679 | ||
2680 | dev_warn(&dev->udev->dev, "AC97 registers access is not reliable !\n"); | 2680 | dev_warn(&dev->intf->dev, "AC97 registers access is not reliable !\n"); |
2681 | return -ETIMEDOUT; | 2681 | return -ETIMEDOUT; |
2682 | } | 2682 | } |
2683 | 2683 | ||
@@ -2831,7 +2831,7 @@ static int em28xx_hint_board(struct em28xx *dev) | |||
2831 | dev->model = em28xx_eeprom_hash[i].model; | 2831 | dev->model = em28xx_eeprom_hash[i].model; |
2832 | dev->tuner_type = em28xx_eeprom_hash[i].tuner; | 2832 | dev->tuner_type = em28xx_eeprom_hash[i].tuner; |
2833 | 2833 | ||
2834 | dev_err(&dev->udev->dev, | 2834 | dev_err(&dev->intf->dev, |
2835 | "Your board has no unique USB ID.\n" | 2835 | "Your board has no unique USB ID.\n" |
2836 | "A hint were successfully done, based on eeprom hash.\n" | 2836 | "A hint were successfully done, based on eeprom hash.\n" |
2837 | "This method is not 100%% failproof.\n" | 2837 | "This method is not 100%% failproof.\n" |
@@ -2861,7 +2861,7 @@ static int em28xx_hint_board(struct em28xx *dev) | |||
2861 | if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { | 2861 | if (dev->i2c_hash == em28xx_i2c_hash[i].hash) { |
2862 | dev->model = em28xx_i2c_hash[i].model; | 2862 | dev->model = em28xx_i2c_hash[i].model; |
2863 | dev->tuner_type = em28xx_i2c_hash[i].tuner; | 2863 | dev->tuner_type = em28xx_i2c_hash[i].tuner; |
2864 | dev_err(&dev->udev->dev, | 2864 | dev_err(&dev->intf->dev, |
2865 | "Your board has no unique USB ID.\n" | 2865 | "Your board has no unique USB ID.\n" |
2866 | "A hint were successfully done, based on i2c devicelist hash.\n" | 2866 | "A hint were successfully done, based on i2c devicelist hash.\n" |
2867 | "This method is not 100%% failproof.\n" | 2867 | "This method is not 100%% failproof.\n" |
@@ -2874,7 +2874,7 @@ static int em28xx_hint_board(struct em28xx *dev) | |||
2874 | } | 2874 | } |
2875 | } | 2875 | } |
2876 | 2876 | ||
2877 | dev_err(&dev->udev->dev, | 2877 | dev_err(&dev->intf->dev, |
2878 | "Your board has no unique USB ID and thus need a hint to be detected.\n" | 2878 | "Your board has no unique USB ID and thus need a hint to be detected.\n" |
2879 | "You may try to use card=<n> insmod option to workaround that.\n" | 2879 | "You may try to use card=<n> insmod option to workaround that.\n" |
2880 | "Please send an email with this log to:\n" | 2880 | "Please send an email with this log to:\n" |
@@ -2883,10 +2883,10 @@ static int em28xx_hint_board(struct em28xx *dev) | |||
2883 | "Board i2c devicelist hash is 0x%08lx\n", | 2883 | "Board i2c devicelist hash is 0x%08lx\n", |
2884 | dev->hash, dev->i2c_hash); | 2884 | dev->hash, dev->i2c_hash); |
2885 | 2885 | ||
2886 | dev_err(&dev->udev->dev, | 2886 | dev_err(&dev->intf->dev, |
2887 | "Here is a list of valid choices for the card=<n> insmod option:\n"); | 2887 | "Here is a list of valid choices for the card=<n> insmod option:\n"); |
2888 | for (i = 0; i < em28xx_bcount; i++) { | 2888 | for (i = 0; i < em28xx_bcount; i++) { |
2889 | dev_err(&dev->udev->dev, | 2889 | dev_err(&dev->intf->dev, |
2890 | " card=%d -> %s\n", i, em28xx_boards[i].name); | 2890 | " card=%d -> %s\n", i, em28xx_boards[i].name); |
2891 | } | 2891 | } |
2892 | return -1; | 2892 | return -1; |
@@ -2921,7 +2921,7 @@ static void em28xx_card_setup(struct em28xx *dev) | |||
2921 | * hash identities which has not been determined as yet. | 2921 | * hash identities which has not been determined as yet. |
2922 | */ | 2922 | */ |
2923 | if (em28xx_hint_board(dev) < 0) | 2923 | if (em28xx_hint_board(dev) < 0) |
2924 | dev_err(&dev->udev->dev, "Board not discovered\n"); | 2924 | dev_err(&dev->intf->dev, "Board not discovered\n"); |
2925 | else { | 2925 | else { |
2926 | em28xx_set_model(dev); | 2926 | em28xx_set_model(dev); |
2927 | em28xx_pre_card_setup(dev); | 2927 | em28xx_pre_card_setup(dev); |
@@ -2931,7 +2931,7 @@ static void em28xx_card_setup(struct em28xx *dev) | |||
2931 | em28xx_set_model(dev); | 2931 | em28xx_set_model(dev); |
2932 | } | 2932 | } |
2933 | 2933 | ||
2934 | dev_info(&dev->udev->dev, "Identified as %s (card=%d)\n", | 2934 | dev_info(&dev->intf->dev, "Identified as %s (card=%d)\n", |
2935 | dev->board.name, dev->model); | 2935 | dev->board.name, dev->model); |
2936 | 2936 | ||
2937 | dev->tuner_type = em28xx_boards[dev->model].tuner_type; | 2937 | dev->tuner_type = em28xx_boards[dev->model].tuner_type; |
@@ -3030,7 +3030,7 @@ static void em28xx_card_setup(struct em28xx *dev) | |||
3030 | } | 3030 | } |
3031 | 3031 | ||
3032 | if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { | 3032 | if (dev->board.valid == EM28XX_BOARD_NOT_VALIDATED) { |
3033 | dev_err(&dev->udev->dev, | 3033 | dev_err(&dev->intf->dev, |
3034 | "\n\n" | 3034 | "\n\n" |
3035 | "The support for this board weren't valid yet.\n" | 3035 | "The support for this board weren't valid yet.\n" |
3036 | "Please send a report of having this working\n" | 3036 | "Please send a report of having this working\n" |
@@ -3161,7 +3161,7 @@ static int em28xx_media_device_init(struct em28xx *dev, | |||
3161 | else if (udev->manufacturer) | 3161 | else if (udev->manufacturer) |
3162 | media_device_usb_init(mdev, udev, udev->manufacturer); | 3162 | media_device_usb_init(mdev, udev, udev->manufacturer); |
3163 | else | 3163 | else |
3164 | media_device_usb_init(mdev, udev, dev_name(&dev->udev->dev)); | 3164 | media_device_usb_init(mdev, udev, dev_name(&dev->intf->dev)); |
3165 | 3165 | ||
3166 | dev->media_dev = mdev; | 3166 | dev->media_dev = mdev; |
3167 | #endif | 3167 | #endif |
@@ -3217,7 +3217,7 @@ void em28xx_free_device(struct kref *ref) | |||
3217 | { | 3217 | { |
3218 | struct em28xx *dev = kref_to_dev(ref); | 3218 | struct em28xx *dev = kref_to_dev(ref); |
3219 | 3219 | ||
3220 | dev_info(&dev->udev->dev, "Freeing device\n"); | 3220 | dev_info(&dev->intf->dev, "Freeing device\n"); |
3221 | 3221 | ||
3222 | if (!dev->disconnected) | 3222 | if (!dev->disconnected) |
3223 | em28xx_release_resources(dev); | 3223 | em28xx_release_resources(dev); |
@@ -3239,6 +3239,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, | |||
3239 | const char *chip_name = NULL; | 3239 | const char *chip_name = NULL; |
3240 | 3240 | ||
3241 | dev->udev = udev; | 3241 | dev->udev = udev; |
3242 | dev->intf = interface; | ||
3242 | mutex_init(&dev->ctrl_urb_lock); | 3243 | mutex_init(&dev->ctrl_urb_lock); |
3243 | spin_lock_init(&dev->slock); | 3244 | spin_lock_init(&dev->slock); |
3244 | 3245 | ||
@@ -3324,10 +3325,10 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, | |||
3324 | } | 3325 | } |
3325 | } | 3326 | } |
3326 | if (!chip_name) | 3327 | if (!chip_name) |
3327 | dev_info(&dev->udev->dev, | 3328 | dev_info(&dev->intf->dev, |
3328 | "unknown em28xx chip ID (%d)\n", dev->chip_id); | 3329 | "unknown em28xx chip ID (%d)\n", dev->chip_id); |
3329 | else | 3330 | else |
3330 | dev_info(&dev->udev->dev, "chip ID is %s\n", chip_name); | 3331 | dev_info(&dev->intf->dev, "chip ID is %s\n", chip_name); |
3331 | 3332 | ||
3332 | em28xx_media_device_init(dev, udev); | 3333 | em28xx_media_device_init(dev, udev); |
3333 | 3334 | ||
@@ -3346,7 +3347,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, | |||
3346 | /* Resets I2C speed */ | 3347 | /* Resets I2C speed */ |
3347 | retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); | 3348 | retval = em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); |
3348 | if (retval < 0) { | 3349 | if (retval < 0) { |
3349 | dev_err(&dev->udev->dev, | 3350 | dev_err(&dev->intf->dev, |
3350 | "%s: em28xx_write_reg failed! retval [%d]\n", | 3351 | "%s: em28xx_write_reg failed! retval [%d]\n", |
3351 | __func__, retval); | 3352 | __func__, retval); |
3352 | return retval; | 3353 | return retval; |
@@ -3361,7 +3362,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, | |||
3361 | else | 3362 | else |
3362 | retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX); | 3363 | retval = em28xx_i2c_register(dev, 0, EM28XX_I2C_ALGO_EM28XX); |
3363 | if (retval < 0) { | 3364 | if (retval < 0) { |
3364 | dev_err(&dev->udev->dev, | 3365 | dev_err(&dev->intf->dev, |
3365 | "%s: em28xx_i2c_register bus 0 - error [%d]!\n", | 3366 | "%s: em28xx_i2c_register bus 0 - error [%d]!\n", |
3366 | __func__, retval); | 3367 | __func__, retval); |
3367 | return retval; | 3368 | return retval; |
@@ -3376,7 +3377,7 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, | |||
3376 | retval = em28xx_i2c_register(dev, 1, | 3377 | retval = em28xx_i2c_register(dev, 1, |
3377 | EM28XX_I2C_ALGO_EM28XX); | 3378 | EM28XX_I2C_ALGO_EM28XX); |
3378 | if (retval < 0) { | 3379 | if (retval < 0) { |
3379 | dev_err(&dev->udev->dev, | 3380 | dev_err(&dev->intf->dev, |
3380 | "%s: em28xx_i2c_register bus 1 - error [%d]!\n", | 3381 | "%s: em28xx_i2c_register bus 1 - error [%d]!\n", |
3381 | __func__, retval); | 3382 | __func__, retval); |
3382 | 3383 | ||
@@ -3417,7 +3418,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3417 | nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS); | 3418 | nr = find_first_zero_bit(em28xx_devused, EM28XX_MAXBOARDS); |
3418 | if (nr >= EM28XX_MAXBOARDS) { | 3419 | if (nr >= EM28XX_MAXBOARDS) { |
3419 | /* No free device slots */ | 3420 | /* No free device slots */ |
3420 | dev_err(&udev->dev, | 3421 | dev_err(&interface->dev, |
3421 | "Driver supports up to %i em28xx boards.\n", | 3422 | "Driver supports up to %i em28xx boards.\n", |
3422 | EM28XX_MAXBOARDS); | 3423 | EM28XX_MAXBOARDS); |
3423 | retval = -ENOMEM; | 3424 | retval = -ENOMEM; |
@@ -3427,7 +3428,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3427 | 3428 | ||
3428 | /* Don't register audio interfaces */ | 3429 | /* Don't register audio interfaces */ |
3429 | if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { | 3430 | if (interface->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { |
3430 | dev_err(&udev->dev, | 3431 | dev_err(&interface->dev, |
3431 | "audio device (%04x:%04x): interface %i, class %i\n", | 3432 | "audio device (%04x:%04x): interface %i, class %i\n", |
3432 | le16_to_cpu(udev->descriptor.idVendor), | 3433 | le16_to_cpu(udev->descriptor.idVendor), |
3433 | le16_to_cpu(udev->descriptor.idProduct), | 3434 | le16_to_cpu(udev->descriptor.idProduct), |
@@ -3488,7 +3489,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3488 | if (usb_endpoint_xfer_isoc(e)) { | 3489 | if (usb_endpoint_xfer_isoc(e)) { |
3489 | has_vendor_audio = true; | 3490 | has_vendor_audio = true; |
3490 | } else { | 3491 | } else { |
3491 | dev_err(&udev->dev, | 3492 | dev_err(&interface->dev, |
3492 | "error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); | 3493 | "error: skipping audio endpoint 0x83, because it uses bulk transfers !\n"); |
3493 | } | 3494 | } |
3494 | break; | 3495 | break; |
@@ -3562,7 +3563,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3562 | speed = "unknown"; | 3563 | speed = "unknown"; |
3563 | } | 3564 | } |
3564 | 3565 | ||
3565 | dev_err(&udev->dev, | 3566 | dev_err(&interface->dev, |
3566 | "New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n", | 3567 | "New device %s %s @ %s Mbps (%04x:%04x, interface %d, class %d)\n", |
3567 | udev->manufacturer ? udev->manufacturer : "", | 3568 | udev->manufacturer ? udev->manufacturer : "", |
3568 | udev->product ? udev->product : "", | 3569 | udev->product ? udev->product : "", |
@@ -3578,8 +3579,8 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3578 | * not enough even for most Digital TV streams. | 3579 | * not enough even for most Digital TV streams. |
3579 | */ | 3580 | */ |
3580 | if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { | 3581 | if (udev->speed != USB_SPEED_HIGH && disable_usb_speed_check == 0) { |
3581 | dev_err(&udev->dev, "Device initialization failed.\n"); | 3582 | dev_err(&interface->dev, "Device initialization failed.\n"); |
3582 | dev_err(&udev->dev, | 3583 | dev_err(&interface->dev, |
3583 | "Device must be connected to a high-speed USB 2.0 port.\n"); | 3584 | "Device must be connected to a high-speed USB 2.0 port.\n"); |
3584 | retval = -ENODEV; | 3585 | retval = -ENODEV; |
3585 | goto err_free; | 3586 | goto err_free; |
@@ -3593,7 +3594,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3593 | dev->ifnum = ifnum; | 3594 | dev->ifnum = ifnum; |
3594 | 3595 | ||
3595 | if (has_vendor_audio) { | 3596 | if (has_vendor_audio) { |
3596 | dev_err(&udev->dev, | 3597 | dev_err(&interface->dev, |
3597 | "Audio interface %i found (Vendor Class)\n", ifnum); | 3598 | "Audio interface %i found (Vendor Class)\n", ifnum); |
3598 | dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; | 3599 | dev->usb_audio_type = EM28XX_USB_AUDIO_VENDOR; |
3599 | } | 3600 | } |
@@ -3603,7 +3604,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3603 | 3604 | ||
3604 | if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { | 3605 | if (uif->altsetting[0].desc.bInterfaceClass == USB_CLASS_AUDIO) { |
3605 | if (has_vendor_audio) | 3606 | if (has_vendor_audio) |
3606 | dev_err(&udev->dev, | 3607 | dev_err(&interface->dev, |
3607 | "em28xx: device seems to have vendor AND usb audio class interfaces !\n" | 3608 | "em28xx: device seems to have vendor AND usb audio class interfaces !\n" |
3608 | "\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n"); | 3609 | "\t\tThe vendor interface will be ignored. Please contact the developers <linux-media@vger.kernel.org>\n"); |
3609 | dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS; | 3610 | dev->usb_audio_type = EM28XX_USB_AUDIO_CLASS; |
@@ -3612,12 +3613,12 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3612 | } | 3613 | } |
3613 | 3614 | ||
3614 | if (has_video) | 3615 | if (has_video) |
3615 | dev_err(&udev->dev, "Video interface %i found:%s%s\n", | 3616 | dev_err(&interface->dev, "Video interface %i found:%s%s\n", |
3616 | ifnum, | 3617 | ifnum, |
3617 | dev->analog_ep_bulk ? " bulk" : "", | 3618 | dev->analog_ep_bulk ? " bulk" : "", |
3618 | dev->analog_ep_isoc ? " isoc" : ""); | 3619 | dev->analog_ep_isoc ? " isoc" : ""); |
3619 | if (has_dvb) | 3620 | if (has_dvb) |
3620 | dev_err(&udev->dev, "DVB interface %i found:%s%s\n", | 3621 | dev_err(&interface->dev, "DVB interface %i found:%s%s\n", |
3621 | ifnum, | 3622 | ifnum, |
3622 | dev->dvb_ep_bulk ? " bulk" : "", | 3623 | dev->dvb_ep_bulk ? " bulk" : "", |
3623 | dev->dvb_ep_isoc ? " isoc" : ""); | 3624 | dev->dvb_ep_isoc ? " isoc" : ""); |
@@ -3649,7 +3650,7 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3649 | /* Disable V4L2 if the device doesn't have a decoder */ | 3650 | /* Disable V4L2 if the device doesn't have a decoder */ |
3650 | if (has_video && | 3651 | if (has_video && |
3651 | dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) { | 3652 | dev->board.decoder == EM28XX_NODECODER && !dev->board.is_webcam) { |
3652 | dev_err(&udev->dev, | 3653 | dev_err(&interface->dev, |
3653 | "Currently, V4L2 is not supported on this model\n"); | 3654 | "Currently, V4L2 is not supported on this model\n"); |
3654 | has_video = false; | 3655 | has_video = false; |
3655 | dev->has_video = false; | 3656 | dev->has_video = false; |
@@ -3659,13 +3660,13 @@ static int em28xx_usb_probe(struct usb_interface *interface, | |||
3659 | if (has_video) { | 3660 | if (has_video) { |
3660 | if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) | 3661 | if (!dev->analog_ep_isoc || (try_bulk && dev->analog_ep_bulk)) |
3661 | dev->analog_xfer_bulk = 1; | 3662 | dev->analog_xfer_bulk = 1; |
3662 | dev_err(&udev->dev, "analog set to %s mode.\n", | 3663 | dev_err(&interface->dev, "analog set to %s mode.\n", |
3663 | dev->analog_xfer_bulk ? "bulk" : "isoc"); | 3664 | dev->analog_xfer_bulk ? "bulk" : "isoc"); |
3664 | } | 3665 | } |
3665 | if (has_dvb) { | 3666 | if (has_dvb) { |
3666 | if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) | 3667 | if (!dev->dvb_ep_isoc || (try_bulk && dev->dvb_ep_bulk)) |
3667 | dev->dvb_xfer_bulk = 1; | 3668 | dev->dvb_xfer_bulk = 1; |
3668 | dev_err(&udev->dev, "dvb set to %s mode.\n", | 3669 | dev_err(&interface->dev, "dvb set to %s mode.\n", |
3669 | dev->dvb_xfer_bulk ? "bulk" : "isoc"); | 3670 | dev->dvb_xfer_bulk ? "bulk" : "isoc"); |
3670 | } | 3671 | } |
3671 | 3672 | ||
@@ -3713,7 +3714,7 @@ static void em28xx_usb_disconnect(struct usb_interface *interface) | |||
3713 | 3714 | ||
3714 | dev->disconnected = 1; | 3715 | dev->disconnected = 1; |
3715 | 3716 | ||
3716 | dev_err(&dev->udev->dev, "Disconnecting\n"); | 3717 | dev_err(&dev->intf->dev, "Disconnecting\n"); |
3717 | 3718 | ||
3718 | flush_request_modules(dev); | 3719 | flush_request_modules(dev); |
3719 | 3720 | ||
diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 7f1fe5d9d685..f1b4681f3c90 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c | |||
@@ -52,7 +52,7 @@ MODULE_PARM_DESC(core_debug, "enable debug messages [core and isoc]"); | |||
52 | 52 | ||
53 | #define em28xx_coredbg(fmt, arg...) do { \ | 53 | #define em28xx_coredbg(fmt, arg...) do { \ |
54 | if (core_debug) \ | 54 | if (core_debug) \ |
55 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 55 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
56 | "core: %s: " fmt, __func__, ## arg); \ | 56 | "core: %s: " fmt, __func__, ## arg); \ |
57 | } while (0) | 57 | } while (0) |
58 | 58 | ||
@@ -63,14 +63,14 @@ MODULE_PARM_DESC(reg_debug, "enable debug messages [URB reg]"); | |||
63 | 63 | ||
64 | #define em28xx_regdbg(fmt, arg...) do { \ | 64 | #define em28xx_regdbg(fmt, arg...) do { \ |
65 | if (reg_debug) \ | 65 | if (reg_debug) \ |
66 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 66 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
67 | "reg: %s: " fmt, __func__, ## arg); \ | 67 | "reg: %s: " fmt, __func__, ## arg); \ |
68 | } while (0) | 68 | } while (0) |
69 | 69 | ||
70 | /* FIXME: don't abuse core_debug */ | 70 | /* FIXME: don't abuse core_debug */ |
71 | #define em28xx_isocdbg(fmt, arg...) do { \ | 71 | #define em28xx_isocdbg(fmt, arg...) do { \ |
72 | if (core_debug) \ | 72 | if (core_debug) \ |
73 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 73 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
74 | "core: %s: " fmt, __func__, ## arg); \ | 74 | "core: %s: " fmt, __func__, ## arg); \ |
75 | } while (0) | 75 | } while (0) |
76 | 76 | ||
@@ -258,7 +258,7 @@ static int em28xx_is_ac97_ready(struct em28xx *dev) | |||
258 | msleep(5); | 258 | msleep(5); |
259 | } | 259 | } |
260 | 260 | ||
261 | dev_warn(&dev->udev->dev, | 261 | dev_warn(&dev->intf->dev, |
262 | "AC97 command still being executed: not handled properly!\n"); | 262 | "AC97 command still being executed: not handled properly!\n"); |
263 | return -EBUSY; | 263 | return -EBUSY; |
264 | } | 264 | } |
@@ -352,7 +352,7 @@ static int set_ac97_input(struct em28xx *dev) | |||
352 | ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); | 352 | ret = em28xx_write_ac97(dev, inputs[i].reg, 0x8000); |
353 | 353 | ||
354 | if (ret < 0) | 354 | if (ret < 0) |
355 | dev_warn(&dev->udev->dev, | 355 | dev_warn(&dev->intf->dev, |
356 | "couldn't setup AC97 register %d\n", | 356 | "couldn't setup AC97 register %d\n", |
357 | inputs[i].reg); | 357 | inputs[i].reg); |
358 | } | 358 | } |
@@ -437,7 +437,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) | |||
437 | for (i = 0; i < ARRAY_SIZE(outputs); i++) { | 437 | for (i = 0; i < ARRAY_SIZE(outputs); i++) { |
438 | ret = em28xx_write_ac97(dev, outputs[i].reg, 0x8000); | 438 | ret = em28xx_write_ac97(dev, outputs[i].reg, 0x8000); |
439 | if (ret < 0) | 439 | if (ret < 0) |
440 | dev_warn(&dev->udev->dev, | 440 | dev_warn(&dev->intf->dev, |
441 | "couldn't setup AC97 register %d\n", | 441 | "couldn't setup AC97 register %d\n", |
442 | outputs[i].reg); | 442 | outputs[i].reg); |
443 | } | 443 | } |
@@ -476,7 +476,7 @@ int em28xx_audio_analog_set(struct em28xx *dev) | |||
476 | ret = em28xx_write_ac97(dev, outputs[i].reg, | 476 | ret = em28xx_write_ac97(dev, outputs[i].reg, |
477 | vol); | 477 | vol); |
478 | if (ret < 0) | 478 | if (ret < 0) |
479 | dev_warn(&dev->udev->dev, | 479 | dev_warn(&dev->intf->dev, |
480 | "couldn't setup AC97 register %d\n", | 480 | "couldn't setup AC97 register %d\n", |
481 | outputs[i].reg); | 481 | outputs[i].reg); |
482 | } | 482 | } |
@@ -514,7 +514,7 @@ int em28xx_audio_setup(struct em28xx *dev) | |||
514 | 514 | ||
515 | /* See how this device is configured */ | 515 | /* See how this device is configured */ |
516 | cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG); | 516 | cfg = em28xx_read_reg(dev, EM28XX_R00_CHIPCFG); |
517 | dev_info(&dev->udev->dev, "Config register raw data: 0x%02x\n", cfg); | 517 | dev_info(&dev->intf->dev, "Config register raw data: 0x%02x\n", cfg); |
518 | if (cfg < 0) { /* Register read error */ | 518 | if (cfg < 0) { /* Register read error */ |
519 | /* Be conservative */ | 519 | /* Be conservative */ |
520 | dev->int_audio_type = EM28XX_INT_AUDIO_AC97; | 520 | dev->int_audio_type = EM28XX_INT_AUDIO_AC97; |
@@ -535,7 +535,7 @@ int em28xx_audio_setup(struct em28xx *dev) | |||
535 | i2s_samplerates = 5; | 535 | i2s_samplerates = 5; |
536 | else | 536 | else |
537 | i2s_samplerates = 3; | 537 | i2s_samplerates = 3; |
538 | dev_info(&dev->udev->dev, "I2S Audio (%d sample rate(s))\n", | 538 | dev_info(&dev->intf->dev, "I2S Audio (%d sample rate(s))\n", |
539 | i2s_samplerates); | 539 | i2s_samplerates); |
540 | /* Skip the code that does AC97 vendor detection */ | 540 | /* Skip the code that does AC97 vendor detection */ |
541 | dev->audio_mode.ac97 = EM28XX_NO_AC97; | 541 | dev->audio_mode.ac97 = EM28XX_NO_AC97; |
@@ -553,7 +553,7 @@ int em28xx_audio_setup(struct em28xx *dev) | |||
553 | * Note: (some) em2800 devices without eeprom reports 0x91 on | 553 | * Note: (some) em2800 devices without eeprom reports 0x91 on |
554 | * CHIPCFG register, even not having an AC97 chip | 554 | * CHIPCFG register, even not having an AC97 chip |
555 | */ | 555 | */ |
556 | dev_warn(&dev->udev->dev, | 556 | dev_warn(&dev->intf->dev, |
557 | "AC97 chip type couldn't be determined\n"); | 557 | "AC97 chip type couldn't be determined\n"); |
558 | dev->audio_mode.ac97 = EM28XX_NO_AC97; | 558 | dev->audio_mode.ac97 = EM28XX_NO_AC97; |
559 | if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR) | 559 | if (dev->usb_audio_type == EM28XX_USB_AUDIO_VENDOR) |
@@ -567,13 +567,13 @@ int em28xx_audio_setup(struct em28xx *dev) | |||
567 | goto init_audio; | 567 | goto init_audio; |
568 | 568 | ||
569 | vid = vid1 << 16 | vid2; | 569 | vid = vid1 << 16 | vid2; |
570 | dev_warn(&dev->udev->dev, "AC97 vendor ID = 0x%08x\n", vid); | 570 | dev_warn(&dev->intf->dev, "AC97 vendor ID = 0x%08x\n", vid); |
571 | 571 | ||
572 | feat = em28xx_read_ac97(dev, AC97_RESET); | 572 | feat = em28xx_read_ac97(dev, AC97_RESET); |
573 | if (feat < 0) | 573 | if (feat < 0) |
574 | goto init_audio; | 574 | goto init_audio; |
575 | 575 | ||
576 | dev_warn(&dev->udev->dev, "AC97 features = 0x%04x\n", feat); | 576 | dev_warn(&dev->intf->dev, "AC97 features = 0x%04x\n", feat); |
577 | 577 | ||
578 | /* Try to identify what audio processor we have */ | 578 | /* Try to identify what audio processor we have */ |
579 | if (((vid == 0xffffffff) || (vid == 0x83847650)) && (feat == 0x6a90)) | 579 | if (((vid == 0xffffffff) || (vid == 0x83847650)) && (feat == 0x6a90)) |
@@ -585,19 +585,19 @@ init_audio: | |||
585 | /* Reports detected AC97 processor */ | 585 | /* Reports detected AC97 processor */ |
586 | switch (dev->audio_mode.ac97) { | 586 | switch (dev->audio_mode.ac97) { |
587 | case EM28XX_NO_AC97: | 587 | case EM28XX_NO_AC97: |
588 | dev_info(&dev->udev->dev, "No AC97 audio processor\n"); | 588 | dev_info(&dev->intf->dev, "No AC97 audio processor\n"); |
589 | break; | 589 | break; |
590 | case EM28XX_AC97_EM202: | 590 | case EM28XX_AC97_EM202: |
591 | dev_info(&dev->udev->dev, | 591 | dev_info(&dev->intf->dev, |
592 | "Empia 202 AC97 audio processor detected\n"); | 592 | "Empia 202 AC97 audio processor detected\n"); |
593 | break; | 593 | break; |
594 | case EM28XX_AC97_SIGMATEL: | 594 | case EM28XX_AC97_SIGMATEL: |
595 | dev_info(&dev->udev->dev, | 595 | dev_info(&dev->intf->dev, |
596 | "Sigmatel audio processor detected (stac 97%02x)\n", | 596 | "Sigmatel audio processor detected (stac 97%02x)\n", |
597 | vid & 0xff); | 597 | vid & 0xff); |
598 | break; | 598 | break; |
599 | case EM28XX_AC97_OTHER: | 599 | case EM28XX_AC97_OTHER: |
600 | dev_warn(&dev->udev->dev, | 600 | dev_warn(&dev->intf->dev, |
601 | "Unknown AC97 audio processor detected!\n"); | 601 | "Unknown AC97 audio processor detected!\n"); |
602 | break; | 602 | break; |
603 | default: | 603 | default: |
@@ -882,7 +882,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, | |||
882 | if (mode == EM28XX_DIGITAL_MODE) { | 882 | if (mode == EM28XX_DIGITAL_MODE) { |
883 | if ((xfer_bulk && !dev->dvb_ep_bulk) || | 883 | if ((xfer_bulk && !dev->dvb_ep_bulk) || |
884 | (!xfer_bulk && !dev->dvb_ep_isoc)) { | 884 | (!xfer_bulk && !dev->dvb_ep_isoc)) { |
885 | dev_err(&dev->udev->dev, | 885 | dev_err(&dev->intf->dev, |
886 | "no endpoint for DVB mode and transfer type %d\n", | 886 | "no endpoint for DVB mode and transfer type %d\n", |
887 | xfer_bulk > 0); | 887 | xfer_bulk > 0); |
888 | return -EINVAL; | 888 | return -EINVAL; |
@@ -891,14 +891,14 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, | |||
891 | } else if (mode == EM28XX_ANALOG_MODE) { | 891 | } else if (mode == EM28XX_ANALOG_MODE) { |
892 | if ((xfer_bulk && !dev->analog_ep_bulk) || | 892 | if ((xfer_bulk && !dev->analog_ep_bulk) || |
893 | (!xfer_bulk && !dev->analog_ep_isoc)) { | 893 | (!xfer_bulk && !dev->analog_ep_isoc)) { |
894 | dev_err(&dev->udev->dev, | 894 | dev_err(&dev->intf->dev, |
895 | "no endpoint for analog mode and transfer type %d\n", | 895 | "no endpoint for analog mode and transfer type %d\n", |
896 | xfer_bulk > 0); | 896 | xfer_bulk > 0); |
897 | return -EINVAL; | 897 | return -EINVAL; |
898 | } | 898 | } |
899 | usb_bufs = &dev->usb_ctl.analog_bufs; | 899 | usb_bufs = &dev->usb_ctl.analog_bufs; |
900 | } else { | 900 | } else { |
901 | dev_err(&dev->udev->dev, "invalid mode selected\n"); | 901 | dev_err(&dev->intf->dev, "invalid mode selected\n"); |
902 | return -EINVAL; | 902 | return -EINVAL; |
903 | } | 903 | } |
904 | 904 | ||
@@ -940,7 +940,7 @@ int em28xx_alloc_urbs(struct em28xx *dev, enum em28xx_mode mode, int xfer_bulk, | |||
940 | usb_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev, | 940 | usb_bufs->transfer_buffer[i] = usb_alloc_coherent(dev->udev, |
941 | sb_size, GFP_KERNEL, &urb->transfer_dma); | 941 | sb_size, GFP_KERNEL, &urb->transfer_dma); |
942 | if (!usb_bufs->transfer_buffer[i]) { | 942 | if (!usb_bufs->transfer_buffer[i]) { |
943 | dev_err(&dev->udev->dev, | 943 | dev_err(&dev->intf->dev, |
944 | "unable to allocate %i bytes for transfer buffer %i%s\n", | 944 | "unable to allocate %i bytes for transfer buffer %i%s\n", |
945 | sb_size, i, | 945 | sb_size, i, |
946 | in_interrupt() ? " while in int" : ""); | 946 | in_interrupt() ? " while in int" : ""); |
@@ -1023,7 +1023,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode, | |||
1023 | if (xfer_bulk) { | 1023 | if (xfer_bulk) { |
1024 | rc = usb_clear_halt(dev->udev, usb_bufs->urb[0]->pipe); | 1024 | rc = usb_clear_halt(dev->udev, usb_bufs->urb[0]->pipe); |
1025 | if (rc < 0) { | 1025 | if (rc < 0) { |
1026 | dev_err(&dev->udev->dev, | 1026 | dev_err(&dev->intf->dev, |
1027 | "failed to clear USB bulk endpoint stall/halt condition (error=%i)\n", | 1027 | "failed to clear USB bulk endpoint stall/halt condition (error=%i)\n", |
1028 | rc); | 1028 | rc); |
1029 | em28xx_uninit_usb_xfer(dev, mode); | 1029 | em28xx_uninit_usb_xfer(dev, mode); |
@@ -1040,7 +1040,7 @@ int em28xx_init_usb_xfer(struct em28xx *dev, enum em28xx_mode mode, | |||
1040 | for (i = 0; i < usb_bufs->num_bufs; i++) { | 1040 | for (i = 0; i < usb_bufs->num_bufs; i++) { |
1041 | rc = usb_submit_urb(usb_bufs->urb[i], GFP_ATOMIC); | 1041 | rc = usb_submit_urb(usb_bufs->urb[i], GFP_ATOMIC); |
1042 | if (rc) { | 1042 | if (rc) { |
1043 | dev_err(&dev->udev->dev, | 1043 | dev_err(&dev->intf->dev, |
1044 | "submit of urb %i failed (error=%i)\n", i, rc); | 1044 | "submit of urb %i failed (error=%i)\n", i, rc); |
1045 | em28xx_uninit_usb_xfer(dev, mode); | 1045 | em28xx_uninit_usb_xfer(dev, mode); |
1046 | return rc; | 1046 | return rc; |
@@ -1123,7 +1123,7 @@ int em28xx_suspend_extension(struct em28xx *dev) | |||
1123 | { | 1123 | { |
1124 | const struct em28xx_ops *ops = NULL; | 1124 | const struct em28xx_ops *ops = NULL; |
1125 | 1125 | ||
1126 | dev_info(&dev->udev->dev, "Suspending extensions\n"); | 1126 | dev_info(&dev->intf->dev, "Suspending extensions\n"); |
1127 | mutex_lock(&em28xx_devlist_mutex); | 1127 | mutex_lock(&em28xx_devlist_mutex); |
1128 | list_for_each_entry(ops, &em28xx_extension_devlist, next) { | 1128 | list_for_each_entry(ops, &em28xx_extension_devlist, next) { |
1129 | if (ops->suspend) | 1129 | if (ops->suspend) |
@@ -1137,7 +1137,7 @@ int em28xx_resume_extension(struct em28xx *dev) | |||
1137 | { | 1137 | { |
1138 | const struct em28xx_ops *ops = NULL; | 1138 | const struct em28xx_ops *ops = NULL; |
1139 | 1139 | ||
1140 | dev_info(&dev->udev->dev, "Resuming extensions\n"); | 1140 | dev_info(&dev->intf->dev, "Resuming extensions\n"); |
1141 | mutex_lock(&em28xx_devlist_mutex); | 1141 | mutex_lock(&em28xx_devlist_mutex); |
1142 | list_for_each_entry(ops, &em28xx_extension_devlist, next) { | 1142 | list_for_each_entry(ops, &em28xx_extension_devlist, next) { |
1143 | if (ops->resume) | 1143 | if (ops->resume) |
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 445e51db636f..d7cfcbe3bf19 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c | |||
@@ -75,7 +75,7 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); | |||
75 | 75 | ||
76 | #define dprintk(level, fmt, arg...) do { \ | 76 | #define dprintk(level, fmt, arg...) do { \ |
77 | if (debug >= level) \ | 77 | if (debug >= level) \ |
78 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 78 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
79 | "dvb: " fmt, ## arg); \ | 79 | "dvb: " fmt, ## arg); \ |
80 | } while (0) | 80 | } while (0) |
81 | 81 | ||
@@ -736,13 +736,13 @@ static int em28xx_pctv_290e_set_lna(struct dvb_frontend *fe) | |||
736 | 736 | ||
737 | ret = gpio_request_one(dvb->lna_gpio, flags, NULL); | 737 | ret = gpio_request_one(dvb->lna_gpio, flags, NULL); |
738 | if (ret) | 738 | if (ret) |
739 | dev_err(&dev->udev->dev, "gpio request failed %d\n", ret); | 739 | dev_err(&dev->intf->dev, "gpio request failed %d\n", ret); |
740 | else | 740 | else |
741 | gpio_free(dvb->lna_gpio); | 741 | gpio_free(dvb->lna_gpio); |
742 | 742 | ||
743 | return ret; | 743 | return ret; |
744 | #else | 744 | #else |
745 | dev_warn(&dev->udev->dev, "%s: LNA control is disabled (lna=%u)\n", | 745 | dev_warn(&dev->intf->dev, "%s: LNA control is disabled (lna=%u)\n", |
746 | KBUILD_MODNAME, c->lna); | 746 | KBUILD_MODNAME, c->lna); |
747 | return 0; | 747 | return 0; |
748 | #endif | 748 | #endif |
@@ -936,20 +936,20 @@ static int em28xx_attach_xc3028(u8 addr, struct em28xx *dev) | |||
936 | cfg.ctrl = &ctl; | 936 | cfg.ctrl = &ctl; |
937 | 937 | ||
938 | if (!dev->dvb->fe[0]) { | 938 | if (!dev->dvb->fe[0]) { |
939 | dev_err(&dev->udev->dev, | 939 | dev_err(&dev->intf->dev, |
940 | "dvb frontend not attached. Can't attach xc3028\n"); | 940 | "dvb frontend not attached. Can't attach xc3028\n"); |
941 | return -EINVAL; | 941 | return -EINVAL; |
942 | } | 942 | } |
943 | 943 | ||
944 | fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg); | 944 | fe = dvb_attach(xc2028_attach, dev->dvb->fe[0], &cfg); |
945 | if (!fe) { | 945 | if (!fe) { |
946 | dev_err(&dev->udev->dev, "xc3028 attach failed\n"); | 946 | dev_err(&dev->intf->dev, "xc3028 attach failed\n"); |
947 | dvb_frontend_detach(dev->dvb->fe[0]); | 947 | dvb_frontend_detach(dev->dvb->fe[0]); |
948 | dev->dvb->fe[0] = NULL; | 948 | dev->dvb->fe[0] = NULL; |
949 | return -EINVAL; | 949 | return -EINVAL; |
950 | } | 950 | } |
951 | 951 | ||
952 | dev_info(&dev->udev->dev, "xc3028 attached\n"); | 952 | dev_info(&dev->intf->dev, "xc3028 attached\n"); |
953 | 953 | ||
954 | return 0; | 954 | return 0; |
955 | } | 955 | } |
@@ -966,10 +966,10 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
966 | 966 | ||
967 | /* register adapter */ | 967 | /* register adapter */ |
968 | result = dvb_register_adapter(&dvb->adapter, | 968 | result = dvb_register_adapter(&dvb->adapter, |
969 | dev_name(&dev->udev->dev), module, | 969 | dev_name(&dev->intf->dev), module, |
970 | device, adapter_nr); | 970 | device, adapter_nr); |
971 | if (result < 0) { | 971 | if (result < 0) { |
972 | dev_warn(&dev->udev->dev, | 972 | dev_warn(&dev->intf->dev, |
973 | "dvb_register_adapter failed (errno = %d)\n", | 973 | "dvb_register_adapter failed (errno = %d)\n", |
974 | result); | 974 | result); |
975 | goto fail_adapter; | 975 | goto fail_adapter; |
@@ -988,7 +988,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
988 | /* register frontend */ | 988 | /* register frontend */ |
989 | result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]); | 989 | result = dvb_register_frontend(&dvb->adapter, dvb->fe[0]); |
990 | if (result < 0) { | 990 | if (result < 0) { |
991 | dev_warn(&dev->udev->dev, | 991 | dev_warn(&dev->intf->dev, |
992 | "dvb_register_frontend failed (errno = %d)\n", | 992 | "dvb_register_frontend failed (errno = %d)\n", |
993 | result); | 993 | result); |
994 | goto fail_frontend0; | 994 | goto fail_frontend0; |
@@ -998,7 +998,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
998 | if (dvb->fe[1]) { | 998 | if (dvb->fe[1]) { |
999 | result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]); | 999 | result = dvb_register_frontend(&dvb->adapter, dvb->fe[1]); |
1000 | if (result < 0) { | 1000 | if (result < 0) { |
1001 | dev_warn(&dev->udev->dev, | 1001 | dev_warn(&dev->intf->dev, |
1002 | "2nd dvb_register_frontend failed (errno = %d)\n", | 1002 | "2nd dvb_register_frontend failed (errno = %d)\n", |
1003 | result); | 1003 | result); |
1004 | goto fail_frontend1; | 1004 | goto fail_frontend1; |
@@ -1017,7 +1017,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
1017 | 1017 | ||
1018 | result = dvb_dmx_init(&dvb->demux); | 1018 | result = dvb_dmx_init(&dvb->demux); |
1019 | if (result < 0) { | 1019 | if (result < 0) { |
1020 | dev_warn(&dev->udev->dev, | 1020 | dev_warn(&dev->intf->dev, |
1021 | "dvb_dmx_init failed (errno = %d)\n", | 1021 | "dvb_dmx_init failed (errno = %d)\n", |
1022 | result); | 1022 | result); |
1023 | goto fail_dmx; | 1023 | goto fail_dmx; |
@@ -1028,7 +1028,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
1028 | dvb->dmxdev.capabilities = 0; | 1028 | dvb->dmxdev.capabilities = 0; |
1029 | result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); | 1029 | result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); |
1030 | if (result < 0) { | 1030 | if (result < 0) { |
1031 | dev_warn(&dev->udev->dev, | 1031 | dev_warn(&dev->intf->dev, |
1032 | "dvb_dmxdev_init failed (errno = %d)\n", | 1032 | "dvb_dmxdev_init failed (errno = %d)\n", |
1033 | result); | 1033 | result); |
1034 | goto fail_dmxdev; | 1034 | goto fail_dmxdev; |
@@ -1037,7 +1037,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
1037 | dvb->fe_hw.source = DMX_FRONTEND_0; | 1037 | dvb->fe_hw.source = DMX_FRONTEND_0; |
1038 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); | 1038 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_hw); |
1039 | if (result < 0) { | 1039 | if (result < 0) { |
1040 | dev_warn(&dev->udev->dev, | 1040 | dev_warn(&dev->intf->dev, |
1041 | "add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", | 1041 | "add_frontend failed (DMX_FRONTEND_0, errno = %d)\n", |
1042 | result); | 1042 | result); |
1043 | goto fail_fe_hw; | 1043 | goto fail_fe_hw; |
@@ -1046,7 +1046,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
1046 | dvb->fe_mem.source = DMX_MEMORY_FE; | 1046 | dvb->fe_mem.source = DMX_MEMORY_FE; |
1047 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); | 1047 | result = dvb->demux.dmx.add_frontend(&dvb->demux.dmx, &dvb->fe_mem); |
1048 | if (result < 0) { | 1048 | if (result < 0) { |
1049 | dev_warn(&dev->udev->dev, | 1049 | dev_warn(&dev->intf->dev, |
1050 | "add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", | 1050 | "add_frontend failed (DMX_MEMORY_FE, errno = %d)\n", |
1051 | result); | 1051 | result); |
1052 | goto fail_fe_mem; | 1052 | goto fail_fe_mem; |
@@ -1054,7 +1054,7 @@ static int em28xx_register_dvb(struct em28xx_dvb *dvb, struct module *module, | |||
1054 | 1054 | ||
1055 | result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); | 1055 | result = dvb->demux.dmx.connect_frontend(&dvb->demux.dmx, &dvb->fe_hw); |
1056 | if (result < 0) { | 1056 | if (result < 0) { |
1057 | dev_warn(&dev->udev->dev, | 1057 | dev_warn(&dev->intf->dev, |
1058 | "connect_frontend failed (errno = %d)\n", | 1058 | "connect_frontend failed (errno = %d)\n", |
1059 | result); | 1059 | result); |
1060 | goto fail_fe_conn; | 1060 | goto fail_fe_conn; |
@@ -1128,7 +1128,7 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1128 | return 0; | 1128 | return 0; |
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | dev_info(&dev->udev->dev, "Binding DVB extension\n"); | 1131 | dev_info(&dev->intf->dev, "Binding DVB extension\n"); |
1132 | 1132 | ||
1133 | dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL); | 1133 | dvb = kzalloc(sizeof(struct em28xx_dvb), GFP_KERNEL); |
1134 | if (!dvb) | 1134 | if (!dvb) |
@@ -1152,7 +1152,7 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1152 | EM28XX_DVB_NUM_ISOC_PACKETS); | 1152 | EM28XX_DVB_NUM_ISOC_PACKETS); |
1153 | } | 1153 | } |
1154 | if (result) { | 1154 | if (result) { |
1155 | dev_err(&dev->udev->dev, | 1155 | dev_err(&dev->intf->dev, |
1156 | "failed to pre-allocate USB transfer buffers for DVB.\n"); | 1156 | "failed to pre-allocate USB transfer buffers for DVB.\n"); |
1157 | kfree(dvb); | 1157 | kfree(dvb); |
1158 | dev->dvb = NULL; | 1158 | dev->dvb = NULL; |
@@ -1270,7 +1270,8 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1270 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: | 1270 | case EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900_R2: |
1271 | case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E: | 1271 | case EM2882_BOARD_PINNACLE_HYBRID_PRO_330E: |
1272 | dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL, | 1272 | dvb->fe[0] = dvb_attach(drxd_attach, &em28xx_drxd, NULL, |
1273 | &dev->i2c_adap[dev->def_i2c_bus], &dev->udev->dev); | 1273 | &dev->i2c_adap[dev->def_i2c_bus], |
1274 | &dev->intf->dev); | ||
1274 | if (em28xx_attach_xc3028(0x61, dev) < 0) { | 1275 | if (em28xx_attach_xc3028(0x61, dev) < 0) { |
1275 | result = -EINVAL; | 1276 | result = -EINVAL; |
1276 | goto out_free; | 1277 | goto out_free; |
@@ -1332,7 +1333,7 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1332 | result = gpio_request_one(dvb->lna_gpio, | 1333 | result = gpio_request_one(dvb->lna_gpio, |
1333 | GPIOF_OUT_INIT_LOW, NULL); | 1334 | GPIOF_OUT_INIT_LOW, NULL); |
1334 | if (result) | 1335 | if (result) |
1335 | dev_err(&dev->udev->dev, | 1336 | dev_err(&dev->intf->dev, |
1336 | "gpio request failed %d\n", | 1337 | "gpio request failed %d\n", |
1337 | result); | 1338 | result); |
1338 | else | 1339 | else |
@@ -1949,12 +1950,12 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1949 | } | 1950 | } |
1950 | break; | 1951 | break; |
1951 | default: | 1952 | default: |
1952 | dev_err(&dev->udev->dev, | 1953 | dev_err(&dev->intf->dev, |
1953 | "The frontend of your DVB/ATSC card isn't supported yet\n"); | 1954 | "The frontend of your DVB/ATSC card isn't supported yet\n"); |
1954 | break; | 1955 | break; |
1955 | } | 1956 | } |
1956 | if (NULL == dvb->fe[0]) { | 1957 | if (NULL == dvb->fe[0]) { |
1957 | dev_err(&dev->udev->dev, "frontend initialization failed\n"); | 1958 | dev_err(&dev->intf->dev, "frontend initialization failed\n"); |
1958 | result = -EINVAL; | 1959 | result = -EINVAL; |
1959 | goto out_free; | 1960 | goto out_free; |
1960 | } | 1961 | } |
@@ -1964,12 +1965,12 @@ static int em28xx_dvb_init(struct em28xx *dev) | |||
1964 | dvb->fe[1]->callback = em28xx_tuner_callback; | 1965 | dvb->fe[1]->callback = em28xx_tuner_callback; |
1965 | 1966 | ||
1966 | /* register everything */ | 1967 | /* register everything */ |
1967 | result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->udev->dev); | 1968 | result = em28xx_register_dvb(dvb, THIS_MODULE, dev, &dev->intf->dev); |
1968 | 1969 | ||
1969 | if (result < 0) | 1970 | if (result < 0) |
1970 | goto out_free; | 1971 | goto out_free; |
1971 | 1972 | ||
1972 | dev_info(&dev->udev->dev, "DVB extension successfully initialized\n"); | 1973 | dev_info(&dev->intf->dev, "DVB extension successfully initialized\n"); |
1973 | 1974 | ||
1974 | kref_get(&dev->ref); | 1975 | kref_get(&dev->ref); |
1975 | 1976 | ||
@@ -2009,7 +2010,7 @@ static int em28xx_dvb_fini(struct em28xx *dev) | |||
2009 | if (!dev->dvb) | 2010 | if (!dev->dvb) |
2010 | return 0; | 2011 | return 0; |
2011 | 2012 | ||
2012 | dev_info(&dev->udev->dev, "Closing DVB extension\n"); | 2013 | dev_info(&dev->intf->dev, "Closing DVB extension\n"); |
2013 | 2014 | ||
2014 | dvb = dev->dvb; | 2015 | dvb = dev->dvb; |
2015 | 2016 | ||
@@ -2067,17 +2068,17 @@ static int em28xx_dvb_suspend(struct em28xx *dev) | |||
2067 | if (!dev->board.has_dvb) | 2068 | if (!dev->board.has_dvb) |
2068 | return 0; | 2069 | return 0; |
2069 | 2070 | ||
2070 | dev_info(&dev->udev->dev, "Suspending DVB extension\n"); | 2071 | dev_info(&dev->intf->dev, "Suspending DVB extension\n"); |
2071 | if (dev->dvb) { | 2072 | if (dev->dvb) { |
2072 | struct em28xx_dvb *dvb = dev->dvb; | 2073 | struct em28xx_dvb *dvb = dev->dvb; |
2073 | 2074 | ||
2074 | if (dvb->fe[0]) { | 2075 | if (dvb->fe[0]) { |
2075 | ret = dvb_frontend_suspend(dvb->fe[0]); | 2076 | ret = dvb_frontend_suspend(dvb->fe[0]); |
2076 | dev_info(&dev->udev->dev, "fe0 suspend %d\n", ret); | 2077 | dev_info(&dev->intf->dev, "fe0 suspend %d\n", ret); |
2077 | } | 2078 | } |
2078 | if (dvb->fe[1]) { | 2079 | if (dvb->fe[1]) { |
2079 | dvb_frontend_suspend(dvb->fe[1]); | 2080 | dvb_frontend_suspend(dvb->fe[1]); |
2080 | dev_info(&dev->udev->dev, "fe1 suspend %d\n", ret); | 2081 | dev_info(&dev->intf->dev, "fe1 suspend %d\n", ret); |
2081 | } | 2082 | } |
2082 | } | 2083 | } |
2083 | 2084 | ||
@@ -2094,18 +2095,18 @@ static int em28xx_dvb_resume(struct em28xx *dev) | |||
2094 | if (!dev->board.has_dvb) | 2095 | if (!dev->board.has_dvb) |
2095 | return 0; | 2096 | return 0; |
2096 | 2097 | ||
2097 | dev_info(&dev->udev->dev, "Resuming DVB extension\n"); | 2098 | dev_info(&dev->intf->dev, "Resuming DVB extension\n"); |
2098 | if (dev->dvb) { | 2099 | if (dev->dvb) { |
2099 | struct em28xx_dvb *dvb = dev->dvb; | 2100 | struct em28xx_dvb *dvb = dev->dvb; |
2100 | 2101 | ||
2101 | if (dvb->fe[0]) { | 2102 | if (dvb->fe[0]) { |
2102 | ret = dvb_frontend_resume(dvb->fe[0]); | 2103 | ret = dvb_frontend_resume(dvb->fe[0]); |
2103 | dev_info(&dev->udev->dev, "fe0 resume %d\n", ret); | 2104 | dev_info(&dev->intf->dev, "fe0 resume %d\n", ret); |
2104 | } | 2105 | } |
2105 | 2106 | ||
2106 | if (dvb->fe[1]) { | 2107 | if (dvb->fe[1]) { |
2107 | ret = dvb_frontend_resume(dvb->fe[1]); | 2108 | ret = dvb_frontend_resume(dvb->fe[1]); |
2108 | dev_info(&dev->udev->dev, "fe1 resume %d\n", ret); | 2109 | dev_info(&dev->intf->dev, "fe1 resume %d\n", ret); |
2109 | } | 2110 | } |
2110 | } | 2111 | } |
2111 | 2112 | ||
diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index 00e39edc0837..8c472d5adb50 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c | |||
@@ -46,7 +46,7 @@ MODULE_PARM_DESC(i2c_debug, "i2c debug message level (1: normal debug, 2: show I | |||
46 | 46 | ||
47 | #define dprintk(level, fmt, arg...) do { \ | 47 | #define dprintk(level, fmt, arg...) do { \ |
48 | if (i2c_debug > level) \ | 48 | if (i2c_debug > level) \ |
49 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 49 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
50 | "i2c: %s: " fmt, __func__, ## arg); \ | 50 | "i2c: %s: " fmt, __func__, ## arg); \ |
51 | } while (0) | 51 | } while (0) |
52 | 52 | ||
@@ -78,7 +78,7 @@ static int em2800_i2c_send_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) | |||
78 | /* trigger write */ | 78 | /* trigger write */ |
79 | ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len); | 79 | ret = dev->em28xx_write_regs(dev, 4 - len, &b2[4 - len], 2 + len); |
80 | if (ret != 2 + len) { | 80 | if (ret != 2 + len) { |
81 | dev_warn(&dev->udev->dev, | 81 | dev_warn(&dev->intf->dev, |
82 | "failed to trigger write to i2c address 0x%x (error=%i)\n", | 82 | "failed to trigger write to i2c address 0x%x (error=%i)\n", |
83 | addr, ret); | 83 | addr, ret); |
84 | return (ret < 0) ? ret : -EIO; | 84 | 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 | return -ENXIO; | 93 | return -ENXIO; |
94 | } | 94 | } |
95 | if (ret < 0) { | 95 | if (ret < 0) { |
96 | dev_warn(&dev->udev->dev, | 96 | dev_warn(&dev->intf->dev, |
97 | "failed to get i2c transfer status from bridge register (error=%i)\n", | 97 | "failed to get i2c transfer status from bridge register (error=%i)\n", |
98 | ret); | 98 | ret); |
99 | return ret; | 99 | return ret; |
@@ -123,7 +123,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) | |||
123 | buf2[0] = addr; | 123 | buf2[0] = addr; |
124 | ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2); | 124 | ret = dev->em28xx_write_regs(dev, 0x04, buf2, 2); |
125 | if (ret != 2) { | 125 | if (ret != 2) { |
126 | dev_warn(&dev->udev->dev, | 126 | dev_warn(&dev->intf->dev, |
127 | "failed to trigger read from i2c address 0x%x (error=%i)\n", | 127 | "failed to trigger read from i2c address 0x%x (error=%i)\n", |
128 | addr, ret); | 128 | addr, ret); |
129 | return (ret < 0) ? ret : -EIO; | 129 | 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 | return -ENXIO; | 140 | return -ENXIO; |
141 | } | 141 | } |
142 | if (ret < 0) { | 142 | if (ret < 0) { |
143 | dev_warn(&dev->udev->dev, | 143 | dev_warn(&dev->intf->dev, |
144 | "failed to get i2c transfer status from bridge register (error=%i)\n", | 144 | "failed to get i2c transfer status from bridge register (error=%i)\n", |
145 | ret); | 145 | ret); |
146 | return ret; | 146 | return ret; |
@@ -154,7 +154,7 @@ static int em2800_i2c_recv_bytes(struct em28xx *dev, u8 addr, u8 *buf, u16 len) | |||
154 | /* get the received message */ | 154 | /* get the received message */ |
155 | ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len); | 155 | ret = dev->em28xx_read_reg_req_len(dev, 0x00, 4-len, buf2, len); |
156 | if (ret != len) { | 156 | if (ret != len) { |
157 | dev_warn(&dev->udev->dev, | 157 | dev_warn(&dev->intf->dev, |
158 | "reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n", | 158 | "reading from i2c device at 0x%x failed: couldn't get the received message from the bridge (error=%i)\n", |
159 | addr, ret); | 159 | addr, ret); |
160 | return (ret < 0) ? ret : -EIO; | 160 | return (ret < 0) ? ret : -EIO; |
@@ -200,12 +200,12 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, | |||
200 | ret = dev->em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len); | 200 | ret = dev->em28xx_write_regs_req(dev, stop ? 2 : 3, addr, buf, len); |
201 | if (ret != len) { | 201 | if (ret != len) { |
202 | if (ret < 0) { | 202 | if (ret < 0) { |
203 | dev_warn(&dev->udev->dev, | 203 | dev_warn(&dev->intf->dev, |
204 | "writing to i2c device at 0x%x failed (error=%i)\n", | 204 | "writing to i2c device at 0x%x failed (error=%i)\n", |
205 | addr, ret); | 205 | addr, ret); |
206 | return ret; | 206 | return ret; |
207 | } else { | 207 | } else { |
208 | dev_warn(&dev->udev->dev, | 208 | dev_warn(&dev->intf->dev, |
209 | "%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", | 209 | "%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", |
210 | len, addr, ret); | 210 | len, addr, ret); |
211 | return -EIO; | 211 | return -EIO; |
@@ -223,7 +223,7 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, | |||
223 | return -ENXIO; | 223 | return -ENXIO; |
224 | } | 224 | } |
225 | if (ret < 0) { | 225 | if (ret < 0) { |
226 | dev_warn(&dev->udev->dev, | 226 | dev_warn(&dev->intf->dev, |
227 | "failed to get i2c transfer status from bridge register (error=%i)\n", | 227 | "failed to get i2c transfer status from bridge register (error=%i)\n", |
228 | ret); | 228 | ret); |
229 | return ret; | 229 | return ret; |
@@ -244,7 +244,7 @@ static int em28xx_i2c_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, | |||
244 | return -ETIMEDOUT; | 244 | return -ETIMEDOUT; |
245 | } | 245 | } |
246 | 246 | ||
247 | dev_warn(&dev->udev->dev, | 247 | dev_warn(&dev->intf->dev, |
248 | "write to i2c device at 0x%x failed with unknown error (status=%i)\n", | 248 | "write to i2c device at 0x%x failed with unknown error (status=%i)\n", |
249 | addr, ret); | 249 | addr, ret); |
250 | return -EIO; | 250 | return -EIO; |
@@ -268,7 +268,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) | |||
268 | /* Read data from i2c device */ | 268 | /* Read data from i2c device */ |
269 | ret = dev->em28xx_read_reg_req_len(dev, 2, addr, buf, len); | 269 | ret = dev->em28xx_read_reg_req_len(dev, 2, addr, buf, len); |
270 | if (ret < 0) { | 270 | if (ret < 0) { |
271 | dev_warn(&dev->udev->dev, | 271 | dev_warn(&dev->intf->dev, |
272 | "reading from i2c device at 0x%x failed (error=%i)\n", | 272 | "reading from i2c device at 0x%x failed (error=%i)\n", |
273 | addr, ret); | 273 | addr, ret); |
274 | return ret; | 274 | return ret; |
@@ -287,7 +287,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) | |||
287 | if (ret == 0) /* success */ | 287 | if (ret == 0) /* success */ |
288 | return len; | 288 | return len; |
289 | if (ret < 0) { | 289 | if (ret < 0) { |
290 | dev_warn(&dev->udev->dev, | 290 | dev_warn(&dev->intf->dev, |
291 | "failed to get i2c transfer status from bridge register (error=%i)\n", | 291 | "failed to get i2c transfer status from bridge register (error=%i)\n", |
292 | ret); | 292 | ret); |
293 | return ret; | 293 | return ret; |
@@ -306,7 +306,7 @@ static int em28xx_i2c_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, u16 len) | |||
306 | return -ETIMEDOUT; | 306 | return -ETIMEDOUT; |
307 | } | 307 | } |
308 | 308 | ||
309 | dev_warn(&dev->udev->dev, | 309 | dev_warn(&dev->intf->dev, |
310 | "write to i2c device at 0x%x failed with unknown error (status=%i)\n", | 310 | "write to i2c device at 0x%x failed with unknown error (status=%i)\n", |
311 | addr, ret); | 311 | addr, ret); |
312 | return -EIO; | 312 | return -EIO; |
@@ -347,12 +347,12 @@ static int em25xx_bus_B_send_bytes(struct em28xx *dev, u16 addr, u8 *buf, | |||
347 | ret = dev->em28xx_write_regs_req(dev, 0x06, addr, buf, len); | 347 | ret = dev->em28xx_write_regs_req(dev, 0x06, addr, buf, len); |
348 | if (ret != len) { | 348 | if (ret != len) { |
349 | if (ret < 0) { | 349 | if (ret < 0) { |
350 | dev_warn(&dev->udev->dev, | 350 | dev_warn(&dev->intf->dev, |
351 | "writing to i2c device at 0x%x failed (error=%i)\n", | 351 | "writing to i2c device at 0x%x failed (error=%i)\n", |
352 | addr, ret); | 352 | addr, ret); |
353 | return ret; | 353 | return ret; |
354 | } else { | 354 | } else { |
355 | dev_warn(&dev->udev->dev, | 355 | dev_warn(&dev->intf->dev, |
356 | "%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", | 356 | "%i bytes write to i2c device at 0x%x requested, but %i bytes written\n", |
357 | len, addr, ret); | 357 | len, addr, ret); |
358 | return -EIO; | 358 | return -EIO; |
@@ -398,7 +398,7 @@ static int em25xx_bus_B_recv_bytes(struct em28xx *dev, u16 addr, u8 *buf, | |||
398 | /* Read value */ | 398 | /* Read value */ |
399 | ret = dev->em28xx_read_reg_req_len(dev, 0x06, addr, buf, len); | 399 | ret = dev->em28xx_read_reg_req_len(dev, 0x06, addr, buf, len); |
400 | if (ret < 0) { | 400 | if (ret < 0) { |
401 | dev_warn(&dev->udev->dev, | 401 | dev_warn(&dev->intf->dev, |
402 | "reading from i2c device at 0x%x failed (error=%i)\n", | 402 | "reading from i2c device at 0x%x failed (error=%i)\n", |
403 | addr, ret); | 403 | addr, ret); |
404 | return ret; | 404 | return ret; |
@@ -672,7 +672,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
672 | /* Check if board has eeprom */ | 672 | /* Check if board has eeprom */ |
673 | err = i2c_master_recv(&dev->i2c_client[bus], &buf, 0); | 673 | err = i2c_master_recv(&dev->i2c_client[bus], &buf, 0); |
674 | if (err < 0) { | 674 | if (err < 0) { |
675 | dev_info(&dev->udev->dev, "board has no eeprom\n"); | 675 | dev_info(&dev->intf->dev, "board has no eeprom\n"); |
676 | return -ENODEV; | 676 | return -ENODEV; |
677 | } | 677 | } |
678 | 678 | ||
@@ -685,7 +685,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
685 | dev->eeprom_addrwidth_16bit, | 685 | dev->eeprom_addrwidth_16bit, |
686 | len, data); | 686 | len, data); |
687 | if (err != len) { | 687 | if (err != len) { |
688 | dev_err(&dev->udev->dev, | 688 | dev_err(&dev->intf->dev, |
689 | "failed to read eeprom (err=%d)\n", err); | 689 | "failed to read eeprom (err=%d)\n", err); |
690 | goto error; | 690 | goto error; |
691 | } | 691 | } |
@@ -696,7 +696,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
696 | 16, 1, data, len, true); | 696 | 16, 1, data, len, true); |
697 | 697 | ||
698 | if (dev->eeprom_addrwidth_16bit) | 698 | if (dev->eeprom_addrwidth_16bit) |
699 | dev_info(&dev->udev->dev, | 699 | dev_info(&dev->intf->dev, |
700 | "eeprom %06x: ... (skipped)\n", 256); | 700 | "eeprom %06x: ... (skipped)\n", 256); |
701 | } | 701 | } |
702 | 702 | ||
@@ -709,12 +709,12 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
709 | dev->hash = em28xx_hash_mem(data, len, 32); | 709 | dev->hash = em28xx_hash_mem(data, len, 32); |
710 | mc_start = (data[1] << 8) + 4; /* usually 0x0004 */ | 710 | mc_start = (data[1] << 8) + 4; /* usually 0x0004 */ |
711 | 711 | ||
712 | dev_info(&dev->udev->dev, | 712 | dev_info(&dev->intf->dev, |
713 | "EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n", | 713 | "EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n", |
714 | data[0], data[1], data[2], data[3], dev->hash); | 714 | data[0], data[1], data[2], data[3], dev->hash); |
715 | dev_info(&dev->udev->dev, | 715 | dev_info(&dev->intf->dev, |
716 | "EEPROM info:\n"); | 716 | "EEPROM info:\n"); |
717 | dev_info(&dev->udev->dev, | 717 | dev_info(&dev->intf->dev, |
718 | "\tmicrocode start address = 0x%04x, boot configuration = 0x%02x\n", | 718 | "\tmicrocode start address = 0x%04x, boot configuration = 0x%02x\n", |
719 | mc_start, data[2]); | 719 | mc_start, data[2]); |
720 | /* | 720 | /* |
@@ -734,7 +734,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
734 | err = em28xx_i2c_read_block(dev, bus, mc_start + 46, 1, 2, | 734 | err = em28xx_i2c_read_block(dev, bus, mc_start + 46, 1, 2, |
735 | data); | 735 | data); |
736 | if (err != 2) { | 736 | if (err != 2) { |
737 | dev_err(&dev->udev->dev, | 737 | dev_err(&dev->intf->dev, |
738 | "failed to read hardware configuration data from eeprom (err=%d)\n", | 738 | "failed to read hardware configuration data from eeprom (err=%d)\n", |
739 | err); | 739 | err); |
740 | goto error; | 740 | goto error; |
@@ -753,7 +753,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
753 | err = em28xx_i2c_read_block(dev, bus, hwconf_offset, 1, len, | 753 | err = em28xx_i2c_read_block(dev, bus, hwconf_offset, 1, len, |
754 | data); | 754 | data); |
755 | if (err != len) { | 755 | if (err != len) { |
756 | dev_err(&dev->udev->dev, | 756 | dev_err(&dev->intf->dev, |
757 | "failed to read hardware configuration data from eeprom (err=%d)\n", | 757 | "failed to read hardware configuration data from eeprom (err=%d)\n", |
758 | err); | 758 | err); |
759 | goto error; | 759 | goto error; |
@@ -763,7 +763,7 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
763 | /* NOTE: not all devices provide this type of dataset */ | 763 | /* NOTE: not all devices provide this type of dataset */ |
764 | if (data[0] != 0x1a || data[1] != 0xeb || | 764 | if (data[0] != 0x1a || data[1] != 0xeb || |
765 | data[2] != 0x67 || data[3] != 0x95) { | 765 | data[2] != 0x67 || data[3] != 0x95) { |
766 | dev_info(&dev->udev->dev, | 766 | dev_info(&dev->intf->dev, |
767 | "\tno hardware configuration dataset found in eeprom\n"); | 767 | "\tno hardware configuration dataset found in eeprom\n"); |
768 | kfree(data); | 768 | kfree(data); |
769 | return 0; | 769 | return 0; |
@@ -775,13 +775,13 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
775 | data[0] == 0x1a && data[1] == 0xeb && | 775 | data[0] == 0x1a && data[1] == 0xeb && |
776 | data[2] == 0x67 && data[3] == 0x95) { | 776 | data[2] == 0x67 && data[3] == 0x95) { |
777 | dev->hash = em28xx_hash_mem(data, len, 32); | 777 | dev->hash = em28xx_hash_mem(data, len, 32); |
778 | dev_info(&dev->udev->dev, | 778 | dev_info(&dev->intf->dev, |
779 | "EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n", | 779 | "EEPROM ID = %02x %02x %02x %02x, EEPROM hash = 0x%08lx\n", |
780 | data[0], data[1], data[2], data[3], dev->hash); | 780 | data[0], data[1], data[2], data[3], dev->hash); |
781 | dev_info(&dev->udev->dev, | 781 | dev_info(&dev->intf->dev, |
782 | "EEPROM info:\n"); | 782 | "EEPROM info:\n"); |
783 | } else { | 783 | } else { |
784 | dev_info(&dev->udev->dev, | 784 | dev_info(&dev->intf->dev, |
785 | "unknown eeprom format or eeprom corrupted !\n"); | 785 | "unknown eeprom format or eeprom corrupted !\n"); |
786 | err = -ENODEV; | 786 | err = -ENODEV; |
787 | goto error; | 787 | goto error; |
@@ -793,50 +793,50 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned bus, | |||
793 | 793 | ||
794 | switch (le16_to_cpu(dev_config->chip_conf) >> 4 & 0x3) { | 794 | switch (le16_to_cpu(dev_config->chip_conf) >> 4 & 0x3) { |
795 | case 0: | 795 | case 0: |
796 | dev_info(&dev->udev->dev, "\tNo audio on board.\n"); | 796 | dev_info(&dev->intf->dev, "\tNo audio on board.\n"); |
797 | break; | 797 | break; |
798 | case 1: | 798 | case 1: |
799 | dev_info(&dev->udev->dev, "\tAC97 audio (5 sample rates)\n"); | 799 | dev_info(&dev->intf->dev, "\tAC97 audio (5 sample rates)\n"); |
800 | break; | 800 | break; |
801 | case 2: | 801 | case 2: |
802 | if (dev->chip_id < CHIP_ID_EM2860) | 802 | if (dev->chip_id < CHIP_ID_EM2860) |
803 | dev_info(&dev->udev->dev, | 803 | dev_info(&dev->intf->dev, |
804 | "\tI2S audio, sample rate=32k\n"); | 804 | "\tI2S audio, sample rate=32k\n"); |
805 | else | 805 | else |
806 | dev_info(&dev->udev->dev, | 806 | dev_info(&dev->intf->dev, |
807 | "\tI2S audio, 3 sample rates\n"); | 807 | "\tI2S audio, 3 sample rates\n"); |
808 | break; | 808 | break; |
809 | case 3: | 809 | case 3: |
810 | if (dev->chip_id < CHIP_ID_EM2860) | 810 | if (dev->chip_id < CHIP_ID_EM2860) |
811 | dev_info(&dev->udev->dev, | 811 | dev_info(&dev->intf->dev, |
812 | "\tI2S audio, 3 sample rates\n"); | 812 | "\tI2S audio, 3 sample rates\n"); |
813 | else | 813 | else |
814 | dev_info(&dev->udev->dev, | 814 | dev_info(&dev->intf->dev, |
815 | "\tI2S audio, 5 sample rates\n"); | 815 | "\tI2S audio, 5 sample rates\n"); |
816 | break; | 816 | break; |
817 | } | 817 | } |
818 | 818 | ||
819 | if (le16_to_cpu(dev_config->chip_conf) & 1 << 3) | 819 | if (le16_to_cpu(dev_config->chip_conf) & 1 << 3) |
820 | dev_info(&dev->udev->dev, "\tUSB Remote wakeup capable\n"); | 820 | dev_info(&dev->intf->dev, "\tUSB Remote wakeup capable\n"); |
821 | 821 | ||
822 | if (le16_to_cpu(dev_config->chip_conf) & 1 << 2) | 822 | if (le16_to_cpu(dev_config->chip_conf) & 1 << 2) |
823 | dev_info(&dev->udev->dev, "\tUSB Self power capable\n"); | 823 | dev_info(&dev->intf->dev, "\tUSB Self power capable\n"); |
824 | 824 | ||
825 | switch (le16_to_cpu(dev_config->chip_conf) & 0x3) { | 825 | switch (le16_to_cpu(dev_config->chip_conf) & 0x3) { |
826 | case 0: | 826 | case 0: |
827 | dev_info(&dev->udev->dev, "\t500mA max power\n"); | 827 | dev_info(&dev->intf->dev, "\t500mA max power\n"); |
828 | break; | 828 | break; |
829 | case 1: | 829 | case 1: |
830 | dev_info(&dev->udev->dev, "\t400mA max power\n"); | 830 | dev_info(&dev->intf->dev, "\t400mA max power\n"); |
831 | break; | 831 | break; |
832 | case 2: | 832 | case 2: |
833 | dev_info(&dev->udev->dev, "\t300mA max power\n"); | 833 | dev_info(&dev->intf->dev, "\t300mA max power\n"); |
834 | break; | 834 | break; |
835 | case 3: | 835 | case 3: |
836 | dev_info(&dev->udev->dev, "\t200mA max power\n"); | 836 | dev_info(&dev->intf->dev, "\t200mA max power\n"); |
837 | break; | 837 | break; |
838 | } | 838 | } |
839 | dev_info(&dev->udev->dev, | 839 | dev_info(&dev->intf->dev, |
840 | "\tTable at offset 0x%02x, strings=0x%04x, 0x%04x, 0x%04x\n", | 840 | "\tTable at offset 0x%02x, strings=0x%04x, 0x%04x, 0x%04x\n", |
841 | dev_config->string_idx_table, | 841 | dev_config->string_idx_table, |
842 | le16_to_cpu(dev_config->string1), | 842 | le16_to_cpu(dev_config->string1), |
@@ -930,7 +930,7 @@ void em28xx_do_i2c_scan(struct em28xx *dev, unsigned bus) | |||
930 | if (rc < 0) | 930 | if (rc < 0) |
931 | continue; | 931 | continue; |
932 | i2c_devicelist[i] = i; | 932 | i2c_devicelist[i] = i; |
933 | dev_info(&dev->udev->dev, | 933 | dev_info(&dev->intf->dev, |
934 | "found i2c device @ 0x%x on bus %d [%s]\n", | 934 | "found i2c device @ 0x%x on bus %d [%s]\n", |
935 | i << 1, bus, i2c_devs[i] ? i2c_devs[i] : "???"); | 935 | i << 1, bus, i2c_devs[i] ? i2c_devs[i] : "???"); |
936 | } | 936 | } |
@@ -956,8 +956,8 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus, | |||
956 | return -ENODEV; | 956 | return -ENODEV; |
957 | 957 | ||
958 | dev->i2c_adap[bus] = em28xx_adap_template; | 958 | dev->i2c_adap[bus] = em28xx_adap_template; |
959 | dev->i2c_adap[bus].dev.parent = &dev->udev->dev; | 959 | dev->i2c_adap[bus].dev.parent = &dev->intf->dev; |
960 | strcpy(dev->i2c_adap[bus].name, dev_name(&dev->udev->dev)); | 960 | strcpy(dev->i2c_adap[bus].name, dev_name(&dev->intf->dev)); |
961 | 961 | ||
962 | dev->i2c_bus[bus].bus = bus; | 962 | dev->i2c_bus[bus].bus = bus; |
963 | dev->i2c_bus[bus].algo_type = algo_type; | 963 | dev->i2c_bus[bus].algo_type = algo_type; |
@@ -966,7 +966,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus, | |||
966 | 966 | ||
967 | retval = i2c_add_adapter(&dev->i2c_adap[bus]); | 967 | retval = i2c_add_adapter(&dev->i2c_adap[bus]); |
968 | if (retval < 0) { | 968 | if (retval < 0) { |
969 | dev_err(&dev->udev->dev, | 969 | dev_err(&dev->intf->dev, |
970 | "%s: i2c_add_adapter failed! retval [%d]\n", | 970 | "%s: i2c_add_adapter failed! retval [%d]\n", |
971 | __func__, retval); | 971 | __func__, retval); |
972 | return retval; | 972 | return retval; |
@@ -979,7 +979,7 @@ int em28xx_i2c_register(struct em28xx *dev, unsigned bus, | |||
979 | if (!bus) { | 979 | if (!bus) { |
980 | retval = em28xx_i2c_eeprom(dev, bus, &dev->eedata, &dev->eedata_len); | 980 | retval = em28xx_i2c_eeprom(dev, bus, &dev->eedata, &dev->eedata_len); |
981 | if ((retval < 0) && (retval != -ENODEV)) { | 981 | if ((retval < 0) && (retval != -ENODEV)) { |
982 | dev_err(&dev->udev->dev, | 982 | dev_err(&dev->intf->dev, |
983 | "%s: em28xx_i2_eeprom failed! retval [%d]\n", | 983 | "%s: em28xx_i2_eeprom failed! retval [%d]\n", |
984 | __func__, retval); | 984 | __func__, retval); |
985 | 985 | ||
diff --git a/drivers/media/usb/em28xx/em28xx-input.c b/drivers/media/usb/em28xx/em28xx-input.c index a1904e2230ea..0082ea6d6c08 100644 --- a/drivers/media/usb/em28xx/em28xx-input.c +++ b/drivers/media/usb/em28xx/em28xx-input.c | |||
@@ -43,7 +43,7 @@ MODULE_PARM_DESC(ir_debug, "enable debug messages [IR]"); | |||
43 | 43 | ||
44 | #define dprintk( fmt, arg...) do { \ | 44 | #define dprintk( fmt, arg...) do { \ |
45 | if (ir_debug) \ | 45 | if (ir_debug) \ |
46 | dev_printk(KERN_DEBUG, &ir->dev->udev->dev, \ | 46 | dev_printk(KERN_DEBUG, &ir->dev->intf->dev, \ |
47 | "input: %s: " fmt, __func__, ## arg); \ | 47 | "input: %s: " fmt, __func__, ## arg); \ |
48 | } while (0) | 48 | } while (0) |
49 | 49 | ||
@@ -459,7 +459,7 @@ static int em28xx_ir_change_protocol(struct rc_dev *rc_dev, u64 *rc_type) | |||
459 | case CHIP_ID_EM28178: | 459 | case CHIP_ID_EM28178: |
460 | return em2874_ir_change_protocol(rc_dev, rc_type); | 460 | return em2874_ir_change_protocol(rc_dev, rc_type); |
461 | default: | 461 | default: |
462 | dev_err(&ir->dev->udev->dev, | 462 | dev_err(&ir->dev->intf->dev, |
463 | "Unrecognized em28xx chip id 0x%02x: IR not supported\n", | 463 | "Unrecognized em28xx chip id 0x%02x: IR not supported\n", |
464 | dev->chip_id); | 464 | dev->chip_id); |
465 | return -EINVAL; | 465 | return -EINVAL; |
@@ -569,7 +569,7 @@ static int em28xx_register_snapshot_button(struct em28xx *dev) | |||
569 | struct input_dev *input_dev; | 569 | struct input_dev *input_dev; |
570 | int err; | 570 | int err; |
571 | 571 | ||
572 | dev_info(&dev->udev->dev, "Registering snapshot button...\n"); | 572 | dev_info(&dev->intf->dev, "Registering snapshot button...\n"); |
573 | input_dev = input_allocate_device(); | 573 | input_dev = input_allocate_device(); |
574 | if (!input_dev) | 574 | if (!input_dev) |
575 | return -ENOMEM; | 575 | return -ENOMEM; |
@@ -589,11 +589,11 @@ static int em28xx_register_snapshot_button(struct em28xx *dev) | |||
589 | input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); | 589 | input_dev->id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); |
590 | input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct); | 590 | input_dev->id.product = le16_to_cpu(dev->udev->descriptor.idProduct); |
591 | input_dev->id.version = 1; | 591 | input_dev->id.version = 1; |
592 | input_dev->dev.parent = &dev->udev->dev; | 592 | input_dev->dev.parent = &dev->intf->dev; |
593 | 593 | ||
594 | err = input_register_device(input_dev); | 594 | err = input_register_device(input_dev); |
595 | if (err) { | 595 | if (err) { |
596 | dev_err(&dev->udev->dev, "input_register_device failed\n"); | 596 | dev_err(&dev->intf->dev, "input_register_device failed\n"); |
597 | input_free_device(input_dev); | 597 | input_free_device(input_dev); |
598 | return err; | 598 | return err; |
599 | } | 599 | } |
@@ -633,7 +633,7 @@ static void em28xx_init_buttons(struct em28xx *dev) | |||
633 | } else if (button->role == EM28XX_BUTTON_ILLUMINATION) { | 633 | } else if (button->role == EM28XX_BUTTON_ILLUMINATION) { |
634 | /* Check sanity */ | 634 | /* Check sanity */ |
635 | if (!em28xx_find_led(dev, EM28XX_LED_ILLUMINATION)) { | 635 | if (!em28xx_find_led(dev, EM28XX_LED_ILLUMINATION)) { |
636 | dev_err(&dev->udev->dev, | 636 | dev_err(&dev->intf->dev, |
637 | "BUG: illumination button defined, but no illumination LED.\n"); | 637 | "BUG: illumination button defined, but no illumination LED.\n"); |
638 | goto next_button; | 638 | goto next_button; |
639 | } | 639 | } |
@@ -670,7 +670,7 @@ static void em28xx_shutdown_buttons(struct em28xx *dev) | |||
670 | dev->num_button_polling_addresses = 0; | 670 | dev->num_button_polling_addresses = 0; |
671 | /* Deregister input devices */ | 671 | /* Deregister input devices */ |
672 | if (dev->sbutton_input_dev != NULL) { | 672 | if (dev->sbutton_input_dev != NULL) { |
673 | dev_info(&dev->udev->dev, "Deregistering snapshot button\n"); | 673 | dev_info(&dev->intf->dev, "Deregistering snapshot button\n"); |
674 | input_unregister_device(dev->sbutton_input_dev); | 674 | input_unregister_device(dev->sbutton_input_dev); |
675 | dev->sbutton_input_dev = NULL; | 675 | dev->sbutton_input_dev = NULL; |
676 | } | 676 | } |
@@ -699,7 +699,7 @@ static int em28xx_ir_init(struct em28xx *dev) | |||
699 | i2c_rc_dev_addr = em28xx_probe_i2c_ir(dev); | 699 | i2c_rc_dev_addr = em28xx_probe_i2c_ir(dev); |
700 | if (!i2c_rc_dev_addr) { | 700 | if (!i2c_rc_dev_addr) { |
701 | dev->board.has_ir_i2c = 0; | 701 | dev->board.has_ir_i2c = 0; |
702 | dev_warn(&dev->udev->dev, | 702 | dev_warn(&dev->intf->dev, |
703 | "No i2c IR remote control device found.\n"); | 703 | "No i2c IR remote control device found.\n"); |
704 | return -ENODEV; | 704 | return -ENODEV; |
705 | } | 705 | } |
@@ -707,12 +707,12 @@ static int em28xx_ir_init(struct em28xx *dev) | |||
707 | 707 | ||
708 | if (dev->board.ir_codes == NULL && !dev->board.has_ir_i2c) { | 708 | if (dev->board.ir_codes == NULL && !dev->board.has_ir_i2c) { |
709 | /* No remote control support */ | 709 | /* No remote control support */ |
710 | dev_warn(&dev->udev->dev, | 710 | dev_warn(&dev->intf->dev, |
711 | "Remote control support is not available for this card.\n"); | 711 | "Remote control support is not available for this card.\n"); |
712 | return 0; | 712 | return 0; |
713 | } | 713 | } |
714 | 714 | ||
715 | dev_info(&dev->udev->dev, "Registering input extension\n"); | 715 | dev_info(&dev->intf->dev, "Registering input extension\n"); |
716 | 716 | ||
717 | ir = kzalloc(sizeof(*ir), GFP_KERNEL); | 717 | ir = kzalloc(sizeof(*ir), GFP_KERNEL); |
718 | if (!ir) | 718 | if (!ir) |
@@ -797,7 +797,7 @@ static int em28xx_ir_init(struct em28xx *dev) | |||
797 | 797 | ||
798 | /* init input device */ | 798 | /* init input device */ |
799 | snprintf(ir->name, sizeof(ir->name), "%s IR", | 799 | snprintf(ir->name, sizeof(ir->name), "%s IR", |
800 | dev_name(&dev->udev->dev)); | 800 | dev_name(&dev->intf->dev)); |
801 | 801 | ||
802 | usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); | 802 | usb_make_path(dev->udev, ir->phys, sizeof(ir->phys)); |
803 | strlcat(ir->phys, "/input0", sizeof(ir->phys)); | 803 | strlcat(ir->phys, "/input0", sizeof(ir->phys)); |
@@ -808,7 +808,7 @@ static int em28xx_ir_init(struct em28xx *dev) | |||
808 | rc->input_id.version = 1; | 808 | rc->input_id.version = 1; |
809 | rc->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); | 809 | rc->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor); |
810 | rc->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct); | 810 | rc->input_id.product = le16_to_cpu(dev->udev->descriptor.idProduct); |
811 | rc->dev.parent = &dev->udev->dev; | 811 | rc->dev.parent = &dev->intf->dev; |
812 | rc->driver_name = MODULE_NAME; | 812 | rc->driver_name = MODULE_NAME; |
813 | 813 | ||
814 | /* all done */ | 814 | /* all done */ |
@@ -816,7 +816,7 @@ static int em28xx_ir_init(struct em28xx *dev) | |||
816 | if (err) | 816 | if (err) |
817 | goto error; | 817 | goto error; |
818 | 818 | ||
819 | dev_info(&dev->udev->dev, "Input extension successfully initalized\n"); | 819 | dev_info(&dev->intf->dev, "Input extension successfully initalized\n"); |
820 | 820 | ||
821 | return 0; | 821 | return 0; |
822 | 822 | ||
@@ -837,7 +837,7 @@ static int em28xx_ir_fini(struct em28xx *dev) | |||
837 | return 0; | 837 | return 0; |
838 | } | 838 | } |
839 | 839 | ||
840 | dev_info(&dev->udev->dev, "Closing input extension\n"); | 840 | dev_info(&dev->intf->dev, "Closing input extension\n"); |
841 | 841 | ||
842 | em28xx_shutdown_buttons(dev); | 842 | em28xx_shutdown_buttons(dev); |
843 | 843 | ||
@@ -866,7 +866,7 @@ static int em28xx_ir_suspend(struct em28xx *dev) | |||
866 | if (dev->is_audio_only) | 866 | if (dev->is_audio_only) |
867 | return 0; | 867 | return 0; |
868 | 868 | ||
869 | dev_info(&dev->udev->dev, "Suspending input extension\n"); | 869 | dev_info(&dev->intf->dev, "Suspending input extension\n"); |
870 | if (ir) | 870 | if (ir) |
871 | cancel_delayed_work_sync(&ir->work); | 871 | cancel_delayed_work_sync(&ir->work); |
872 | cancel_delayed_work_sync(&dev->buttons_query_work); | 872 | cancel_delayed_work_sync(&dev->buttons_query_work); |
@@ -883,7 +883,7 @@ static int em28xx_ir_resume(struct em28xx *dev) | |||
883 | if (dev->is_audio_only) | 883 | if (dev->is_audio_only) |
884 | return 0; | 884 | return 0; |
885 | 885 | ||
886 | dev_info(&dev->udev->dev, "Resuming input extension\n"); | 886 | dev_info(&dev->intf->dev, "Resuming input extension\n"); |
887 | /* if suspend calls ir_raw_event_unregister(), the should call | 887 | /* if suspend calls ir_raw_event_unregister(), the should call |
888 | ir_raw_event_register() */ | 888 | ir_raw_event_register() */ |
889 | if (ir) | 889 | if (ir) |
diff --git a/drivers/media/usb/em28xx/em28xx-vbi.c b/drivers/media/usb/em28xx/em28xx-vbi.c index 1b21d001cc7e..0bac552bbe87 100644 --- a/drivers/media/usb/em28xx/em28xx-vbi.c +++ b/drivers/media/usb/em28xx/em28xx-vbi.c | |||
@@ -65,7 +65,7 @@ static int vbi_buffer_prepare(struct vb2_buffer *vb) | |||
65 | size = v4l2->vbi_width * v4l2->vbi_height * 2; | 65 | size = v4l2->vbi_width * v4l2->vbi_height * 2; |
66 | 66 | ||
67 | if (vb2_plane_size(vb, 0) < size) { | 67 | if (vb2_plane_size(vb, 0) < size) { |
68 | dev_info(&dev->udev->dev, | 68 | dev_info(&dev->intf->dev, |
69 | "%s data will not fit into plane (%lu < %lu)\n", | 69 | "%s data will not fit into plane (%lu < %lu)\n", |
70 | __func__, vb2_plane_size(vb, 0), size); | 70 | __func__, vb2_plane_size(vb, 0), size); |
71 | return -EINVAL; | 71 | return -EINVAL; |
diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c index 2d282ed9aac0..4780f6492329 100644 --- a/drivers/media/usb/em28xx/em28xx-video.c +++ b/drivers/media/usb/em28xx/em28xx-video.c | |||
@@ -66,13 +66,13 @@ MODULE_PARM_DESC(alt, "alternate setting to use for video endpoint"); | |||
66 | 66 | ||
67 | #define em28xx_videodbg(fmt, arg...) do { \ | 67 | #define em28xx_videodbg(fmt, arg...) do { \ |
68 | if (video_debug) \ | 68 | if (video_debug) \ |
69 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 69 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
70 | "video: %s: " fmt, __func__, ## arg); \ | 70 | "video: %s: " fmt, __func__, ## arg); \ |
71 | } while (0) | 71 | } while (0) |
72 | 72 | ||
73 | #define em28xx_isocdbg(fmt, arg...) do {\ | 73 | #define em28xx_isocdbg(fmt, arg...) do {\ |
74 | if (isoc_debug) \ | 74 | if (isoc_debug) \ |
75 | dev_printk(KERN_DEBUG, &dev->udev->dev, \ | 75 | dev_printk(KERN_DEBUG, &dev->intf->dev, \ |
76 | "isoc: %s: " fmt, __func__, ## arg); \ | 76 | "isoc: %s: " fmt, __func__, ## arg); \ |
77 | } while (0) | 77 | } while (0) |
78 | 78 | ||
@@ -413,7 +413,7 @@ set_alt: | |||
413 | dev->alt, dev->max_pkt_size); | 413 | dev->alt, dev->max_pkt_size); |
414 | errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt); | 414 | errCode = usb_set_interface(dev->udev, dev->ifnum, dev->alt); |
415 | if (errCode < 0) { | 415 | if (errCode < 0) { |
416 | dev_err(&dev->udev->dev, | 416 | dev_err(&dev->intf->dev, |
417 | "cannot change alternate number to %d (error=%i)\n", | 417 | "cannot change alternate number to %d (error=%i)\n", |
418 | dev->alt, errCode); | 418 | dev->alt, errCode); |
419 | return errCode; | 419 | return errCode; |
@@ -926,7 +926,7 @@ static int em28xx_enable_analog_tuner(struct em28xx *dev) | |||
926 | 926 | ||
927 | ret = media_entity_setup_link(link, flags); | 927 | ret = media_entity_setup_link(link, flags); |
928 | if (ret) { | 928 | if (ret) { |
929 | dev_err(&dev->udev->dev, | 929 | dev_err(&dev->intf->dev, |
930 | "Couldn't change link %s->%s to %s. Error %d\n", | 930 | "Couldn't change link %s->%s to %s. Error %d\n", |
931 | source->name, sink->name, | 931 | source->name, sink->name, |
932 | flags ? "enabled" : "disabled", | 932 | flags ? "enabled" : "disabled", |
@@ -958,7 +958,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev) | |||
958 | v4l2->video_pad.flags = MEDIA_PAD_FL_SINK; | 958 | v4l2->video_pad.flags = MEDIA_PAD_FL_SINK; |
959 | ret = media_entity_pads_init(&v4l2->vdev.entity, 1, &v4l2->video_pad); | 959 | ret = media_entity_pads_init(&v4l2->vdev.entity, 1, &v4l2->video_pad); |
960 | if (ret < 0) | 960 | if (ret < 0) |
961 | dev_err(&dev->udev->dev, | 961 | dev_err(&dev->intf->dev, |
962 | "failed to initialize video media entity!\n"); | 962 | "failed to initialize video media entity!\n"); |
963 | 963 | ||
964 | if (em28xx_vbi_supported(dev)) { | 964 | if (em28xx_vbi_supported(dev)) { |
@@ -966,7 +966,7 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev) | |||
966 | ret = media_entity_pads_init(&v4l2->vbi_dev.entity, 1, | 966 | ret = media_entity_pads_init(&v4l2->vbi_dev.entity, 1, |
967 | &v4l2->vbi_pad); | 967 | &v4l2->vbi_pad); |
968 | if (ret < 0) | 968 | if (ret < 0) |
969 | dev_err(&dev->udev->dev, | 969 | dev_err(&dev->intf->dev, |
970 | "failed to initialize vbi media entity!\n"); | 970 | "failed to initialize vbi media entity!\n"); |
971 | } | 971 | } |
972 | 972 | ||
@@ -1000,12 +1000,12 @@ static void em28xx_v4l2_create_entities(struct em28xx *dev) | |||
1000 | 1000 | ||
1001 | ret = media_entity_pads_init(ent, 1, &dev->input_pad[i]); | 1001 | ret = media_entity_pads_init(ent, 1, &dev->input_pad[i]); |
1002 | if (ret < 0) | 1002 | if (ret < 0) |
1003 | dev_err(&dev->udev->dev, | 1003 | dev_err(&dev->intf->dev, |
1004 | "failed to initialize input pad[%d]!\n", i); | 1004 | "failed to initialize input pad[%d]!\n", i); |
1005 | 1005 | ||
1006 | ret = media_device_register_entity(dev->media_dev, ent); | 1006 | ret = media_device_register_entity(dev->media_dev, ent); |
1007 | if (ret < 0) | 1007 | if (ret < 0) |
1008 | dev_err(&dev->udev->dev, | 1008 | dev_err(&dev->intf->dev, |
1009 | "failed to register input entity %d!\n", i); | 1009 | "failed to register input entity %d!\n", i); |
1010 | } | 1010 | } |
1011 | #endif | 1011 | #endif |
@@ -2053,7 +2053,7 @@ static int em28xx_v4l2_open(struct file *filp) | |||
2053 | 2053 | ||
2054 | ret = v4l2_fh_open(filp); | 2054 | ret = v4l2_fh_open(filp); |
2055 | if (ret) { | 2055 | if (ret) { |
2056 | dev_err(&dev->udev->dev, | 2056 | dev_err(&dev->intf->dev, |
2057 | "%s: v4l2_fh_open() returned error %d\n", | 2057 | "%s: v4l2_fh_open() returned error %d\n", |
2058 | __func__, ret); | 2058 | __func__, ret); |
2059 | mutex_unlock(&dev->lock); | 2059 | mutex_unlock(&dev->lock); |
@@ -2109,7 +2109,7 @@ static int em28xx_v4l2_fini(struct em28xx *dev) | |||
2109 | if (v4l2 == NULL) | 2109 | if (v4l2 == NULL) |
2110 | return 0; | 2110 | return 0; |
2111 | 2111 | ||
2112 | dev_info(&dev->udev->dev, "Closing video extension\n"); | 2112 | dev_info(&dev->intf->dev, "Closing video extension\n"); |
2113 | 2113 | ||
2114 | mutex_lock(&dev->lock); | 2114 | mutex_lock(&dev->lock); |
2115 | 2115 | ||
@@ -2120,17 +2120,17 @@ static int em28xx_v4l2_fini(struct em28xx *dev) | |||
2120 | em28xx_v4l2_media_release(dev); | 2120 | em28xx_v4l2_media_release(dev); |
2121 | 2121 | ||
2122 | if (video_is_registered(&v4l2->radio_dev)) { | 2122 | if (video_is_registered(&v4l2->radio_dev)) { |
2123 | dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", | 2123 | dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n", |
2124 | video_device_node_name(&v4l2->radio_dev)); | 2124 | video_device_node_name(&v4l2->radio_dev)); |
2125 | video_unregister_device(&v4l2->radio_dev); | 2125 | video_unregister_device(&v4l2->radio_dev); |
2126 | } | 2126 | } |
2127 | if (video_is_registered(&v4l2->vbi_dev)) { | 2127 | if (video_is_registered(&v4l2->vbi_dev)) { |
2128 | dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", | 2128 | dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n", |
2129 | video_device_node_name(&v4l2->vbi_dev)); | 2129 | video_device_node_name(&v4l2->vbi_dev)); |
2130 | video_unregister_device(&v4l2->vbi_dev); | 2130 | video_unregister_device(&v4l2->vbi_dev); |
2131 | } | 2131 | } |
2132 | if (video_is_registered(&v4l2->vdev)) { | 2132 | if (video_is_registered(&v4l2->vdev)) { |
2133 | dev_info(&dev->udev->dev, "V4L2 device %s deregistered\n", | 2133 | dev_info(&dev->intf->dev, "V4L2 device %s deregistered\n", |
2134 | video_device_node_name(&v4l2->vdev)); | 2134 | video_device_node_name(&v4l2->vdev)); |
2135 | video_unregister_device(&v4l2->vdev); | 2135 | video_unregister_device(&v4l2->vdev); |
2136 | } | 2136 | } |
@@ -2160,7 +2160,7 @@ static int em28xx_v4l2_suspend(struct em28xx *dev) | |||
2160 | if (!dev->has_video) | 2160 | if (!dev->has_video) |
2161 | return 0; | 2161 | return 0; |
2162 | 2162 | ||
2163 | dev_info(&dev->udev->dev, "Suspending video extension\n"); | 2163 | dev_info(&dev->intf->dev, "Suspending video extension\n"); |
2164 | em28xx_stop_urbs(dev); | 2164 | em28xx_stop_urbs(dev); |
2165 | return 0; | 2165 | return 0; |
2166 | } | 2166 | } |
@@ -2173,7 +2173,7 @@ static int em28xx_v4l2_resume(struct em28xx *dev) | |||
2173 | if (!dev->has_video) | 2173 | if (!dev->has_video) |
2174 | return 0; | 2174 | return 0; |
2175 | 2175 | ||
2176 | dev_info(&dev->udev->dev, "Resuming video extension\n"); | 2176 | dev_info(&dev->intf->dev, "Resuming video extension\n"); |
2177 | /* what do we do here */ | 2177 | /* what do we do here */ |
2178 | return 0; | 2178 | return 0; |
2179 | } | 2179 | } |
@@ -2210,7 +2210,7 @@ static int em28xx_v4l2_close(struct file *filp) | |||
2210 | em28xx_videodbg("setting alternate 0\n"); | 2210 | em28xx_videodbg("setting alternate 0\n"); |
2211 | errCode = usb_set_interface(dev->udev, 0, 0); | 2211 | errCode = usb_set_interface(dev->udev, 0, 0); |
2212 | if (errCode < 0) { | 2212 | if (errCode < 0) { |
2213 | dev_err(&dev->udev->dev, | 2213 | dev_err(&dev->intf->dev, |
2214 | "cannot change alternate number to 0 (error=%i)\n", | 2214 | "cannot change alternate number to 0 (error=%i)\n", |
2215 | errCode); | 2215 | errCode); |
2216 | } | 2216 | } |
@@ -2345,7 +2345,7 @@ static void em28xx_vdev_init(struct em28xx *dev, | |||
2345 | vfd->tvnorms = 0; | 2345 | vfd->tvnorms = 0; |
2346 | 2346 | ||
2347 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", | 2347 | snprintf(vfd->name, sizeof(vfd->name), "%s %s", |
2348 | dev_name(&dev->udev->dev), type_name); | 2348 | dev_name(&dev->intf->dev), type_name); |
2349 | 2349 | ||
2350 | video_set_drvdata(vfd, dev); | 2350 | video_set_drvdata(vfd, dev); |
2351 | } | 2351 | } |
@@ -2429,7 +2429,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2429 | return 0; | 2429 | return 0; |
2430 | } | 2430 | } |
2431 | 2431 | ||
2432 | dev_info(&dev->udev->dev, "Registering V4L2 extension\n"); | 2432 | dev_info(&dev->intf->dev, "Registering V4L2 extension\n"); |
2433 | 2433 | ||
2434 | mutex_lock(&dev->lock); | 2434 | mutex_lock(&dev->lock); |
2435 | 2435 | ||
@@ -2445,9 +2445,9 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2445 | #ifdef CONFIG_MEDIA_CONTROLLER | 2445 | #ifdef CONFIG_MEDIA_CONTROLLER |
2446 | v4l2->v4l2_dev.mdev = dev->media_dev; | 2446 | v4l2->v4l2_dev.mdev = dev->media_dev; |
2447 | #endif | 2447 | #endif |
2448 | ret = v4l2_device_register(&dev->udev->dev, &v4l2->v4l2_dev); | 2448 | ret = v4l2_device_register(&dev->intf->dev, &v4l2->v4l2_dev); |
2449 | if (ret < 0) { | 2449 | if (ret < 0) { |
2450 | dev_err(&dev->udev->dev, | 2450 | dev_err(&dev->intf->dev, |
2451 | "Call to v4l2_device_register() failed!\n"); | 2451 | "Call to v4l2_device_register() failed!\n"); |
2452 | goto err; | 2452 | goto err; |
2453 | } | 2453 | } |
@@ -2532,7 +2532,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2532 | /* Configure audio */ | 2532 | /* Configure audio */ |
2533 | ret = em28xx_audio_setup(dev); | 2533 | ret = em28xx_audio_setup(dev); |
2534 | if (ret < 0) { | 2534 | if (ret < 0) { |
2535 | dev_err(&dev->udev->dev, | 2535 | dev_err(&dev->intf->dev, |
2536 | "%s: Error while setting audio - error [%d]!\n", | 2536 | "%s: Error while setting audio - error [%d]!\n", |
2537 | __func__, ret); | 2537 | __func__, ret); |
2538 | goto unregister_dev; | 2538 | goto unregister_dev; |
@@ -2561,7 +2561,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2561 | /* Send a reset to other chips via gpio */ | 2561 | /* Send a reset to other chips via gpio */ |
2562 | ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7); | 2562 | ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xf7); |
2563 | if (ret < 0) { | 2563 | if (ret < 0) { |
2564 | dev_err(&dev->udev->dev, | 2564 | dev_err(&dev->intf->dev, |
2565 | "%s: em28xx_write_reg - msp34xx(1) failed! error [%d]\n", | 2565 | "%s: em28xx_write_reg - msp34xx(1) failed! error [%d]\n", |
2566 | __func__, ret); | 2566 | __func__, ret); |
2567 | goto unregister_dev; | 2567 | goto unregister_dev; |
@@ -2570,7 +2570,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2570 | 2570 | ||
2571 | ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff); | 2571 | ret = em28xx_write_reg(dev, EM2820_R08_GPIO_CTRL, 0xff); |
2572 | if (ret < 0) { | 2572 | if (ret < 0) { |
2573 | dev_err(&dev->udev->dev, | 2573 | dev_err(&dev->intf->dev, |
2574 | "%s: em28xx_write_reg - msp34xx(2) failed! error [%d]\n", | 2574 | "%s: em28xx_write_reg - msp34xx(2) failed! error [%d]\n", |
2575 | __func__, ret); | 2575 | __func__, ret); |
2576 | goto unregister_dev; | 2576 | goto unregister_dev; |
@@ -2673,7 +2673,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2673 | ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER, | 2673 | ret = video_register_device(&v4l2->vdev, VFL_TYPE_GRABBER, |
2674 | video_nr[dev->devno]); | 2674 | video_nr[dev->devno]); |
2675 | if (ret) { | 2675 | if (ret) { |
2676 | dev_err(&dev->udev->dev, | 2676 | dev_err(&dev->intf->dev, |
2677 | "unable to register video device (error=%i).\n", ret); | 2677 | "unable to register video device (error=%i).\n", ret); |
2678 | goto unregister_dev; | 2678 | goto unregister_dev; |
2679 | } | 2679 | } |
@@ -2703,7 +2703,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2703 | ret = video_register_device(&v4l2->vbi_dev, VFL_TYPE_VBI, | 2703 | ret = video_register_device(&v4l2->vbi_dev, VFL_TYPE_VBI, |
2704 | vbi_nr[dev->devno]); | 2704 | vbi_nr[dev->devno]); |
2705 | if (ret < 0) { | 2705 | if (ret < 0) { |
2706 | dev_err(&dev->udev->dev, | 2706 | dev_err(&dev->intf->dev, |
2707 | "unable to register vbi device\n"); | 2707 | "unable to register vbi device\n"); |
2708 | goto unregister_dev; | 2708 | goto unregister_dev; |
2709 | } | 2709 | } |
@@ -2715,11 +2715,11 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2715 | ret = video_register_device(&v4l2->radio_dev, VFL_TYPE_RADIO, | 2715 | ret = video_register_device(&v4l2->radio_dev, VFL_TYPE_RADIO, |
2716 | radio_nr[dev->devno]); | 2716 | radio_nr[dev->devno]); |
2717 | if (ret < 0) { | 2717 | if (ret < 0) { |
2718 | dev_err(&dev->udev->dev, | 2718 | dev_err(&dev->intf->dev, |
2719 | "can't register radio device\n"); | 2719 | "can't register radio device\n"); |
2720 | goto unregister_dev; | 2720 | goto unregister_dev; |
2721 | } | 2721 | } |
2722 | dev_info(&dev->udev->dev, | 2722 | dev_info(&dev->intf->dev, |
2723 | "Registered radio device as %s\n", | 2723 | "Registered radio device as %s\n", |
2724 | video_device_node_name(&v4l2->radio_dev)); | 2724 | video_device_node_name(&v4l2->radio_dev)); |
2725 | } | 2725 | } |
@@ -2730,19 +2730,19 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2730 | #ifdef CONFIG_MEDIA_CONTROLLER | 2730 | #ifdef CONFIG_MEDIA_CONTROLLER |
2731 | ret = v4l2_mc_create_media_graph(dev->media_dev); | 2731 | ret = v4l2_mc_create_media_graph(dev->media_dev); |
2732 | if (ret) { | 2732 | if (ret) { |
2733 | dev_err(&dev->udev->dev, | 2733 | dev_err(&dev->intf->dev, |
2734 | "failed to create media graph\n"); | 2734 | "failed to create media graph\n"); |
2735 | em28xx_v4l2_media_release(dev); | 2735 | em28xx_v4l2_media_release(dev); |
2736 | goto unregister_dev; | 2736 | goto unregister_dev; |
2737 | } | 2737 | } |
2738 | #endif | 2738 | #endif |
2739 | 2739 | ||
2740 | dev_info(&dev->udev->dev, | 2740 | dev_info(&dev->intf->dev, |
2741 | "V4L2 video device registered as %s\n", | 2741 | "V4L2 video device registered as %s\n", |
2742 | video_device_node_name(&v4l2->vdev)); | 2742 | video_device_node_name(&v4l2->vdev)); |
2743 | 2743 | ||
2744 | if (video_is_registered(&v4l2->vbi_dev)) | 2744 | if (video_is_registered(&v4l2->vbi_dev)) |
2745 | dev_info(&dev->udev->dev, | 2745 | dev_info(&dev->intf->dev, |
2746 | "V4L2 VBI device registered as %s\n", | 2746 | "V4L2 VBI device registered as %s\n", |
2747 | video_device_node_name(&v4l2->vbi_dev)); | 2747 | video_device_node_name(&v4l2->vbi_dev)); |
2748 | 2748 | ||
@@ -2752,7 +2752,7 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2752 | /* initialize videobuf2 stuff */ | 2752 | /* initialize videobuf2 stuff */ |
2753 | em28xx_vb2_setup(dev); | 2753 | em28xx_vb2_setup(dev); |
2754 | 2754 | ||
2755 | dev_info(&dev->udev->dev, | 2755 | dev_info(&dev->intf->dev, |
2756 | "V4L2 extension successfully initialized\n"); | 2756 | "V4L2 extension successfully initialized\n"); |
2757 | 2757 | ||
2758 | kref_get(&dev->ref); | 2758 | kref_get(&dev->ref); |
@@ -2762,19 +2762,19 @@ static int em28xx_v4l2_init(struct em28xx *dev) | |||
2762 | 2762 | ||
2763 | unregister_dev: | 2763 | unregister_dev: |
2764 | if (video_is_registered(&v4l2->radio_dev)) { | 2764 | if (video_is_registered(&v4l2->radio_dev)) { |
2765 | dev_info(&dev->udev->dev, | 2765 | dev_info(&dev->intf->dev, |
2766 | "V4L2 device %s deregistered\n", | 2766 | "V4L2 device %s deregistered\n", |
2767 | video_device_node_name(&v4l2->radio_dev)); | 2767 | video_device_node_name(&v4l2->radio_dev)); |
2768 | video_unregister_device(&v4l2->radio_dev); | 2768 | video_unregister_device(&v4l2->radio_dev); |
2769 | } | 2769 | } |
2770 | if (video_is_registered(&v4l2->vbi_dev)) { | 2770 | if (video_is_registered(&v4l2->vbi_dev)) { |
2771 | dev_info(&dev->udev->dev, | 2771 | dev_info(&dev->intf->dev, |
2772 | "V4L2 device %s deregistered\n", | 2772 | "V4L2 device %s deregistered\n", |
2773 | video_device_node_name(&v4l2->vbi_dev)); | 2773 | video_device_node_name(&v4l2->vbi_dev)); |
2774 | video_unregister_device(&v4l2->vbi_dev); | 2774 | video_unregister_device(&v4l2->vbi_dev); |
2775 | } | 2775 | } |
2776 | if (video_is_registered(&v4l2->vdev)) { | 2776 | if (video_is_registered(&v4l2->vdev)) { |
2777 | dev_info(&dev->udev->dev, | 2777 | dev_info(&dev->intf->dev, |
2778 | "V4L2 device %s deregistered\n", | 2778 | "V4L2 device %s deregistered\n", |
2779 | video_device_node_name(&v4l2->vdev)); | 2779 | video_device_node_name(&v4l2->vdev)); |
2780 | video_unregister_device(&v4l2->vdev); | 2780 | video_unregister_device(&v4l2->vdev); |
diff --git a/drivers/media/usb/em28xx/em28xx.h b/drivers/media/usb/em28xx/em28xx.h index 3e5ace497a4e..5182b1bf0d15 100644 --- a/drivers/media/usb/em28xx/em28xx.h +++ b/drivers/media/usb/em28xx/em28xx.h | |||
@@ -678,6 +678,7 @@ struct em28xx { | |||
678 | 678 | ||
679 | /* usb transfer */ | 679 | /* usb transfer */ |
680 | struct usb_device *udev; /* the usb device */ | 680 | struct usb_device *udev; /* the usb device */ |
681 | struct usb_interface *intf; /* the usb interface */ | ||
681 | u8 ifnum; /* number of the assigned usb interface */ | 682 | u8 ifnum; /* number of the assigned usb interface */ |
682 | u8 analog_ep_isoc; /* address of isoc endpoint for analog */ | 683 | u8 analog_ep_isoc; /* address of isoc endpoint for analog */ |
683 | u8 analog_ep_bulk; /* address of bulk endpoint for analog */ | 684 | u8 analog_ep_bulk; /* address of bulk endpoint for analog */ |