aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-08-23 07:32:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-12 07:36:54 -0400
commitc170ecf434bceb0e188b14a6deb3bfa3ec9ef699 (patch)
treefa62c2e14adeff72310c9a6b8cba675f3153feed /drivers/media/radio
parentbfa8a273bb91078ea193ab94c717889928f3b925 (diff)
V4L/DVB (8788): v4l: replace video_get_drvdata(video_devdata(filp)) with video_drvdata(filp)
Use the new video_drvdata(filp) function where it is safe to do so. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-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
14 files changed, 76 insertions, 134 deletions
diff --git a/drivers/media/radio/dsbr100.c b/drivers/media/radio/dsbr100.c
index 3a4eb444a7c3..0f06e6ffb0e9 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 62cc6874d63f..9305e958fc66 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 5dd5e349ef47..d78489573230 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 1f57f731c121..e15bee6d7cfc 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 2c4c15e6d510..d131a5d38128 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 182b433981ca..4bf4d007bcfa 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 9bf2acf5249c..c777a17b00bc 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 4234f7ed0fc3..a67079777419 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 810c366b73b0..329c90bddadd 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 9f823150452d..b1f47c322e02 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 337d55793836..f6cedcd3ab97 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 0bc9af686ad7..0abb186a9473 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 27255d7ff1ba..952ec35a8415 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 3a9a7772ae51..f75da63b1634 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: