aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/radio/dsbr100.c14
-rw-r--r--drivers/media/radio/radio-aimslab.c15
-rw-r--r--drivers/media/radio/radio-aztech.c15
-rw-r--r--drivers/media/radio/radio-gemtek-pci.c15
-rw-r--r--drivers/media/radio/radio-gemtek.c12
-rw-r--r--drivers/media/radio/radio-maestro.c15
-rw-r--r--drivers/media/radio/radio-maxiradio.c15
-rw-r--r--drivers/media/radio/radio-rtrack2.c15
-rw-r--r--drivers/media/radio/radio-sf16fmi.c15
-rw-r--r--drivers/media/radio/radio-sf16fmr2.c15
-rw-r--r--drivers/media/radio/radio-si470x.c22
-rw-r--r--drivers/media/radio/radio-terratec.c15
-rw-r--r--drivers/media/radio/radio-typhoon.c12
-rw-r--r--drivers/media/radio/radio-zoltrix.c15
-rw-r--r--drivers/media/video/cpia2/cpia2_v4l.c16
-rw-r--r--drivers/media/video/et61x251/et61x251_core.c14
-rw-r--r--drivers/media/video/saa5246a.c13
-rw-r--r--drivers/media/video/saa5249.c12
-rw-r--r--drivers/media/video/sn9c102/sn9c102_core.c14
-rw-r--r--drivers/media/video/usbvideo/vicam.c3
-rw-r--r--drivers/media/video/usbvision/usbvision-video.c122
-rw-r--r--drivers/media/video/uvc/uvc_v4l2.c13
-rw-r--r--drivers/media/video/vino.c18
-rw-r--r--drivers/media/video/w9966.c12
-rw-r--r--drivers/media/video/zc0301/zc0301_core.c14
25 files changed, 157 insertions, 304 deletions
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 3a4eb444a7c..0f06e6ffb0e 100644
--- a/drivers/media/radio/dsbr100.c
+++ b/drivers/media/radio/dsbr100.c
@@ -274,7 +274,7 @@ static int vidioc_querycap(struct file *file, void *priv,
274static int vidioc_g_tuner(struct file *file, void *priv, 274static int vidioc_g_tuner(struct file *file, void *priv,
275 struct v4l2_tuner *v) 275 struct v4l2_tuner *v)
276{ 276{
277 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 277 struct dsbr100_device *radio = video_drvdata(file);
278 278
279 if (v->index > 0) 279 if (v->index > 0)
280 return -EINVAL; 280 return -EINVAL;
@@ -306,7 +306,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
306static int vidioc_s_frequency(struct file *file, void *priv, 306static int vidioc_s_frequency(struct file *file, void *priv,
307 struct v4l2_frequency *f) 307 struct v4l2_frequency *f)
308{ 308{
309 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 309 struct dsbr100_device *radio = video_drvdata(file);
310 310
311 radio->curfreq = f->frequency; 311 radio->curfreq = f->frequency;
312 if (dsbr100_setfreq(radio, radio->curfreq)==-1) 312 if (dsbr100_setfreq(radio, radio->curfreq)==-1)
@@ -317,7 +317,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
317static int vidioc_g_frequency(struct file *file, void *priv, 317static int vidioc_g_frequency(struct file *file, void *priv,
318 struct v4l2_frequency *f) 318 struct v4l2_frequency *f)
319{ 319{
320 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 320 struct dsbr100_device *radio = video_drvdata(file);
321 321
322 f->type = V4L2_TUNER_RADIO; 322 f->type = V4L2_TUNER_RADIO;
323 f->frequency = radio->curfreq; 323 f->frequency = radio->curfreq;
@@ -342,7 +342,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
342static int vidioc_g_ctrl(struct file *file, void *priv, 342static int vidioc_g_ctrl(struct file *file, void *priv,
343 struct v4l2_control *ctrl) 343 struct v4l2_control *ctrl)
344{ 344{
345 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 345 struct dsbr100_device *radio = video_drvdata(file);
346 346
347 switch (ctrl->id) { 347 switch (ctrl->id) {
348 case V4L2_CID_AUDIO_MUTE: 348 case V4L2_CID_AUDIO_MUTE:
@@ -355,7 +355,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
355static int vidioc_s_ctrl(struct file *file, void *priv, 355static int vidioc_s_ctrl(struct file *file, void *priv,
356 struct v4l2_control *ctrl) 356 struct v4l2_control *ctrl)
357{ 357{
358 struct dsbr100_device *radio = video_get_drvdata(video_devdata(file)); 358 struct dsbr100_device *radio = video_drvdata(file);
359 359
360 switch (ctrl->id) { 360 switch (ctrl->id) {
361 case V4L2_CID_AUDIO_MUTE: 361 case V4L2_CID_AUDIO_MUTE:
@@ -405,7 +405,7 @@ static int vidioc_s_audio(struct file *file, void *priv,
405 405
406static int usb_dsbr100_open(struct inode *inode, struct file *file) 406static int usb_dsbr100_open(struct inode *inode, struct file *file)
407{ 407{
408 struct dsbr100_device *radio=video_get_drvdata(video_devdata(file)); 408 struct dsbr100_device *radio = video_drvdata(file);
409 409
410 lock_kernel(); 410 lock_kernel();
411 radio->users = 1; 411 radio->users = 1;
@@ -424,7 +424,7 @@ static int usb_dsbr100_open(struct inode *inode, struct file *file)
424 424
425static int usb_dsbr100_close(struct inode *inode, struct file *file) 425static int usb_dsbr100_close(struct inode *inode, struct file *file)
426{ 426{
427 struct dsbr100_device *radio=video_get_drvdata(video_devdata(file)); 427 struct dsbr100_device *radio = video_drvdata(file);
428 428
429 if (!radio) 429 if (!radio)
430 return -ENODEV; 430 return -ENODEV;
diff --git a/drivers/media/radio/radio-aimslab.c b/drivers/media/radio/radio-aimslab.c
index 62cc6874d63..9305e958fc6 100644
--- a/drivers/media/radio/radio-aimslab.c
+++ b/drivers/media/radio/radio-aimslab.c
@@ -246,8 +246,7 @@ static int vidioc_querycap(struct file *file, void *priv,
246static int vidioc_g_tuner(struct file *file, void *priv, 246static int vidioc_g_tuner(struct file *file, void *priv,
247 struct v4l2_tuner *v) 247 struct v4l2_tuner *v)
248{ 248{
249 struct video_device *dev = video_devdata(file); 249 struct rt_device *rt = video_drvdata(file);
250 struct rt_device *rt = video_get_drvdata(dev);
251 250
252 if (v->index > 0) 251 if (v->index > 0)
253 return -EINVAL; 252 return -EINVAL;
@@ -274,8 +273,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
274static int vidioc_s_frequency(struct file *file, void *priv, 273static int vidioc_s_frequency(struct file *file, void *priv,
275 struct v4l2_frequency *f) 274 struct v4l2_frequency *f)
276{ 275{
277 struct video_device *dev = video_devdata(file); 276 struct rt_device *rt = video_drvdata(file);
278 struct rt_device *rt = video_get_drvdata(dev);
279 277
280 rt->curfreq = f->frequency; 278 rt->curfreq = f->frequency;
281 rt_setfreq(rt, rt->curfreq); 279 rt_setfreq(rt, rt->curfreq);
@@ -285,8 +283,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
285static int vidioc_g_frequency(struct file *file, void *priv, 283static int vidioc_g_frequency(struct file *file, void *priv,
286 struct v4l2_frequency *f) 284 struct v4l2_frequency *f)
287{ 285{
288 struct video_device *dev = video_devdata(file); 286 struct rt_device *rt = video_drvdata(file);
289 struct rt_device *rt = video_get_drvdata(dev);
290 287
291 f->type = V4L2_TUNER_RADIO; 288 f->type = V4L2_TUNER_RADIO;
292 f->frequency = rt->curfreq; 289 f->frequency = rt->curfreq;
@@ -311,8 +308,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
311static int vidioc_g_ctrl(struct file *file, void *priv, 308static int vidioc_g_ctrl(struct file *file, void *priv,
312 struct v4l2_control *ctrl) 309 struct v4l2_control *ctrl)
313{ 310{
314 struct video_device *dev = video_devdata(file); 311 struct rt_device *rt = video_drvdata(file);
315 struct rt_device *rt = video_get_drvdata(dev);
316 312
317 switch (ctrl->id) { 313 switch (ctrl->id) {
318 case V4L2_CID_AUDIO_MUTE: 314 case V4L2_CID_AUDIO_MUTE:
@@ -328,8 +324,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
328static int vidioc_s_ctrl(struct file *file, void *priv, 324static int vidioc_s_ctrl(struct file *file, void *priv,
329 struct v4l2_control *ctrl) 325 struct v4l2_control *ctrl)
330{ 326{
331 struct video_device *dev = video_devdata(file); 327 struct rt_device *rt = video_drvdata(file);
332 struct rt_device *rt = video_get_drvdata(dev);
333 328
334 switch (ctrl->id) { 329 switch (ctrl->id) {
335 case V4L2_CID_AUDIO_MUTE: 330 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-aztech.c b/drivers/media/radio/radio-aztech.c
index 5dd5e349ef4..d7848957323 100644
--- a/drivers/media/radio/radio-aztech.c
+++ b/drivers/media/radio/radio-aztech.c
@@ -196,8 +196,7 @@ static int vidioc_querycap (struct file *file, void *priv,
196static int vidioc_g_tuner (struct file *file, void *priv, 196static int vidioc_g_tuner (struct file *file, void *priv,
197 struct v4l2_tuner *v) 197 struct v4l2_tuner *v)
198{ 198{
199 struct video_device *dev = video_devdata(file); 199 struct az_device *az = video_drvdata(file);
200 struct az_device *az = video_get_drvdata(dev);
201 200
202 if (v->index > 0) 201 if (v->index > 0)
203 return -EINVAL; 202 return -EINVAL;
@@ -265,8 +264,7 @@ static int vidioc_s_audio (struct file *file, void *priv,
265static int vidioc_s_frequency (struct file *file, void *priv, 264static int vidioc_s_frequency (struct file *file, void *priv,
266 struct v4l2_frequency *f) 265 struct v4l2_frequency *f)
267{ 266{
268 struct video_device *dev = video_devdata(file); 267 struct az_device *az = video_drvdata(file);
269 struct az_device *az = video_get_drvdata(dev);
270 268
271 az->curfreq = f->frequency; 269 az->curfreq = f->frequency;
272 az_setfreq(az, az->curfreq); 270 az_setfreq(az, az->curfreq);
@@ -276,8 +274,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
276static int vidioc_g_frequency (struct file *file, void *priv, 274static int vidioc_g_frequency (struct file *file, void *priv,
277 struct v4l2_frequency *f) 275 struct v4l2_frequency *f)
278{ 276{
279 struct video_device *dev = video_devdata(file); 277 struct az_device *az = video_drvdata(file);
280 struct az_device *az = video_get_drvdata(dev);
281 278
282 f->type = V4L2_TUNER_RADIO; 279 f->type = V4L2_TUNER_RADIO;
283 f->frequency = az->curfreq; 280 f->frequency = az->curfreq;
@@ -303,8 +300,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
303static int vidioc_g_ctrl (struct file *file, void *priv, 300static int vidioc_g_ctrl (struct file *file, void *priv,
304 struct v4l2_control *ctrl) 301 struct v4l2_control *ctrl)
305{ 302{
306 struct video_device *dev = video_devdata(file); 303 struct az_device *az = video_drvdata(file);
307 struct az_device *az = video_get_drvdata(dev);
308 304
309 switch (ctrl->id) { 305 switch (ctrl->id) {
310 case V4L2_CID_AUDIO_MUTE: 306 case V4L2_CID_AUDIO_MUTE:
@@ -323,8 +319,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
323static int vidioc_s_ctrl (struct file *file, void *priv, 319static int vidioc_s_ctrl (struct file *file, void *priv,
324 struct v4l2_control *ctrl) 320 struct v4l2_control *ctrl)
325{ 321{
326 struct video_device *dev = video_devdata(file); 322 struct az_device *az = video_drvdata(file);
327 struct az_device *az = video_get_drvdata(dev);
328 323
329 switch (ctrl->id) { 324 switch (ctrl->id) {
330 case V4L2_CID_AUDIO_MUTE: 325 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c
index 1f57f731c12..e15bee6d7cf 100644
--- a/drivers/media/radio/radio-gemtek-pci.c
+++ b/drivers/media/radio/radio-gemtek-pci.c
@@ -204,8 +204,7 @@ static int vidioc_querycap(struct file *file, void *priv,
204static int vidioc_g_tuner(struct file *file, void *priv, 204static int vidioc_g_tuner(struct file *file, void *priv,
205 struct v4l2_tuner *v) 205 struct v4l2_tuner *v)
206{ 206{
207 struct video_device *dev = video_devdata(file); 207 struct gemtek_pci_card *card = video_drvdata(file);
208 struct gemtek_pci_card *card = video_get_drvdata(dev);
209 208
210 if (v->index > 0) 209 if (v->index > 0)
211 return -EINVAL; 210 return -EINVAL;
@@ -232,8 +231,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
232static int vidioc_s_frequency(struct file *file, void *priv, 231static int vidioc_s_frequency(struct file *file, void *priv,
233 struct v4l2_frequency *f) 232 struct v4l2_frequency *f)
234{ 233{
235 struct video_device *dev = video_devdata(file); 234 struct gemtek_pci_card *card = video_drvdata(file);
236 struct gemtek_pci_card *card = video_get_drvdata(dev);
237 235
238 if ( (f->frequency < GEMTEK_PCI_RANGE_LOW) || 236 if ( (f->frequency < GEMTEK_PCI_RANGE_LOW) ||
239 (f->frequency > GEMTEK_PCI_RANGE_HIGH) ) 237 (f->frequency > GEMTEK_PCI_RANGE_HIGH) )
@@ -247,8 +245,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
247static int vidioc_g_frequency(struct file *file, void *priv, 245static int vidioc_g_frequency(struct file *file, void *priv,
248 struct v4l2_frequency *f) 246 struct v4l2_frequency *f)
249{ 247{
250 struct video_device *dev = video_devdata(file); 248 struct gemtek_pci_card *card = video_drvdata(file);
251 struct gemtek_pci_card *card = video_get_drvdata(dev);
252 249
253 f->type = V4L2_TUNER_RADIO; 250 f->type = V4L2_TUNER_RADIO;
254 f->frequency = card->current_frequency; 251 f->frequency = card->current_frequency;
@@ -272,8 +269,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
272static int vidioc_g_ctrl(struct file *file, void *priv, 269static int vidioc_g_ctrl(struct file *file, void *priv,
273 struct v4l2_control *ctrl) 270 struct v4l2_control *ctrl)
274{ 271{
275 struct video_device *dev = video_devdata(file); 272 struct gemtek_pci_card *card = video_drvdata(file);
276 struct gemtek_pci_card *card = video_get_drvdata(dev);
277 273
278 switch (ctrl->id) { 274 switch (ctrl->id) {
279 case V4L2_CID_AUDIO_MUTE: 275 case V4L2_CID_AUDIO_MUTE:
@@ -292,8 +288,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
292static int vidioc_s_ctrl(struct file *file, void *priv, 288static int vidioc_s_ctrl(struct file *file, void *priv,
293 struct v4l2_control *ctrl) 289 struct v4l2_control *ctrl)
294{ 290{
295 struct video_device *dev = video_devdata(file); 291 struct gemtek_pci_card *card = video_drvdata(file);
296 struct gemtek_pci_card *card = video_get_drvdata(dev);
297 292
298 switch (ctrl->id) { 293 switch (ctrl->id) {
299 case V4L2_CID_AUDIO_MUTE: 294 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-gemtek.c b/drivers/media/radio/radio-gemtek.c
index 2c4c15e6d51..d131a5d3812 100644
--- a/drivers/media/radio/radio-gemtek.c
+++ b/drivers/media/radio/radio-gemtek.c
@@ -459,8 +459,7 @@ static int vidioc_s_tuner(struct file *file, void *priv, struct v4l2_tuner *v)
459static int vidioc_s_frequency(struct file *file, void *priv, 459static int vidioc_s_frequency(struct file *file, void *priv,
460 struct v4l2_frequency *f) 460 struct v4l2_frequency *f)
461{ 461{
462 struct video_device *dev = video_devdata(file); 462 struct gemtek_device *rt = video_drvdata(file);
463 struct gemtek_device *rt = video_get_drvdata(dev);
464 463
465 gemtek_setfreq(rt, f->frequency); 464 gemtek_setfreq(rt, f->frequency);
466 465
@@ -470,8 +469,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
470static int vidioc_g_frequency(struct file *file, void *priv, 469static int vidioc_g_frequency(struct file *file, void *priv,
471 struct v4l2_frequency *f) 470 struct v4l2_frequency *f)
472{ 471{
473 struct video_device *dev = video_devdata(file); 472 struct gemtek_device *rt = video_drvdata(file);
474 struct gemtek_device *rt = video_get_drvdata(dev);
475 473
476 f->type = V4L2_TUNER_RADIO; 474 f->type = V4L2_TUNER_RADIO;
477 f->frequency = rt->lastfreq; 475 f->frequency = rt->lastfreq;
@@ -495,8 +493,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
495static int vidioc_g_ctrl(struct file *file, void *priv, 493static int vidioc_g_ctrl(struct file *file, void *priv,
496 struct v4l2_control *ctrl) 494 struct v4l2_control *ctrl)
497{ 495{
498 struct video_device *dev = video_devdata(file); 496 struct gemtek_device *rt = video_drvdata(file);
499 struct gemtek_device *rt = video_get_drvdata(dev);
500 497
501 switch (ctrl->id) { 498 switch (ctrl->id) {
502 case V4L2_CID_AUDIO_MUTE: 499 case V4L2_CID_AUDIO_MUTE:
@@ -515,8 +512,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
515static int vidioc_s_ctrl(struct file *file, void *priv, 512static int vidioc_s_ctrl(struct file *file, void *priv,
516 struct v4l2_control *ctrl) 513 struct v4l2_control *ctrl)
517{ 514{
518 struct video_device *dev = video_devdata(file); 515 struct gemtek_device *rt = video_drvdata(file);
519 struct gemtek_device *rt = video_get_drvdata(dev);
520 516
521 switch (ctrl->id) { 517 switch (ctrl->id) {
522 case V4L2_CID_AUDIO_MUTE: 518 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-maestro.c b/drivers/media/radio/radio-maestro.c
index 182b433981c..4bf4d007bcf 100644
--- a/drivers/media/radio/radio-maestro.c
+++ b/drivers/media/radio/radio-maestro.c
@@ -210,8 +210,7 @@ static int vidioc_querycap(struct file *file, void *priv,
210static int vidioc_g_tuner(struct file *file, void *priv, 210static int vidioc_g_tuner(struct file *file, void *priv,
211 struct v4l2_tuner *v) 211 struct v4l2_tuner *v)
212{ 212{
213 struct video_device *dev = video_devdata(file); 213 struct radio_device *card = video_drvdata(file);
214 struct radio_device *card = video_get_drvdata(dev);
215 214
216 if (v->index > 0) 215 if (v->index > 0)
217 return -EINVAL; 216 return -EINVAL;
@@ -243,8 +242,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
243static int vidioc_s_frequency(struct file *file, void *priv, 242static int vidioc_s_frequency(struct file *file, void *priv,
244 struct v4l2_frequency *f) 243 struct v4l2_frequency *f)
245{ 244{
246 struct video_device *dev = video_devdata(file); 245 struct radio_device *card = video_drvdata(file);
247 struct radio_device *card = video_get_drvdata(dev);
248 246
249 if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) 247 if (f->frequency < FREQ_LO || f->frequency > FREQ_HI)
250 return -EINVAL; 248 return -EINVAL;
@@ -255,8 +253,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
255static int vidioc_g_frequency(struct file *file, void *priv, 253static int vidioc_g_frequency(struct file *file, void *priv,
256 struct v4l2_frequency *f) 254 struct v4l2_frequency *f)
257{ 255{
258 struct video_device *dev = video_devdata(file); 256 struct radio_device *card = video_drvdata(file);
259 struct radio_device *card = video_get_drvdata(dev);
260 257
261 f->type = V4L2_TUNER_RADIO; 258 f->type = V4L2_TUNER_RADIO;
262 f->frequency = BITS2FREQ(radio_bits_get(card)); 259 f->frequency = BITS2FREQ(radio_bits_get(card));
@@ -281,8 +278,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
281static int vidioc_g_ctrl(struct file *file, void *priv, 278static int vidioc_g_ctrl(struct file *file, void *priv,
282 struct v4l2_control *ctrl) 279 struct v4l2_control *ctrl)
283{ 280{
284 struct video_device *dev = video_devdata(file); 281 struct radio_device *card = video_drvdata(file);
285 struct radio_device *card = video_get_drvdata(dev);
286 282
287 switch (ctrl->id) { 283 switch (ctrl->id) {
288 case V4L2_CID_AUDIO_MUTE: 284 case V4L2_CID_AUDIO_MUTE:
@@ -295,8 +291,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
295static int vidioc_s_ctrl(struct file *file, void *priv, 291static int vidioc_s_ctrl(struct file *file, void *priv,
296 struct v4l2_control *ctrl) 292 struct v4l2_control *ctrl)
297{ 293{
298 struct video_device *dev = video_devdata(file); 294 struct radio_device *card = video_drvdata(file);
299 struct radio_device *card = video_get_drvdata(dev);
300 register u16 io = card->io; 295 register u16 io = card->io;
301 register u16 omask = inw(io + IO_MASK); 296 register u16 omask = inw(io + IO_MASK);
302 297
diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c
index 9bf2acf5249..c777a17b00b 100644
--- a/drivers/media/radio/radio-maxiradio.c
+++ b/drivers/media/radio/radio-maxiradio.c
@@ -231,8 +231,7 @@ static int vidioc_querycap (struct file *file, void *priv,
231static int vidioc_g_tuner (struct file *file, void *priv, 231static int vidioc_g_tuner (struct file *file, void *priv,
232 struct v4l2_tuner *v) 232 struct v4l2_tuner *v)
233{ 233{
234 struct video_device *dev = video_devdata(file); 234 struct radio_device *card = video_drvdata(file);
235 struct radio_device *card = video_get_drvdata(dev);
236 235
237 if (v->index > 0) 236 if (v->index > 0)
238 return -EINVAL; 237 return -EINVAL;
@@ -302,8 +301,7 @@ static int vidioc_s_audio (struct file *file, void *priv,
302static int vidioc_s_frequency (struct file *file, void *priv, 301static int vidioc_s_frequency (struct file *file, void *priv,
303 struct v4l2_frequency *f) 302 struct v4l2_frequency *f)
304{ 303{
305 struct video_device *dev = video_devdata(file); 304 struct radio_device *card = video_drvdata(file);
306 struct radio_device *card = video_get_drvdata(dev);
307 305
308 if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) { 306 if (f->frequency < FREQ_LO || f->frequency > FREQ_HI) {
309 dprintk(1, "radio freq (%d.%02d MHz) out of range (%d-%d)\n", 307 dprintk(1, "radio freq (%d.%02d MHz) out of range (%d-%d)\n",
@@ -324,8 +322,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
324static int vidioc_g_frequency (struct file *file, void *priv, 322static int vidioc_g_frequency (struct file *file, void *priv,
325 struct v4l2_frequency *f) 323 struct v4l2_frequency *f)
326{ 324{
327 struct video_device *dev = video_devdata(file); 325 struct radio_device *card = video_drvdata(file);
328 struct radio_device *card = video_get_drvdata(dev);
329 326
330 f->type = V4L2_TUNER_RADIO; 327 f->type = V4L2_TUNER_RADIO;
331 f->frequency = card->freq; 328 f->frequency = card->freq;
@@ -355,8 +352,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
355static int vidioc_g_ctrl (struct file *file, void *priv, 352static int vidioc_g_ctrl (struct file *file, void *priv,
356 struct v4l2_control *ctrl) 353 struct v4l2_control *ctrl)
357{ 354{
358 struct video_device *dev = video_devdata(file); 355 struct radio_device *card = video_drvdata(file);
359 struct radio_device *card = video_get_drvdata(dev);
360 356
361 switch (ctrl->id) { 357 switch (ctrl->id) {
362 case V4L2_CID_AUDIO_MUTE: 358 case V4L2_CID_AUDIO_MUTE:
@@ -370,8 +366,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
370static int vidioc_s_ctrl (struct file *file, void *priv, 366static int vidioc_s_ctrl (struct file *file, void *priv,
371 struct v4l2_control *ctrl) 367 struct v4l2_control *ctrl)
372{ 368{
373 struct video_device *dev = video_devdata(file); 369 struct radio_device *card = video_drvdata(file);
374 struct radio_device *card = video_get_drvdata(dev);
375 370
376 switch (ctrl->id) { 371 switch (ctrl->id) {
377 case V4L2_CID_AUDIO_MUTE: 372 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c
index 4234f7ed0fc..a6707977741 100644
--- a/drivers/media/radio/radio-rtrack2.c
+++ b/drivers/media/radio/radio-rtrack2.c
@@ -154,8 +154,7 @@ static int rt_getsigstr(struct rt_device *dev)
154static int vidioc_g_tuner(struct file *file, void *priv, 154static int vidioc_g_tuner(struct file *file, void *priv,
155 struct v4l2_tuner *v) 155 struct v4l2_tuner *v)
156{ 156{
157 struct video_device *dev = video_devdata(file); 157 struct rt_device *rt = video_drvdata(file);
158 struct rt_device *rt = video_get_drvdata(dev);
159 158
160 if (v->index > 0) 159 if (v->index > 0)
161 return -EINVAL; 160 return -EINVAL;
@@ -174,8 +173,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
174static int vidioc_s_frequency(struct file *file, void *priv, 173static int vidioc_s_frequency(struct file *file, void *priv,
175 struct v4l2_frequency *f) 174 struct v4l2_frequency *f)
176{ 175{
177 struct video_device *dev = video_devdata(file); 176 struct rt_device *rt = video_drvdata(file);
178 struct rt_device *rt = video_get_drvdata(dev);
179 177
180 rt->curfreq = f->frequency; 178 rt->curfreq = f->frequency;
181 rt_setfreq(rt, rt->curfreq); 179 rt_setfreq(rt, rt->curfreq);
@@ -185,8 +183,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
185static int vidioc_g_frequency(struct file *file, void *priv, 183static int vidioc_g_frequency(struct file *file, void *priv,
186 struct v4l2_frequency *f) 184 struct v4l2_frequency *f)
187{ 185{
188 struct video_device *dev = video_devdata(file); 186 struct rt_device *rt = video_drvdata(file);
189 struct rt_device *rt = video_get_drvdata(dev);
190 187
191 f->type = V4L2_TUNER_RADIO; 188 f->type = V4L2_TUNER_RADIO;
192 f->frequency = rt->curfreq; 189 f->frequency = rt->curfreq;
@@ -211,8 +208,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
211static int vidioc_g_ctrl(struct file *file, void *priv, 208static int vidioc_g_ctrl(struct file *file, void *priv,
212 struct v4l2_control *ctrl) 209 struct v4l2_control *ctrl)
213{ 210{
214 struct video_device *dev = video_devdata(file); 211 struct rt_device *rt = video_drvdata(file);
215 struct rt_device *rt = video_get_drvdata(dev);
216 212
217 switch (ctrl->id) { 213 switch (ctrl->id) {
218 case V4L2_CID_AUDIO_MUTE: 214 case V4L2_CID_AUDIO_MUTE:
@@ -231,8 +227,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
231static int vidioc_s_ctrl(struct file *file, void *priv, 227static int vidioc_s_ctrl(struct file *file, void *priv,
232 struct v4l2_control *ctrl) 228 struct v4l2_control *ctrl)
233{ 229{
234 struct video_device *dev = video_devdata(file); 230 struct rt_device *rt = video_drvdata(file);
235 struct rt_device *rt = video_get_drvdata(dev);
236 231
237 switch (ctrl->id) { 232 switch (ctrl->id) {
238 case V4L2_CID_AUDIO_MUTE: 233 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-sf16fmi.c b/drivers/media/radio/radio-sf16fmi.c
index 810c366b73b..329c90bddad 100644
--- a/drivers/media/radio/radio-sf16fmi.c
+++ b/drivers/media/radio/radio-sf16fmi.c
@@ -147,8 +147,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
147 struct v4l2_tuner *v) 147 struct v4l2_tuner *v)
148{ 148{
149 int mult; 149 int mult;
150 struct video_device *dev = video_devdata(file); 150 struct fmi_device *fmi = video_drvdata(file);
151 struct fmi_device *fmi = video_get_drvdata(dev);
152 151
153 if (v->index > 0) 152 if (v->index > 0)
154 return -EINVAL; 153 return -EINVAL;
@@ -176,8 +175,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
176static int vidioc_s_frequency(struct file *file, void *priv, 175static int vidioc_s_frequency(struct file *file, void *priv,
177 struct v4l2_frequency *f) 176 struct v4l2_frequency *f)
178{ 177{
179 struct video_device *dev = video_devdata(file); 178 struct fmi_device *fmi = video_drvdata(file);
180 struct fmi_device *fmi = video_get_drvdata(dev);
181 179
182 if (!(fmi->flags & V4L2_TUNER_CAP_LOW)) 180 if (!(fmi->flags & V4L2_TUNER_CAP_LOW))
183 f->frequency *= 1000; 181 f->frequency *= 1000;
@@ -194,8 +192,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
194static int vidioc_g_frequency(struct file *file, void *priv, 192static int vidioc_g_frequency(struct file *file, void *priv,
195 struct v4l2_frequency *f) 193 struct v4l2_frequency *f)
196{ 194{
197 struct video_device *dev = video_devdata(file); 195 struct fmi_device *fmi = video_drvdata(file);
198 struct fmi_device *fmi = video_get_drvdata(dev);
199 196
200 f->type = V4L2_TUNER_RADIO; 197 f->type = V4L2_TUNER_RADIO;
201 f->frequency = fmi->curfreq; 198 f->frequency = fmi->curfreq;
@@ -222,8 +219,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
222static int vidioc_g_ctrl(struct file *file, void *priv, 219static int vidioc_g_ctrl(struct file *file, void *priv,
223 struct v4l2_control *ctrl) 220 struct v4l2_control *ctrl)
224{ 221{
225 struct video_device *dev = video_devdata(file); 222 struct fmi_device *fmi = video_drvdata(file);
226 struct fmi_device *fmi = video_get_drvdata(dev);
227 223
228 switch (ctrl->id) { 224 switch (ctrl->id) {
229 case V4L2_CID_AUDIO_MUTE: 225 case V4L2_CID_AUDIO_MUTE:
@@ -236,8 +232,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
236static int vidioc_s_ctrl(struct file *file, void *priv, 232static int vidioc_s_ctrl(struct file *file, void *priv,
237 struct v4l2_control *ctrl) 233 struct v4l2_control *ctrl)
238{ 234{
239 struct video_device *dev = video_devdata(file); 235 struct fmi_device *fmi = video_drvdata(file);
240 struct fmi_device *fmi = video_get_drvdata(dev);
241 236
242 switch (ctrl->id) { 237 switch (ctrl->id) {
243 case V4L2_CID_AUDIO_MUTE: 238 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-sf16fmr2.c b/drivers/media/radio/radio-sf16fmr2.c
index 9f823150452..b1f47c322e0 100644
--- a/drivers/media/radio/radio-sf16fmr2.c
+++ b/drivers/media/radio/radio-sf16fmr2.c
@@ -230,8 +230,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
230 struct v4l2_tuner *v) 230 struct v4l2_tuner *v)
231{ 231{
232 int mult; 232 int mult;
233 struct video_device *dev = video_devdata(file); 233 struct fmr2_device *fmr2 = video_drvdata(file);
234 struct fmr2_device *fmr2 = video_get_drvdata(dev);
235 234
236 if (v->index > 0) 235 if (v->index > 0)
237 return -EINVAL; 236 return -EINVAL;
@@ -263,8 +262,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
263static int vidioc_s_frequency(struct file *file, void *priv, 262static int vidioc_s_frequency(struct file *file, void *priv,
264 struct v4l2_frequency *f) 263 struct v4l2_frequency *f)
265{ 264{
266 struct video_device *dev = video_devdata(file); 265 struct fmr2_device *fmr2 = video_drvdata(file);
267 struct fmr2_device *fmr2 = video_get_drvdata(dev);
268 266
269 if (!(fmr2->flags & V4L2_TUNER_CAP_LOW)) 267 if (!(fmr2->flags & V4L2_TUNER_CAP_LOW))
270 f->frequency *= 1000; 268 f->frequency *= 1000;
@@ -287,8 +285,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
287static int vidioc_g_frequency(struct file *file, void *priv, 285static int vidioc_g_frequency(struct file *file, void *priv,
288 struct v4l2_frequency *f) 286 struct v4l2_frequency *f)
289{ 287{
290 struct video_device *dev = video_devdata(file); 288 struct fmr2_device *fmr2 = video_drvdata(file);
291 struct fmr2_device *fmr2 = video_get_drvdata(dev);
292 289
293 f->type = V4L2_TUNER_RADIO; 290 f->type = V4L2_TUNER_RADIO;
294 f->frequency = fmr2->curfreq; 291 f->frequency = fmr2->curfreq;
@@ -314,8 +311,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
314static int vidioc_g_ctrl(struct file *file, void *priv, 311static int vidioc_g_ctrl(struct file *file, void *priv,
315 struct v4l2_control *ctrl) 312 struct v4l2_control *ctrl)
316{ 313{
317 struct video_device *dev = video_devdata(file); 314 struct fmr2_device *fmr2 = video_drvdata(file);
318 struct fmr2_device *fmr2 = video_get_drvdata(dev);
319 315
320 switch (ctrl->id) { 316 switch (ctrl->id) {
321 case V4L2_CID_AUDIO_MUTE: 317 case V4L2_CID_AUDIO_MUTE:
@@ -331,8 +327,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
331static int vidioc_s_ctrl(struct file *file, void *priv, 327static int vidioc_s_ctrl(struct file *file, void *priv,
332 struct v4l2_control *ctrl) 328 struct v4l2_control *ctrl)
333{ 329{
334 struct video_device *dev = video_devdata(file); 330 struct fmr2_device *fmr2 = video_drvdata(file);
335 struct fmr2_device *fmr2 = video_get_drvdata(dev);
336 331
337 switch (ctrl->id) { 332 switch (ctrl->id) {
338 case V4L2_CID_AUDIO_MUTE: 333 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 337d5579383..f6cedcd3ab9 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -986,7 +986,7 @@ static void si470x_work(struct work_struct *work)
986static ssize_t si470x_fops_read(struct file *file, char __user *buf, 986static ssize_t si470x_fops_read(struct file *file, char __user *buf,
987 size_t count, loff_t *ppos) 987 size_t count, loff_t *ppos)
988{ 988{
989 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 989 struct si470x_device *radio = video_drvdata(file);
990 int retval = 0; 990 int retval = 0;
991 unsigned int block_count = 0; 991 unsigned int block_count = 0;
992 992
@@ -1047,7 +1047,7 @@ done:
1047static unsigned int si470x_fops_poll(struct file *file, 1047static unsigned int si470x_fops_poll(struct file *file,
1048 struct poll_table_struct *pts) 1048 struct poll_table_struct *pts)
1049{ 1049{
1050 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1050 struct si470x_device *radio = video_drvdata(file);
1051 int retval = 0; 1051 int retval = 0;
1052 1052
1053 /* switch on rds reception */ 1053 /* switch on rds reception */
@@ -1071,7 +1071,7 @@ static unsigned int si470x_fops_poll(struct file *file,
1071 */ 1071 */
1072static int si470x_fops_open(struct inode *inode, struct file *file) 1072static int si470x_fops_open(struct inode *inode, struct file *file)
1073{ 1073{
1074 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1074 struct si470x_device *radio = video_drvdata(file);
1075 int retval; 1075 int retval;
1076 1076
1077 lock_kernel(); 1077 lock_kernel();
@@ -1101,7 +1101,7 @@ done:
1101 */ 1101 */
1102static int si470x_fops_release(struct inode *inode, struct file *file) 1102static int si470x_fops_release(struct inode *inode, struct file *file)
1103{ 1103{
1104 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1104 struct si470x_device *radio = video_drvdata(file);
1105 int retval = 0; 1105 int retval = 0;
1106 1106
1107 /* safety check */ 1107 /* safety check */
@@ -1284,7 +1284,7 @@ done:
1284static int si470x_vidioc_g_ctrl(struct file *file, void *priv, 1284static int si470x_vidioc_g_ctrl(struct file *file, void *priv,
1285 struct v4l2_control *ctrl) 1285 struct v4l2_control *ctrl)
1286{ 1286{
1287 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1287 struct si470x_device *radio = video_drvdata(file);
1288 int retval = 0; 1288 int retval = 0;
1289 1289
1290 /* safety checks */ 1290 /* safety checks */
@@ -1320,7 +1320,7 @@ done:
1320static int si470x_vidioc_s_ctrl(struct file *file, void *priv, 1320static int si470x_vidioc_s_ctrl(struct file *file, void *priv,
1321 struct v4l2_control *ctrl) 1321 struct v4l2_control *ctrl)
1322{ 1322{
1323 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1323 struct si470x_device *radio = video_drvdata(file);
1324 int retval = 0; 1324 int retval = 0;
1325 1325
1326 /* safety checks */ 1326 /* safety checks */
@@ -1407,7 +1407,7 @@ done:
1407static int si470x_vidioc_g_tuner(struct file *file, void *priv, 1407static int si470x_vidioc_g_tuner(struct file *file, void *priv,
1408 struct v4l2_tuner *tuner) 1408 struct v4l2_tuner *tuner)
1409{ 1409{
1410 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1410 struct si470x_device *radio = video_drvdata(file);
1411 int retval = 0; 1411 int retval = 0;
1412 1412
1413 /* safety checks */ 1413 /* safety checks */
@@ -1473,7 +1473,7 @@ done:
1473static int si470x_vidioc_s_tuner(struct file *file, void *priv, 1473static int si470x_vidioc_s_tuner(struct file *file, void *priv,
1474 struct v4l2_tuner *tuner) 1474 struct v4l2_tuner *tuner)
1475{ 1475{
1476 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1476 struct si470x_device *radio = video_drvdata(file);
1477 int retval = 0; 1477 int retval = 0;
1478 1478
1479 /* safety checks */ 1479 /* safety checks */
@@ -1507,7 +1507,7 @@ done:
1507static int si470x_vidioc_g_frequency(struct file *file, void *priv, 1507static int si470x_vidioc_g_frequency(struct file *file, void *priv,
1508 struct v4l2_frequency *freq) 1508 struct v4l2_frequency *freq)
1509{ 1509{
1510 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1510 struct si470x_device *radio = video_drvdata(file);
1511 int retval = 0; 1511 int retval = 0;
1512 1512
1513 /* safety checks */ 1513 /* safety checks */
@@ -1536,7 +1536,7 @@ done:
1536static int si470x_vidioc_s_frequency(struct file *file, void *priv, 1536static int si470x_vidioc_s_frequency(struct file *file, void *priv,
1537 struct v4l2_frequency *freq) 1537 struct v4l2_frequency *freq)
1538{ 1538{
1539 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1539 struct si470x_device *radio = video_drvdata(file);
1540 int retval = 0; 1540 int retval = 0;
1541 1541
1542 /* safety checks */ 1542 /* safety checks */
@@ -1565,7 +1565,7 @@ done:
1565static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv, 1565static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
1566 struct v4l2_hw_freq_seek *seek) 1566 struct v4l2_hw_freq_seek *seek)
1567{ 1567{
1568 struct si470x_device *radio = video_get_drvdata(video_devdata(file)); 1568 struct si470x_device *radio = video_drvdata(file);
1569 int retval = 0; 1569 int retval = 0;
1570 1570
1571 /* safety checks */ 1571 /* safety checks */
diff --git a/drivers/media/radio/radio-terratec.c b/drivers/media/radio/radio-terratec.c
index 0bc9af686ad..0abb186a947 100644
--- a/drivers/media/radio/radio-terratec.c
+++ b/drivers/media/radio/radio-terratec.c
@@ -221,8 +221,7 @@ static int vidioc_querycap(struct file *file, void *priv,
221static int vidioc_g_tuner(struct file *file, void *priv, 221static int vidioc_g_tuner(struct file *file, void *priv,
222 struct v4l2_tuner *v) 222 struct v4l2_tuner *v)
223{ 223{
224 struct video_device *dev = video_devdata(file); 224 struct tt_device *tt = video_drvdata(file);
225 struct tt_device *tt = video_get_drvdata(dev);
226 225
227 if (v->index > 0) 226 if (v->index > 0)
228 return -EINVAL; 227 return -EINVAL;
@@ -249,8 +248,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
249static int vidioc_s_frequency(struct file *file, void *priv, 248static int vidioc_s_frequency(struct file *file, void *priv,
250 struct v4l2_frequency *f) 249 struct v4l2_frequency *f)
251{ 250{
252 struct video_device *dev = video_devdata(file); 251 struct tt_device *tt = video_drvdata(file);
253 struct tt_device *tt = video_get_drvdata(dev);
254 252
255 tt->curfreq = f->frequency; 253 tt->curfreq = f->frequency;
256 tt_setfreq(tt, tt->curfreq); 254 tt_setfreq(tt, tt->curfreq);
@@ -260,8 +258,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
260static int vidioc_g_frequency(struct file *file, void *priv, 258static int vidioc_g_frequency(struct file *file, void *priv,
261 struct v4l2_frequency *f) 259 struct v4l2_frequency *f)
262{ 260{
263 struct video_device *dev = video_devdata(file); 261 struct tt_device *tt = video_drvdata(file);
264 struct tt_device *tt = video_get_drvdata(dev);
265 262
266 f->type = V4L2_TUNER_RADIO; 263 f->type = V4L2_TUNER_RADIO;
267 f->frequency = tt->curfreq; 264 f->frequency = tt->curfreq;
@@ -286,8 +283,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
286static int vidioc_g_ctrl(struct file *file, void *priv, 283static int vidioc_g_ctrl(struct file *file, void *priv,
287 struct v4l2_control *ctrl) 284 struct v4l2_control *ctrl)
288{ 285{
289 struct video_device *dev = video_devdata(file); 286 struct tt_device *tt = video_drvdata(file);
290 struct tt_device *tt = video_get_drvdata(dev);
291 287
292 switch (ctrl->id) { 288 switch (ctrl->id) {
293 case V4L2_CID_AUDIO_MUTE: 289 case V4L2_CID_AUDIO_MUTE:
@@ -306,8 +302,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
306static int vidioc_s_ctrl(struct file *file, void *priv, 302static int vidioc_s_ctrl(struct file *file, void *priv,
307 struct v4l2_control *ctrl) 303 struct v4l2_control *ctrl)
308{ 304{
309 struct video_device *dev = video_devdata(file); 305 struct tt_device *tt = video_drvdata(file);
310 struct tt_device *tt = video_get_drvdata(dev);
311 306
312 switch (ctrl->id) { 307 switch (ctrl->id) {
313 case V4L2_CID_AUDIO_MUTE: 308 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-typhoon.c b/drivers/media/radio/radio-typhoon.c
index 27255d7ff1b..952ec35a841 100644
--- a/drivers/media/radio/radio-typhoon.c
+++ b/drivers/media/radio/radio-typhoon.c
@@ -223,8 +223,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
223static int vidioc_s_frequency(struct file *file, void *priv, 223static int vidioc_s_frequency(struct file *file, void *priv,
224 struct v4l2_frequency *f) 224 struct v4l2_frequency *f)
225{ 225{
226 struct video_device *dev = video_devdata(file); 226 struct typhoon_device *typhoon = video_drvdata(file);
227 struct typhoon_device *typhoon = video_get_drvdata(dev);
228 227
229 typhoon->curfreq = f->frequency; 228 typhoon->curfreq = f->frequency;
230 typhoon_setfreq(typhoon, typhoon->curfreq); 229 typhoon_setfreq(typhoon, typhoon->curfreq);
@@ -234,8 +233,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
234static int vidioc_g_frequency(struct file *file, void *priv, 233static int vidioc_g_frequency(struct file *file, void *priv,
235 struct v4l2_frequency *f) 234 struct v4l2_frequency *f)
236{ 235{
237 struct video_device *dev = video_devdata(file); 236 struct typhoon_device *typhoon = video_drvdata(file);
238 struct typhoon_device *typhoon = video_get_drvdata(dev);
239 237
240 f->type = V4L2_TUNER_RADIO; 238 f->type = V4L2_TUNER_RADIO;
241 f->frequency = typhoon->curfreq; 239 f->frequency = typhoon->curfreq;
@@ -261,8 +259,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
261static int vidioc_g_ctrl(struct file *file, void *priv, 259static int vidioc_g_ctrl(struct file *file, void *priv,
262 struct v4l2_control *ctrl) 260 struct v4l2_control *ctrl)
263{ 261{
264 struct video_device *dev = video_devdata(file); 262 struct typhoon_device *typhoon = video_drvdata(file);
265 struct typhoon_device *typhoon = video_get_drvdata(dev);
266 263
267 switch (ctrl->id) { 264 switch (ctrl->id) {
268 case V4L2_CID_AUDIO_MUTE: 265 case V4L2_CID_AUDIO_MUTE:
@@ -278,8 +275,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
278static int vidioc_s_ctrl (struct file *file, void *priv, 275static int vidioc_s_ctrl (struct file *file, void *priv,
279 struct v4l2_control *ctrl) 276 struct v4l2_control *ctrl)
280{ 277{
281 struct video_device *dev = video_devdata(file); 278 struct typhoon_device *typhoon = video_drvdata(file);
282 struct typhoon_device *typhoon = video_get_drvdata(dev);
283 279
284 switch (ctrl->id) { 280 switch (ctrl->id) {
285 case V4L2_CID_AUDIO_MUTE: 281 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c
index 3a9a7772ae5..f75da63b163 100644
--- a/drivers/media/radio/radio-zoltrix.c
+++ b/drivers/media/radio/radio-zoltrix.c
@@ -246,8 +246,7 @@ static int vidioc_querycap(struct file *file, void *priv,
246static int vidioc_g_tuner(struct file *file, void *priv, 246static int vidioc_g_tuner(struct file *file, void *priv,
247 struct v4l2_tuner *v) 247 struct v4l2_tuner *v)
248{ 248{
249 struct video_device *dev = video_devdata(file); 249 struct zol_device *zol = video_drvdata(file);
250 struct zol_device *zol = video_get_drvdata(dev);
251 250
252 if (v->index > 0) 251 if (v->index > 0)
253 return -EINVAL; 252 return -EINVAL;
@@ -277,8 +276,7 @@ static int vidioc_s_tuner(struct file *file, void *priv,
277static int vidioc_s_frequency(struct file *file, void *priv, 276static int vidioc_s_frequency(struct file *file, void *priv,
278 struct v4l2_frequency *f) 277 struct v4l2_frequency *f)
279{ 278{
280 struct video_device *dev = video_devdata(file); 279 struct zol_device *zol = video_drvdata(file);
281 struct zol_device *zol = video_get_drvdata(dev);
282 280
283 zol->curfreq = f->frequency; 281 zol->curfreq = f->frequency;
284 zol_setfreq(zol, zol->curfreq); 282 zol_setfreq(zol, zol->curfreq);
@@ -288,8 +286,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
288static int vidioc_g_frequency(struct file *file, void *priv, 286static int vidioc_g_frequency(struct file *file, void *priv,
289 struct v4l2_frequency *f) 287 struct v4l2_frequency *f)
290{ 288{
291 struct video_device *dev = video_devdata(file); 289 struct zol_device *zol = video_drvdata(file);
292 struct zol_device *zol = video_get_drvdata(dev);
293 290
294 f->type = V4L2_TUNER_RADIO; 291 f->type = V4L2_TUNER_RADIO;
295 f->frequency = zol->curfreq; 292 f->frequency = zol->curfreq;
@@ -314,8 +311,7 @@ static int vidioc_queryctrl(struct file *file, void *priv,
314static int vidioc_g_ctrl(struct file *file, void *priv, 311static int vidioc_g_ctrl(struct file *file, void *priv,
315 struct v4l2_control *ctrl) 312 struct v4l2_control *ctrl)
316{ 313{
317 struct video_device *dev = video_devdata(file); 314 struct zol_device *zol = video_drvdata(file);
318 struct zol_device *zol = video_get_drvdata(dev);
319 315
320 switch (ctrl->id) { 316 switch (ctrl->id) {
321 case V4L2_CID_AUDIO_MUTE: 317 case V4L2_CID_AUDIO_MUTE:
@@ -331,8 +327,7 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
331static int vidioc_s_ctrl(struct file *file, void *priv, 327static int vidioc_s_ctrl(struct file *file, void *priv,
332 struct v4l2_control *ctrl) 328 struct v4l2_control *ctrl)
333{ 329{
334 struct video_device *dev = video_devdata(file); 330 struct zol_device *zol = video_drvdata(file);
335 struct zol_device *zol = video_get_drvdata(dev);
336 331
337 switch (ctrl->id) { 332 switch (ctrl->id) {
338 case V4L2_CID_AUDIO_MUTE: 333 case V4L2_CID_AUDIO_MUTE:
diff --git a/drivers/media/video/cpia2/cpia2_v4l.c b/drivers/media/video/cpia2/cpia2_v4l.c
index eb9f15cd4c4..897e8d1a5c3 100644
--- a/drivers/media/video/cpia2/cpia2_v4l.c
+++ b/drivers/media/video/cpia2/cpia2_v4l.c
@@ -241,8 +241,7 @@ static struct v4l2_queryctrl controls[] = {
241 *****************************************************************************/ 241 *****************************************************************************/
242static int cpia2_open(struct inode *inode, struct file *file) 242static int cpia2_open(struct inode *inode, struct file *file)
243{ 243{
244 struct video_device *dev = video_devdata(file); 244 struct camera_data *cam = video_drvdata(file);
245 struct camera_data *cam = video_get_drvdata(dev);
246 int retval = 0; 245 int retval = 0;
247 246
248 if (!cam) { 247 if (!cam) {
@@ -357,8 +356,7 @@ static int cpia2_close(struct inode *inode, struct file *file)
357static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count, 356static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count,
358 loff_t *off) 357 loff_t *off)
359{ 358{
360 struct video_device *dev = video_devdata(file); 359 struct camera_data *cam = video_drvdata(file);
361 struct camera_data *cam = video_get_drvdata(dev);
362 int noblock = file->f_flags&O_NONBLOCK; 360 int noblock = file->f_flags&O_NONBLOCK;
363 361
364 struct cpia2_fh *fh = file->private_data; 362 struct cpia2_fh *fh = file->private_data;
@@ -382,9 +380,7 @@ static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count,
382 *****************************************************************************/ 380 *****************************************************************************/
383static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait) 381static unsigned int cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait)
384{ 382{
385 struct video_device *dev = video_devdata(filp); 383 struct camera_data *cam = video_drvdata(filp);
386 struct camera_data *cam = video_get_drvdata(dev);
387
388 struct cpia2_fh *fh = filp->private_data; 384 struct cpia2_fh *fh = filp->private_data;
389 385
390 if(!cam) 386 if(!cam)
@@ -1579,8 +1575,7 @@ static int ioctl_dqbuf(void *arg,struct camera_data *cam, struct file *file)
1579static int cpia2_do_ioctl(struct inode *inode, struct file *file, 1575static int cpia2_do_ioctl(struct inode *inode, struct file *file,
1580 unsigned int ioctl_nr, void *arg) 1576 unsigned int ioctl_nr, void *arg)
1581{ 1577{
1582 struct video_device *dev = video_devdata(file); 1578 struct camera_data *cam = video_drvdata(file);
1583 struct camera_data *cam = video_get_drvdata(dev);
1584 int retval = 0; 1579 int retval = 0;
1585 1580
1586 if (!cam) 1581 if (!cam)
@@ -1860,9 +1855,8 @@ static int cpia2_ioctl(struct inode *inode, struct file *file,
1860 *****************************************************************************/ 1855 *****************************************************************************/
1861static int cpia2_mmap(struct file *file, struct vm_area_struct *area) 1856static int cpia2_mmap(struct file *file, struct vm_area_struct *area)
1862{ 1857{
1858 struct camera_data *cam = video_drvdata(file);
1863 int retval; 1859 int retval;
1864 struct video_device *dev = video_devdata(file);
1865 struct camera_data *cam = video_get_drvdata(dev);
1866 1860
1867 /* Priority check */ 1861 /* Priority check */
1868 struct cpia2_fh *fh = file->private_data; 1862 struct cpia2_fh *fh = file->private_data;
diff --git a/drivers/media/video/et61x251/et61x251_core.c b/drivers/media/video/et61x251/et61x251_core.c
index 8db2a05bf9c..7a85c41b0ee 100644
--- a/drivers/media/video/et61x251/et61x251_core.c
+++ b/drivers/media/video/et61x251/et61x251_core.c
@@ -1214,7 +1214,7 @@ static int et61x251_open(struct inode* inode, struct file* filp)
1214 if (!down_read_trylock(&et61x251_dev_lock)) 1214 if (!down_read_trylock(&et61x251_dev_lock))
1215 return -ERESTARTSYS; 1215 return -ERESTARTSYS;
1216 1216
1217 cam = video_get_drvdata(video_devdata(filp)); 1217 cam = video_drvdata(filp);
1218 1218
1219 if (wait_for_completion_interruptible(&cam->probe)) { 1219 if (wait_for_completion_interruptible(&cam->probe)) {
1220 up_read(&et61x251_dev_lock); 1220 up_read(&et61x251_dev_lock);
@@ -1297,7 +1297,7 @@ static int et61x251_release(struct inode* inode, struct file* filp)
1297 1297
1298 down_write(&et61x251_dev_lock); 1298 down_write(&et61x251_dev_lock);
1299 1299
1300 cam = video_get_drvdata(video_devdata(filp)); 1300 cam = video_drvdata(filp);
1301 1301
1302 et61x251_stop_transfer(cam); 1302 et61x251_stop_transfer(cam);
1303 et61x251_release_buffers(cam); 1303 et61x251_release_buffers(cam);
@@ -1318,7 +1318,7 @@ static ssize_t
1318et61x251_read(struct file* filp, char __user * buf, 1318et61x251_read(struct file* filp, char __user * buf,
1319 size_t count, loff_t* f_pos) 1319 size_t count, loff_t* f_pos)
1320{ 1320{
1321 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 1321 struct et61x251_device *cam = video_drvdata(filp);
1322 struct et61x251_frame_t* f, * i; 1322 struct et61x251_frame_t* f, * i;
1323 unsigned long lock_flags; 1323 unsigned long lock_flags;
1324 long timeout; 1324 long timeout;
@@ -1426,7 +1426,7 @@ exit:
1426 1426
1427static unsigned int et61x251_poll(struct file *filp, poll_table *wait) 1427static unsigned int et61x251_poll(struct file *filp, poll_table *wait)
1428{ 1428{
1429 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 1429 struct et61x251_device *cam = video_drvdata(filp);
1430 struct et61x251_frame_t* f; 1430 struct et61x251_frame_t* f;
1431 unsigned long lock_flags; 1431 unsigned long lock_flags;
1432 unsigned int mask = 0; 1432 unsigned int mask = 0;
@@ -1502,7 +1502,7 @@ static struct vm_operations_struct et61x251_vm_ops = {
1502 1502
1503static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma) 1503static int et61x251_mmap(struct file* filp, struct vm_area_struct *vma)
1504{ 1504{
1505 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 1505 struct et61x251_device *cam = video_drvdata(filp);
1506 unsigned long size = vma->vm_end - vma->vm_start, 1506 unsigned long size = vma->vm_end - vma->vm_start,
1507 start = vma->vm_start; 1507 start = vma->vm_start;
1508 void *pos; 1508 void *pos;
@@ -2395,7 +2395,7 @@ et61x251_vidioc_s_parm(struct et61x251_device* cam, void __user * arg)
2395static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp, 2395static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
2396 unsigned int cmd, void __user * arg) 2396 unsigned int cmd, void __user * arg)
2397{ 2397{
2398 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 2398 struct et61x251_device *cam = video_drvdata(filp);
2399 2399
2400 switch (cmd) { 2400 switch (cmd) {
2401 2401
@@ -2490,7 +2490,7 @@ static int et61x251_ioctl_v4l2(struct inode* inode, struct file* filp,
2490static int et61x251_ioctl(struct inode* inode, struct file* filp, 2490static int et61x251_ioctl(struct inode* inode, struct file* filp,
2491 unsigned int cmd, unsigned long arg) 2491 unsigned int cmd, unsigned long arg)
2492{ 2492{
2493 struct et61x251_device* cam = video_get_drvdata(video_devdata(filp)); 2493 struct et61x251_device *cam = video_drvdata(filp);
2494 int err = 0; 2494 int err = 0;
2495 2495
2496 if (mutex_lock_interruptible(&cam->fileop_mutex)) 2496 if (mutex_lock_interruptible(&cam->fileop_mutex))
diff --git a/drivers/media/video/saa5246a.c b/drivers/media/video/saa5246a.c
index 0178b49da0c..ff81049e936 100644
--- a/drivers/media/video/saa5246a.c
+++ b/drivers/media/video/saa5246a.c
@@ -149,6 +149,7 @@ static int saa5246a_probe(struct i2c_adapter *adap)
149static int saa5246a_detach(struct i2c_client *client) 149static int saa5246a_detach(struct i2c_client *client)
150{ 150{
151 struct video_device *vd = i2c_get_clientdata(client); 151 struct video_device *vd = i2c_get_clientdata(client);
152
152 i2c_detach_client(client); 153 i2c_detach_client(client);
153 video_unregister_device(vd); 154 video_unregister_device(vd);
154 kfree(video_get_drvdata(vd)); 155 kfree(video_get_drvdata(vd));
@@ -581,8 +582,7 @@ static inline int saa5246a_stop_dau(struct saa5246a_device *t,
581static int do_saa5246a_ioctl(struct inode *inode, struct file *file, 582static int do_saa5246a_ioctl(struct inode *inode, struct file *file,
582 unsigned int cmd, void *arg) 583 unsigned int cmd, void *arg)
583{ 584{
584 struct video_device *vd = video_devdata(file); 585 struct saa5246a_device *t = video_drvdata(file);
585 struct saa5246a_device *t = video_get_drvdata(vd);
586 586
587 switch(cmd) 587 switch(cmd)
588 { 588 {
@@ -723,8 +723,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
723static int saa5246a_ioctl(struct inode *inode, struct file *file, 723static int saa5246a_ioctl(struct inode *inode, struct file *file,
724 unsigned int cmd, unsigned long arg) 724 unsigned int cmd, unsigned long arg)
725{ 725{
726 struct video_device *vd = video_devdata(file); 726 struct saa5246a_device *t = video_drvdata(file);
727 struct saa5246a_device *t = video_get_drvdata(vd);
728 int err; 727 int err;
729 728
730 cmd = vtx_fix_command(cmd); 729 cmd = vtx_fix_command(cmd);
@@ -736,8 +735,7 @@ static int saa5246a_ioctl(struct inode *inode, struct file *file,
736 735
737static int saa5246a_open(struct inode *inode, struct file *file) 736static int saa5246a_open(struct inode *inode, struct file *file)
738{ 737{
739 struct video_device *vd = video_devdata(file); 738 struct saa5246a_device *t = video_drvdata(file);
740 struct saa5246a_device *t = video_get_drvdata(vd);
741 739
742 if (t->client == NULL) 740 if (t->client == NULL)
743 return -ENODEV; 741 return -ENODEV;
@@ -779,8 +777,7 @@ static int saa5246a_open(struct inode *inode, struct file *file)
779 777
780static int saa5246a_release(struct inode *inode, struct file *file) 778static int saa5246a_release(struct inode *inode, struct file *file)
781{ 779{
782 struct video_device *vd = video_devdata(file); 780 struct saa5246a_device *t = video_drvdata(file);
783 struct saa5246a_device *t = video_get_drvdata(vd);
784 781
785 /* Stop all acquisition circuits. */ 782 /* Stop all acquisition circuits. */
786 i2c_senddata(t, SAA5246A_REGISTER_R1, 783 i2c_senddata(t, SAA5246A_REGISTER_R1,
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index c784715a0b0..8517aa4f068 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -319,8 +319,7 @@ static int do_saa5249_ioctl(struct inode *inode, struct file *file,
319 unsigned int cmd, void *arg) 319 unsigned int cmd, void *arg)
320{ 320{
321 static int virtual_mode = false; 321 static int virtual_mode = false;
322 struct video_device *vd = video_devdata(file); 322 struct saa5249_device *t = video_drvdata(file);
323 struct saa5249_device *t = video_get_drvdata(vd);
324 323
325 switch(cmd) 324 switch(cmd)
326 { 325 {
@@ -618,8 +617,7 @@ static inline unsigned int vtx_fix_command(unsigned int cmd)
618static int saa5249_ioctl(struct inode *inode, struct file *file, 617static int saa5249_ioctl(struct inode *inode, struct file *file,
619 unsigned int cmd, unsigned long arg) 618 unsigned int cmd, unsigned long arg)
620{ 619{
621 struct video_device *vd = video_devdata(file); 620 struct saa5249_device *t = video_drvdata(file);
622 struct saa5249_device *t = video_get_drvdata(vd);
623 int err; 621 int err;
624 622
625 cmd = vtx_fix_command(cmd); 623 cmd = vtx_fix_command(cmd);
@@ -631,8 +629,7 @@ static int saa5249_ioctl(struct inode *inode, struct file *file,
631 629
632static int saa5249_open(struct inode *inode, struct file *file) 630static int saa5249_open(struct inode *inode, struct file *file)
633{ 631{
634 struct video_device *vd = video_devdata(file); 632 struct saa5249_device *t = video_drvdata(file);
635 struct saa5249_device *t = video_get_drvdata(vd);
636 int pgbuf; 633 int pgbuf;
637 634
638 if (t->client == NULL) 635 if (t->client == NULL)
@@ -669,8 +666,7 @@ static int saa5249_open(struct inode *inode, struct file *file)
669 666
670static int saa5249_release(struct inode *inode, struct file *file) 667static int saa5249_release(struct inode *inode, struct file *file)
671{ 668{
672 struct video_device *vd = video_devdata(file); 669 struct saa5249_device *t = video_drvdata(file);
673 struct saa5249_device *t = video_get_drvdata(vd);
674 670
675 i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */ 671 i2c_senddata(t, 1, 0x20, -1); /* Turn off CCT */
676 i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */ 672 i2c_senddata(t, 5, 3, 3, -1); /* Turn off TV-display */
diff --git a/drivers/media/video/sn9c102/sn9c102_core.c b/drivers/media/video/sn9c102/sn9c102_core.c
index 2da6938718f..4b76c45c148 100644
--- a/drivers/media/video/sn9c102/sn9c102_core.c
+++ b/drivers/media/video/sn9c102/sn9c102_core.c
@@ -1746,7 +1746,7 @@ static int sn9c102_open(struct inode* inode, struct file* filp)
1746 if (!down_read_trylock(&sn9c102_dev_lock)) 1746 if (!down_read_trylock(&sn9c102_dev_lock))
1747 return -ERESTARTSYS; 1747 return -ERESTARTSYS;
1748 1748
1749 cam = video_get_drvdata(video_devdata(filp)); 1749 cam = video_drvdata(filp);
1750 1750
1751 if (wait_for_completion_interruptible(&cam->probe)) { 1751 if (wait_for_completion_interruptible(&cam->probe)) {
1752 up_read(&sn9c102_dev_lock); 1752 up_read(&sn9c102_dev_lock);
@@ -1843,7 +1843,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
1843 1843
1844 down_write(&sn9c102_dev_lock); 1844 down_write(&sn9c102_dev_lock);
1845 1845
1846 cam = video_get_drvdata(video_devdata(filp)); 1846 cam = video_drvdata(filp);
1847 1847
1848 sn9c102_stop_transfer(cam); 1848 sn9c102_stop_transfer(cam);
1849 sn9c102_release_buffers(cam); 1849 sn9c102_release_buffers(cam);
@@ -1863,7 +1863,7 @@ static int sn9c102_release(struct inode* inode, struct file* filp)
1863static ssize_t 1863static ssize_t
1864sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) 1864sn9c102_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
1865{ 1865{
1866 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 1866 struct sn9c102_device *cam = video_drvdata(filp);
1867 struct sn9c102_frame_t* f, * i; 1867 struct sn9c102_frame_t* f, * i;
1868 unsigned long lock_flags; 1868 unsigned long lock_flags;
1869 long timeout; 1869 long timeout;
@@ -1987,7 +1987,7 @@ exit:
1987 1987
1988static unsigned int sn9c102_poll(struct file *filp, poll_table *wait) 1988static unsigned int sn9c102_poll(struct file *filp, poll_table *wait)
1989{ 1989{
1990 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 1990 struct sn9c102_device *cam = video_drvdata(filp);
1991 struct sn9c102_frame_t* f; 1991 struct sn9c102_frame_t* f;
1992 unsigned long lock_flags; 1992 unsigned long lock_flags;
1993 unsigned int mask = 0; 1993 unsigned int mask = 0;
@@ -2063,7 +2063,7 @@ static struct vm_operations_struct sn9c102_vm_ops = {
2063 2063
2064static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) 2064static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma)
2065{ 2065{
2066 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 2066 struct sn9c102_device *cam = video_drvdata(filp);
2067 unsigned long size = vma->vm_end - vma->vm_start, 2067 unsigned long size = vma->vm_end - vma->vm_start,
2068 start = vma->vm_start; 2068 start = vma->vm_start;
2069 void *pos; 2069 void *pos;
@@ -3075,7 +3075,7 @@ sn9c102_vidioc_s_audio(struct sn9c102_device* cam, void __user * arg)
3075static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp, 3075static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
3076 unsigned int cmd, void __user * arg) 3076 unsigned int cmd, void __user * arg)
3077{ 3077{
3078 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 3078 struct sn9c102_device *cam = video_drvdata(filp);
3079 3079
3080 switch (cmd) { 3080 switch (cmd) {
3081 3081
@@ -3179,7 +3179,7 @@ static int sn9c102_ioctl_v4l2(struct inode* inode, struct file* filp,
3179static int sn9c102_ioctl(struct inode* inode, struct file* filp, 3179static int sn9c102_ioctl(struct inode* inode, struct file* filp,
3180 unsigned int cmd, unsigned long arg) 3180 unsigned int cmd, unsigned long arg)
3181{ 3181{
3182 struct sn9c102_device* cam = video_get_drvdata(video_devdata(filp)); 3182 struct sn9c102_device *cam = video_drvdata(filp);
3183 int err = 0; 3183 int err = 0;
3184 3184
3185 if (mutex_lock_interruptible(&cam->fileop_mutex)) 3185 if (mutex_lock_interruptible(&cam->fileop_mutex))
diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c
index 1ffcc393fcb..7a127d6bfde 100644
--- a/drivers/media/video/usbvideo/vicam.c
+++ b/drivers/media/video/usbvideo/vicam.c
@@ -472,8 +472,7 @@ vicam_ioctl(struct inode *inode, struct file *file, unsigned int ioctlnr, unsign
472static int 472static int
473vicam_open(struct inode *inode, struct file *file) 473vicam_open(struct inode *inode, struct file *file)
474{ 474{
475 struct video_device *dev = video_devdata(file); 475 struct vicam_camera *cam = video_drvdata(file);
476 struct vicam_camera *cam = video_get_drvdata(dev);
477 476
478 DBG("open\n"); 477 DBG("open\n");
479 478
diff --git a/drivers/media/video/usbvision/usbvision-video.c b/drivers/media/video/usbvision/usbvision-video.c
index b76295a5be8..782ee643601 100644
--- a/drivers/media/video/usbvision/usbvision-video.c
+++ b/drivers/media/video/usbvision/usbvision-video.c
@@ -360,9 +360,7 @@ static void usbvision_remove_sysfs(struct video_device *vdev)
360 */ 360 */
361static int usbvision_v4l2_open(struct inode *inode, struct file *file) 361static int usbvision_v4l2_open(struct inode *inode, struct file *file)
362{ 362{
363 struct video_device *dev = video_devdata(file); 363 struct usb_usbvision *usbvision = video_drvdata(file);
364 struct usb_usbvision *usbvision =
365 (struct usb_usbvision *) video_get_drvdata(dev);
366 int errCode = 0; 364 int errCode = 0;
367 365
368 PDEBUG(DBG_IO, "open"); 366 PDEBUG(DBG_IO, "open");
@@ -439,9 +437,7 @@ static int usbvision_v4l2_open(struct inode *inode, struct file *file)
439 */ 437 */
440static int usbvision_v4l2_close(struct inode *inode, struct file *file) 438static int usbvision_v4l2_close(struct inode *inode, struct file *file)
441{ 439{
442 struct video_device *dev = video_devdata(file); 440 struct usb_usbvision *usbvision = video_drvdata(file);
443 struct usb_usbvision *usbvision =
444 (struct usb_usbvision *) video_get_drvdata(dev);
445 441
446 PDEBUG(DBG_IO, "close"); 442 PDEBUG(DBG_IO, "close");
447 mutex_lock(&usbvision->lock); 443 mutex_lock(&usbvision->lock);
@@ -486,9 +482,7 @@ static int usbvision_v4l2_close(struct inode *inode, struct file *file)
486static int vidioc_g_register (struct file *file, void *priv, 482static int vidioc_g_register (struct file *file, void *priv,
487 struct v4l2_register *reg) 483 struct v4l2_register *reg)
488{ 484{
489 struct video_device *dev = video_devdata(file); 485 struct usb_usbvision *usbvision = video_drvdata(file);
490 struct usb_usbvision *usbvision =
491 (struct usb_usbvision *) video_get_drvdata(dev);
492 int errCode; 486 int errCode;
493 487
494 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 488 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
@@ -507,9 +501,7 @@ static int vidioc_g_register (struct file *file, void *priv,
507static int vidioc_s_register (struct file *file, void *priv, 501static int vidioc_s_register (struct file *file, void *priv,
508 struct v4l2_register *reg) 502 struct v4l2_register *reg)
509{ 503{
510 struct video_device *dev = video_devdata(file); 504 struct usb_usbvision *usbvision = video_drvdata(file);
511 struct usb_usbvision *usbvision =
512 (struct usb_usbvision *) video_get_drvdata(dev);
513 int errCode; 505 int errCode;
514 506
515 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip)) 507 if (!v4l2_chip_match_host(reg->match_type, reg->match_chip))
@@ -528,9 +520,7 @@ static int vidioc_s_register (struct file *file, void *priv,
528static int vidioc_querycap (struct file *file, void *priv, 520static int vidioc_querycap (struct file *file, void *priv,
529 struct v4l2_capability *vc) 521 struct v4l2_capability *vc)
530{ 522{
531 struct video_device *dev = video_devdata(file); 523 struct usb_usbvision *usbvision = video_drvdata(file);
532 struct usb_usbvision *usbvision =
533 (struct usb_usbvision *) video_get_drvdata(dev);
534 524
535 strlcpy(vc->driver, "USBVision", sizeof(vc->driver)); 525 strlcpy(vc->driver, "USBVision", sizeof(vc->driver));
536 strlcpy(vc->card, 526 strlcpy(vc->card,
@@ -550,9 +540,7 @@ static int vidioc_querycap (struct file *file, void *priv,
550static int vidioc_enum_input (struct file *file, void *priv, 540static int vidioc_enum_input (struct file *file, void *priv,
551 struct v4l2_input *vi) 541 struct v4l2_input *vi)
552{ 542{
553 struct video_device *dev = video_devdata(file); 543 struct usb_usbvision *usbvision = video_drvdata(file);
554 struct usb_usbvision *usbvision =
555 (struct usb_usbvision *) video_get_drvdata(dev);
556 int chan; 544 int chan;
557 545
558 if ((vi->index >= usbvision->video_inputs) || (vi->index < 0) ) 546 if ((vi->index >= usbvision->video_inputs) || (vi->index < 0) )
@@ -605,9 +593,7 @@ static int vidioc_enum_input (struct file *file, void *priv,
605 593
606static int vidioc_g_input (struct file *file, void *priv, unsigned int *input) 594static int vidioc_g_input (struct file *file, void *priv, unsigned int *input)
607{ 595{
608 struct video_device *dev = video_devdata(file); 596 struct usb_usbvision *usbvision = video_drvdata(file);
609 struct usb_usbvision *usbvision =
610 (struct usb_usbvision *) video_get_drvdata(dev);
611 597
612 *input = usbvision->ctl_input; 598 *input = usbvision->ctl_input;
613 return 0; 599 return 0;
@@ -615,9 +601,7 @@ static int vidioc_g_input (struct file *file, void *priv, unsigned int *input)
615 601
616static int vidioc_s_input (struct file *file, void *priv, unsigned int input) 602static int vidioc_s_input (struct file *file, void *priv, unsigned int input)
617{ 603{
618 struct video_device *dev = video_devdata(file); 604 struct usb_usbvision *usbvision = video_drvdata(file);
619 struct usb_usbvision *usbvision =
620 (struct usb_usbvision *) video_get_drvdata(dev);
621 605
622 if ((input >= usbvision->video_inputs) || (input < 0) ) 606 if ((input >= usbvision->video_inputs) || (input < 0) )
623 return -EINVAL; 607 return -EINVAL;
@@ -634,9 +618,8 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int input)
634 618
635static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id) 619static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
636{ 620{
637 struct video_device *dev = video_devdata(file); 621 struct usb_usbvision *usbvision = video_drvdata(file);
638 struct usb_usbvision *usbvision = 622
639 (struct usb_usbvision *) video_get_drvdata(dev);
640 usbvision->tvnormId=*id; 623 usbvision->tvnormId=*id;
641 624
642 mutex_lock(&usbvision->lock); 625 mutex_lock(&usbvision->lock);
@@ -652,9 +635,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *id)
652static int vidioc_g_tuner (struct file *file, void *priv, 635static int vidioc_g_tuner (struct file *file, void *priv,
653 struct v4l2_tuner *vt) 636 struct v4l2_tuner *vt)
654{ 637{
655 struct video_device *dev = video_devdata(file); 638 struct usb_usbvision *usbvision = video_drvdata(file);
656 struct usb_usbvision *usbvision =
657 (struct usb_usbvision *) video_get_drvdata(dev);
658 639
659 if (!usbvision->have_tuner || vt->index) // Only tuner 0 640 if (!usbvision->have_tuner || vt->index) // Only tuner 0
660 return -EINVAL; 641 return -EINVAL;
@@ -673,9 +654,7 @@ static int vidioc_g_tuner (struct file *file, void *priv,
673static int vidioc_s_tuner (struct file *file, void *priv, 654static int vidioc_s_tuner (struct file *file, void *priv,
674 struct v4l2_tuner *vt) 655 struct v4l2_tuner *vt)
675{ 656{
676 struct video_device *dev = video_devdata(file); 657 struct usb_usbvision *usbvision = video_drvdata(file);
677 struct usb_usbvision *usbvision =
678 (struct usb_usbvision *) video_get_drvdata(dev);
679 658
680 // Only no or one tuner for now 659 // Only no or one tuner for now
681 if (!usbvision->have_tuner || vt->index) 660 if (!usbvision->have_tuner || vt->index)
@@ -689,9 +668,7 @@ static int vidioc_s_tuner (struct file *file, void *priv,
689static int vidioc_g_frequency (struct file *file, void *priv, 668static int vidioc_g_frequency (struct file *file, void *priv,
690 struct v4l2_frequency *freq) 669 struct v4l2_frequency *freq)
691{ 670{
692 struct video_device *dev = video_devdata(file); 671 struct usb_usbvision *usbvision = video_drvdata(file);
693 struct usb_usbvision *usbvision =
694 (struct usb_usbvision *) video_get_drvdata(dev);
695 672
696 freq->tuner = 0; // Only one tuner 673 freq->tuner = 0; // Only one tuner
697 if(usbvision->radio) { 674 if(usbvision->radio) {
@@ -707,9 +684,7 @@ static int vidioc_g_frequency (struct file *file, void *priv,
707static int vidioc_s_frequency (struct file *file, void *priv, 684static int vidioc_s_frequency (struct file *file, void *priv,
708 struct v4l2_frequency *freq) 685 struct v4l2_frequency *freq)
709{ 686{
710 struct video_device *dev = video_devdata(file); 687 struct usb_usbvision *usbvision = video_drvdata(file);
711 struct usb_usbvision *usbvision =
712 (struct usb_usbvision *) video_get_drvdata(dev);
713 688
714 // Only no or one tuner for now 689 // Only no or one tuner for now
715 if (!usbvision->have_tuner || freq->tuner) 690 if (!usbvision->have_tuner || freq->tuner)
@@ -723,9 +698,7 @@ static int vidioc_s_frequency (struct file *file, void *priv,
723 698
724static int vidioc_g_audio (struct file *file, void *priv, struct v4l2_audio *a) 699static int vidioc_g_audio (struct file *file, void *priv, struct v4l2_audio *a)
725{ 700{
726 struct video_device *dev = video_devdata(file); 701 struct usb_usbvision *usbvision = video_drvdata(file);
727 struct usb_usbvision *usbvision =
728 (struct usb_usbvision *) video_get_drvdata(dev);
729 702
730 memset(a,0,sizeof(*a)); 703 memset(a,0,sizeof(*a));
731 if(usbvision->radio) { 704 if(usbvision->radio) {
@@ -750,9 +723,7 @@ static int vidioc_s_audio (struct file *file, void *fh,
750static int vidioc_queryctrl (struct file *file, void *priv, 723static int vidioc_queryctrl (struct file *file, void *priv,
751 struct v4l2_queryctrl *ctrl) 724 struct v4l2_queryctrl *ctrl)
752{ 725{
753 struct video_device *dev = video_devdata(file); 726 struct usb_usbvision *usbvision = video_drvdata(file);
754 struct usb_usbvision *usbvision =
755 (struct usb_usbvision *) video_get_drvdata(dev);
756 int id=ctrl->id; 727 int id=ctrl->id;
757 728
758 memset(ctrl,0,sizeof(*ctrl)); 729 memset(ctrl,0,sizeof(*ctrl));
@@ -769,9 +740,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
769static int vidioc_g_ctrl (struct file *file, void *priv, 740static int vidioc_g_ctrl (struct file *file, void *priv,
770 struct v4l2_control *ctrl) 741 struct v4l2_control *ctrl)
771{ 742{
772 struct video_device *dev = video_devdata(file); 743 struct usb_usbvision *usbvision = video_drvdata(file);
773 struct usb_usbvision *usbvision =
774 (struct usb_usbvision *) video_get_drvdata(dev);
775 call_i2c_clients(usbvision, VIDIOC_G_CTRL, ctrl); 744 call_i2c_clients(usbvision, VIDIOC_G_CTRL, ctrl);
776 745
777 return 0; 746 return 0;
@@ -780,9 +749,7 @@ static int vidioc_g_ctrl (struct file *file, void *priv,
780static int vidioc_s_ctrl (struct file *file, void *priv, 749static int vidioc_s_ctrl (struct file *file, void *priv,
781 struct v4l2_control *ctrl) 750 struct v4l2_control *ctrl)
782{ 751{
783 struct video_device *dev = video_devdata(file); 752 struct usb_usbvision *usbvision = video_drvdata(file);
784 struct usb_usbvision *usbvision =
785 (struct usb_usbvision *) video_get_drvdata(dev);
786 call_i2c_clients(usbvision, VIDIOC_S_CTRL, ctrl); 753 call_i2c_clients(usbvision, VIDIOC_S_CTRL, ctrl);
787 754
788 return 0; 755 return 0;
@@ -791,9 +758,7 @@ static int vidioc_s_ctrl (struct file *file, void *priv,
791static int vidioc_reqbufs (struct file *file, 758static int vidioc_reqbufs (struct file *file,
792 void *priv, struct v4l2_requestbuffers *vr) 759 void *priv, struct v4l2_requestbuffers *vr)
793{ 760{
794 struct video_device *dev = video_devdata(file); 761 struct usb_usbvision *usbvision = video_drvdata(file);
795 struct usb_usbvision *usbvision =
796 (struct usb_usbvision *) video_get_drvdata(dev);
797 int ret; 762 int ret;
798 763
799 RESTRICT_TO_RANGE(vr->count,1,USBVISION_NUMFRAMES); 764 RESTRICT_TO_RANGE(vr->count,1,USBVISION_NUMFRAMES);
@@ -821,9 +786,7 @@ static int vidioc_reqbufs (struct file *file,
821static int vidioc_querybuf (struct file *file, 786static int vidioc_querybuf (struct file *file,
822 void *priv, struct v4l2_buffer *vb) 787 void *priv, struct v4l2_buffer *vb)
823{ 788{
824 struct video_device *dev = video_devdata(file); 789 struct usb_usbvision *usbvision = video_drvdata(file);
825 struct usb_usbvision *usbvision =
826 (struct usb_usbvision *) video_get_drvdata(dev);
827 struct usbvision_frame *frame; 790 struct usbvision_frame *frame;
828 791
829 /* FIXME : must control 792 /* FIXME : must control
@@ -859,9 +822,7 @@ static int vidioc_querybuf (struct file *file,
859 822
860static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb) 823static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb)
861{ 824{
862 struct video_device *dev = video_devdata(file); 825 struct usb_usbvision *usbvision = video_drvdata(file);
863 struct usb_usbvision *usbvision =
864 (struct usb_usbvision *) video_get_drvdata(dev);
865 struct usbvision_frame *frame; 826 struct usbvision_frame *frame;
866 unsigned long lock_flags; 827 unsigned long lock_flags;
867 828
@@ -898,9 +859,7 @@ static int vidioc_qbuf (struct file *file, void *priv, struct v4l2_buffer *vb)
898 859
899static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb) 860static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb)
900{ 861{
901 struct video_device *dev = video_devdata(file); 862 struct usb_usbvision *usbvision = video_drvdata(file);
902 struct usb_usbvision *usbvision =
903 (struct usb_usbvision *) video_get_drvdata(dev);
904 int ret; 863 int ret;
905 struct usbvision_frame *f; 864 struct usbvision_frame *f;
906 unsigned long lock_flags; 865 unsigned long lock_flags;
@@ -941,9 +900,7 @@ static int vidioc_dqbuf (struct file *file, void *priv, struct v4l2_buffer *vb)
941 900
942static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) 901static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
943{ 902{
944 struct video_device *dev = video_devdata(file); 903 struct usb_usbvision *usbvision = video_drvdata(file);
945 struct usb_usbvision *usbvision =
946 (struct usb_usbvision *) video_get_drvdata(dev);
947 int b=V4L2_BUF_TYPE_VIDEO_CAPTURE; 904 int b=V4L2_BUF_TYPE_VIDEO_CAPTURE;
948 905
949 usbvision->streaming = Stream_On; 906 usbvision->streaming = Stream_On;
@@ -955,9 +912,7 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
955static int vidioc_streamoff(struct file *file, 912static int vidioc_streamoff(struct file *file,
956 void *priv, enum v4l2_buf_type type) 913 void *priv, enum v4l2_buf_type type)
957{ 914{
958 struct video_device *dev = video_devdata(file); 915 struct usb_usbvision *usbvision = video_drvdata(file);
959 struct usb_usbvision *usbvision =
960 (struct usb_usbvision *) video_get_drvdata(dev);
961 int b=V4L2_BUF_TYPE_VIDEO_CAPTURE; 916 int b=V4L2_BUF_TYPE_VIDEO_CAPTURE;
962 917
963 if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE) 918 if (type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
@@ -990,9 +945,7 @@ static int vidioc_enum_fmt_vid_cap (struct file *file, void *priv,
990static int vidioc_g_fmt_vid_cap (struct file *file, void *priv, 945static int vidioc_g_fmt_vid_cap (struct file *file, void *priv,
991 struct v4l2_format *vf) 946 struct v4l2_format *vf)
992{ 947{
993 struct video_device *dev = video_devdata(file); 948 struct usb_usbvision *usbvision = video_drvdata(file);
994 struct usb_usbvision *usbvision =
995 (struct usb_usbvision *) video_get_drvdata(dev);
996 vf->fmt.pix.width = usbvision->curwidth; 949 vf->fmt.pix.width = usbvision->curwidth;
997 vf->fmt.pix.height = usbvision->curheight; 950 vf->fmt.pix.height = usbvision->curheight;
998 vf->fmt.pix.pixelformat = usbvision->palette.format; 951 vf->fmt.pix.pixelformat = usbvision->palette.format;
@@ -1008,9 +961,7 @@ static int vidioc_g_fmt_vid_cap (struct file *file, void *priv,
1008static int vidioc_try_fmt_vid_cap (struct file *file, void *priv, 961static int vidioc_try_fmt_vid_cap (struct file *file, void *priv,
1009 struct v4l2_format *vf) 962 struct v4l2_format *vf)
1010{ 963{
1011 struct video_device *dev = video_devdata(file); 964 struct usb_usbvision *usbvision = video_drvdata(file);
1012 struct usb_usbvision *usbvision =
1013 (struct usb_usbvision *) video_get_drvdata(dev);
1014 int formatIdx; 965 int formatIdx;
1015 966
1016 /* Find requested format in available ones */ 967 /* Find requested format in available ones */
@@ -1038,9 +989,7 @@ static int vidioc_try_fmt_vid_cap (struct file *file, void *priv,
1038static int vidioc_s_fmt_vid_cap(struct file *file, void *priv, 989static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
1039 struct v4l2_format *vf) 990 struct v4l2_format *vf)
1040{ 991{
1041 struct video_device *dev = video_devdata(file); 992 struct usb_usbvision *usbvision = video_drvdata(file);
1042 struct usb_usbvision *usbvision =
1043 (struct usb_usbvision *) video_get_drvdata(dev);
1044 int ret; 993 int ret;
1045 994
1046 if( 0 != (ret=vidioc_try_fmt_vid_cap (file, priv, vf)) ) { 995 if( 0 != (ret=vidioc_try_fmt_vid_cap (file, priv, vf)) ) {
@@ -1068,9 +1017,7 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
1068static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf, 1017static ssize_t usbvision_v4l2_read(struct file *file, char __user *buf,
1069 size_t count, loff_t *ppos) 1018 size_t count, loff_t *ppos)
1070{ 1019{
1071 struct video_device *dev = video_devdata(file); 1020 struct usb_usbvision *usbvision = video_drvdata(file);
1072 struct usb_usbvision *usbvision =
1073 (struct usb_usbvision *) video_get_drvdata(dev);
1074 int noblock = file->f_flags & O_NONBLOCK; 1021 int noblock = file->f_flags & O_NONBLOCK;
1075 unsigned long lock_flags; 1022 unsigned long lock_flags;
1076 1023
@@ -1179,10 +1126,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
1179 start = vma->vm_start; 1126 start = vma->vm_start;
1180 void *pos; 1127 void *pos;
1181 u32 i; 1128 u32 i;
1182 1129 struct usb_usbvision *usbvision = video_drvdata(file);
1183 struct video_device *dev = video_devdata(file);
1184 struct usb_usbvision *usbvision =
1185 (struct usb_usbvision *) video_get_drvdata(dev);
1186 1130
1187 PDEBUG(DBG_MMAP, "mmap"); 1131 PDEBUG(DBG_MMAP, "mmap");
1188 1132
@@ -1239,9 +1183,7 @@ static int usbvision_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
1239 */ 1183 */
1240static int usbvision_radio_open(struct inode *inode, struct file *file) 1184static int usbvision_radio_open(struct inode *inode, struct file *file)
1241{ 1185{
1242 struct video_device *dev = video_devdata(file); 1186 struct usb_usbvision *usbvision = video_drvdata(file);
1243 struct usb_usbvision *usbvision =
1244 (struct usb_usbvision *) video_get_drvdata(dev);
1245 int errCode = 0; 1187 int errCode = 0;
1246 1188
1247 PDEBUG(DBG_IO, "%s:", __func__); 1189 PDEBUG(DBG_IO, "%s:", __func__);
@@ -1291,9 +1233,7 @@ out:
1291 1233
1292static int usbvision_radio_close(struct inode *inode, struct file *file) 1234static int usbvision_radio_close(struct inode *inode, struct file *file)
1293{ 1235{
1294 struct video_device *dev = video_devdata(file); 1236 struct usb_usbvision *usbvision = video_drvdata(file);
1295 struct usb_usbvision *usbvision =
1296 (struct usb_usbvision *) video_get_drvdata(dev);
1297 int errCode = 0; 1237 int errCode = 0;
1298 1238
1299 PDEBUG(DBG_IO, ""); 1239 PDEBUG(DBG_IO, "");
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index d7bd71be40a..d4758c8e13a 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -400,15 +400,13 @@ static int uvc_has_privileges(struct uvc_fh *handle)
400 400
401static int uvc_v4l2_open(struct inode *inode, struct file *file) 401static int uvc_v4l2_open(struct inode *inode, struct file *file)
402{ 402{
403 struct video_device *vdev;
404 struct uvc_video_device *video; 403 struct uvc_video_device *video;
405 struct uvc_fh *handle; 404 struct uvc_fh *handle;
406 int ret = 0; 405 int ret = 0;
407 406
408 uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_open\n"); 407 uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_open\n");
409 mutex_lock(&uvc_driver.open_mutex); 408 mutex_lock(&uvc_driver.open_mutex);
410 vdev = video_devdata(file); 409 video = video_drvdata(file);
411 video = video_get_drvdata(vdev);
412 410
413 if (video->dev->state & UVC_DEV_DISCONNECTED) { 411 if (video->dev->state & UVC_DEV_DISCONNECTED) {
414 ret = -ENODEV; 412 ret = -ENODEV;
@@ -440,8 +438,7 @@ done:
440 438
441static int uvc_v4l2_release(struct inode *inode, struct file *file) 439static int uvc_v4l2_release(struct inode *inode, struct file *file)
442{ 440{
443 struct video_device *vdev = video_devdata(file); 441 struct uvc_video_device *video = video_drvdata(file);
444 struct uvc_video_device *video = video_get_drvdata(vdev);
445 struct uvc_fh *handle = (struct uvc_fh *)file->private_data; 442 struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
446 443
447 uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_release\n"); 444 uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_release\n");
@@ -1031,8 +1028,7 @@ static struct vm_operations_struct uvc_vm_ops = {
1031 1028
1032static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma) 1029static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
1033{ 1030{
1034 struct video_device *vdev = video_devdata(file); 1031 struct uvc_video_device *video = video_drvdata(file);
1035 struct uvc_video_device *video = video_get_drvdata(vdev);
1036 struct uvc_buffer *uninitialized_var(buffer); 1032 struct uvc_buffer *uninitialized_var(buffer);
1037 struct page *page; 1033 struct page *page;
1038 unsigned long addr, start, size; 1034 unsigned long addr, start, size;
@@ -1085,8 +1081,7 @@ done:
1085 1081
1086static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait) 1082static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait)
1087{ 1083{
1088 struct video_device *vdev = video_devdata(file); 1084 struct uvc_video_device *video = video_drvdata(file);
1089 struct uvc_video_device *video = video_get_drvdata(vdev);
1090 1085
1091 uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_poll\n"); 1086 uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_poll\n");
1092 1087
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
index ca421cc84f8..8ec57df1904 100644
--- a/drivers/media/video/vino.c
+++ b/drivers/media/video/vino.c
@@ -4024,8 +4024,7 @@ out:
4024 4024
4025static int vino_open(struct inode *inode, struct file *file) 4025static int vino_open(struct inode *inode, struct file *file)
4026{ 4026{
4027 struct video_device *dev = video_devdata(file); 4027 struct vino_channel_settings *vcs = video_drvdata(file);
4028 struct vino_channel_settings *vcs = video_get_drvdata(dev);
4029 int ret = 0; 4028 int ret = 0;
4030 dprintk("open(): channel = %c\n", 4029 dprintk("open(): channel = %c\n",
4031 (vcs->channel == VINO_CHANNEL_A) ? 'A' : 'B'); 4030 (vcs->channel == VINO_CHANNEL_A) ? 'A' : 'B');
@@ -4056,8 +4055,7 @@ static int vino_open(struct inode *inode, struct file *file)
4056 4055
4057static int vino_close(struct inode *inode, struct file *file) 4056static int vino_close(struct inode *inode, struct file *file)
4058{ 4057{
4059 struct video_device *dev = video_devdata(file); 4058 struct vino_channel_settings *vcs = video_drvdata(file);
4060 struct vino_channel_settings *vcs = video_get_drvdata(dev);
4061 dprintk("close():\n"); 4059 dprintk("close():\n");
4062 4060
4063 mutex_lock(&vcs->mutex); 4061 mutex_lock(&vcs->mutex);
@@ -4100,8 +4098,7 @@ static struct vm_operations_struct vino_vm_ops = {
4100 4098
4101static int vino_mmap(struct file *file, struct vm_area_struct *vma) 4099static int vino_mmap(struct file *file, struct vm_area_struct *vma)
4102{ 4100{
4103 struct video_device *dev = video_devdata(file); 4101 struct vino_channel_settings *vcs = video_drvdata(file);
4104 struct vino_channel_settings *vcs = video_get_drvdata(dev);
4105 4102
4106 unsigned long start = vma->vm_start; 4103 unsigned long start = vma->vm_start;
4107 unsigned long size = vma->vm_end - vma->vm_start; 4104 unsigned long size = vma->vm_end - vma->vm_start;
@@ -4206,8 +4203,7 @@ out:
4206 4203
4207static unsigned int vino_poll(struct file *file, poll_table *pt) 4204static unsigned int vino_poll(struct file *file, poll_table *pt)
4208{ 4205{
4209 struct video_device *dev = video_devdata(file); 4206 struct vino_channel_settings *vcs = video_drvdata(file);
4210 struct vino_channel_settings *vcs = video_get_drvdata(dev);
4211 unsigned int outgoing; 4207 unsigned int outgoing;
4212 unsigned int ret = 0; 4208 unsigned int ret = 0;
4213 4209
@@ -4247,8 +4243,7 @@ error:
4247static int vino_do_ioctl(struct inode *inode, struct file *file, 4243static int vino_do_ioctl(struct inode *inode, struct file *file,
4248 unsigned int cmd, void *arg) 4244 unsigned int cmd, void *arg)
4249{ 4245{
4250 struct video_device *dev = video_devdata(file); 4246 struct vino_channel_settings *vcs = video_drvdata(file);
4251 struct vino_channel_settings *vcs = video_get_drvdata(dev);
4252 4247
4253#ifdef VINO_DEBUG 4248#ifdef VINO_DEBUG
4254 switch (_IOC_TYPE(cmd)) { 4249 switch (_IOC_TYPE(cmd)) {
@@ -4355,8 +4350,7 @@ static int vino_do_ioctl(struct inode *inode, struct file *file,
4355static int vino_ioctl(struct inode *inode, struct file *file, 4350static int vino_ioctl(struct inode *inode, struct file *file,
4356 unsigned int cmd, unsigned long arg) 4351 unsigned int cmd, unsigned long arg)
4357{ 4352{
4358 struct video_device *dev = video_devdata(file); 4353 struct vino_channel_settings *vcs = video_drvdata(file);
4359 struct vino_channel_settings *vcs = video_get_drvdata(dev);
4360 int ret; 4354 int ret;
4361 4355
4362 if (mutex_lock_interruptible(&vcs->mutex)) 4356 if (mutex_lock_interruptible(&vcs->mutex))
diff --git a/drivers/media/video/w9966.c b/drivers/media/video/w9966.c
index 14ebb15837f..b2dbe48a92b 100644
--- a/drivers/media/video/w9966.c
+++ b/drivers/media/video/w9966.c
@@ -187,16 +187,14 @@ static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
187 187
188static int w9966_exclusive_open(struct inode *inode, struct file *file) 188static int w9966_exclusive_open(struct inode *inode, struct file *file)
189{ 189{
190 struct video_device *vdev = video_devdata(file); 190 struct w9966_dev *cam = video_drvdata(file);
191 struct w9966_dev *cam = video_get_drvdata(vdev);
192 191
193 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0; 192 return test_and_set_bit(0, &cam->in_use) ? -EBUSY : 0;
194} 193}
195 194
196static int w9966_exclusive_release(struct inode *inode, struct file *file) 195static int w9966_exclusive_release(struct inode *inode, struct file *file)
197{ 196{
198 struct video_device *vdev = video_devdata(file); 197 struct w9966_dev *cam = video_drvdata(file);
199 struct w9966_dev *cam = video_get_drvdata(vdev);
200 198
201 clear_bit(0, &cam->in_use); 199 clear_bit(0, &cam->in_use);
202 return 0; 200 return 0;
@@ -732,8 +730,7 @@ static int w9966_wReg_i2c(struct w9966_dev* cam, int reg, int data)
732static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file, 730static int w9966_v4l_do_ioctl(struct inode *inode, struct file *file,
733 unsigned int cmd, void *arg) 731 unsigned int cmd, void *arg)
734{ 732{
735 struct video_device *vdev = video_devdata(file); 733 struct w9966_dev *cam = video_drvdata(file);
736 struct w9966_dev *cam = video_get_drvdata(vdev);
737 734
738 switch(cmd) 735 switch(cmd)
739 { 736 {
@@ -891,8 +888,7 @@ static int w9966_v4l_ioctl(struct inode *inode, struct file *file,
891static ssize_t w9966_v4l_read(struct file *file, char __user *buf, 888static ssize_t w9966_v4l_read(struct file *file, char __user *buf,
892 size_t count, loff_t *ppos) 889 size_t count, loff_t *ppos)
893{ 890{
894 struct video_device *vdev = video_devdata(file); 891 struct w9966_dev *cam = video_drvdata(file);
895 struct w9966_dev *cam = video_get_drvdata(vdev);
896 unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000 892 unsigned char addr = 0xa0; // ECP, read, CCD-transfer, 00000
897 unsigned char __user *dest = (unsigned char __user *)buf; 893 unsigned char __user *dest = (unsigned char __user *)buf;
898 unsigned long dleft = count; 894 unsigned long dleft = count;
diff --git a/drivers/media/video/zc0301/zc0301_core.c b/drivers/media/video/zc0301/zc0301_core.c
index 0c3287734c9..6a0902bcba6 100644
--- a/drivers/media/video/zc0301/zc0301_core.c
+++ b/drivers/media/video/zc0301/zc0301_core.c
@@ -657,7 +657,7 @@ static int zc0301_open(struct inode* inode, struct file* filp)
657 if (!down_read_trylock(&zc0301_dev_lock)) 657 if (!down_read_trylock(&zc0301_dev_lock))
658 return -EAGAIN; 658 return -EAGAIN;
659 659
660 cam = video_get_drvdata(video_devdata(filp)); 660 cam = video_drvdata(filp);
661 661
662 if (wait_for_completion_interruptible(&cam->probe)) { 662 if (wait_for_completion_interruptible(&cam->probe)) {
663 up_read(&zc0301_dev_lock); 663 up_read(&zc0301_dev_lock);
@@ -739,7 +739,7 @@ static int zc0301_release(struct inode* inode, struct file* filp)
739 739
740 down_write(&zc0301_dev_lock); 740 down_write(&zc0301_dev_lock);
741 741
742 cam = video_get_drvdata(video_devdata(filp)); 742 cam = video_drvdata(filp);
743 743
744 zc0301_stop_transfer(cam); 744 zc0301_stop_transfer(cam);
745 zc0301_release_buffers(cam); 745 zc0301_release_buffers(cam);
@@ -759,7 +759,7 @@ static int zc0301_release(struct inode* inode, struct file* filp)
759static ssize_t 759static ssize_t
760zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos) 760zc0301_read(struct file* filp, char __user * buf, size_t count, loff_t* f_pos)
761{ 761{
762 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 762 struct zc0301_device *cam = video_drvdata(filp);
763 struct zc0301_frame_t* f, * i; 763 struct zc0301_frame_t* f, * i;
764 unsigned long lock_flags; 764 unsigned long lock_flags;
765 long timeout; 765 long timeout;
@@ -866,7 +866,7 @@ exit:
866 866
867static unsigned int zc0301_poll(struct file *filp, poll_table *wait) 867static unsigned int zc0301_poll(struct file *filp, poll_table *wait)
868{ 868{
869 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 869 struct zc0301_device *cam = video_drvdata(filp);
870 struct zc0301_frame_t* f; 870 struct zc0301_frame_t* f;
871 unsigned long lock_flags; 871 unsigned long lock_flags;
872 unsigned int mask = 0; 872 unsigned int mask = 0;
@@ -941,7 +941,7 @@ static struct vm_operations_struct zc0301_vm_ops = {
941 941
942static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma) 942static int zc0301_mmap(struct file* filp, struct vm_area_struct *vma)
943{ 943{
944 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 944 struct zc0301_device *cam = video_drvdata(filp);
945 unsigned long size = vma->vm_end - vma->vm_start, 945 unsigned long size = vma->vm_end - vma->vm_start,
946 start = vma->vm_start; 946 start = vma->vm_start;
947 void *pos; 947 void *pos;
@@ -1796,7 +1796,7 @@ zc0301_vidioc_s_parm(struct zc0301_device* cam, void __user * arg)
1796static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp, 1796static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
1797 unsigned int cmd, void __user * arg) 1797 unsigned int cmd, void __user * arg)
1798{ 1798{
1799 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 1799 struct zc0301_device *cam = video_drvdata(filp);
1800 1800
1801 switch (cmd) { 1801 switch (cmd) {
1802 1802
@@ -1891,7 +1891,7 @@ static int zc0301_ioctl_v4l2(struct inode* inode, struct file* filp,
1891static int zc0301_ioctl(struct inode* inode, struct file* filp, 1891static int zc0301_ioctl(struct inode* inode, struct file* filp,
1892 unsigned int cmd, unsigned long arg) 1892 unsigned int cmd, unsigned long arg)
1893{ 1893{
1894 struct zc0301_device* cam = video_get_drvdata(video_devdata(filp)); 1894 struct zc0301_device *cam = video_drvdata(filp);
1895 int err = 0; 1895 int err = 0;
1896 1896
1897 if (mutex_lock_interruptible(&cam->fileop_mutex)) 1897 if (mutex_lock_interruptible(&cam->fileop_mutex))