diff options
author | Johannes Stezenbach <js@linuxtv.org> | 2005-05-17 00:54:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-17 10:59:30 -0400 |
commit | b8742700f13163ffa00cddce2a3c940b9ab2ab5a (patch) | |
tree | ff82ac83508dc63d0dec63a3479df3b966018b34 | |
parent | 591ad98db3be2cd596ac5e0cfba7b164c3bdfb52 (diff) |
[PATCH] dvb: remove unnecessary casts in frontends
remove unnecessary casts in frontends (Kenneth Aafloy)
Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
21 files changed, 241 insertions, 242 deletions
diff --git a/drivers/media/dvb/frontends/at76c651.c b/drivers/media/dvb/frontends/at76c651.c index ce2eaa1640e8..72a2b5455b0b 100644 --- a/drivers/media/dvb/frontends/at76c651.c +++ b/drivers/media/dvb/frontends/at76c651.c | |||
@@ -259,7 +259,7 @@ static int at76c651_set_parameters(struct dvb_frontend* fe, | |||
259 | struct dvb_frontend_parameters *p) | 259 | struct dvb_frontend_parameters *p) |
260 | { | 260 | { |
261 | int ret; | 261 | int ret; |
262 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 262 | struct at76c651_state* state = fe->demodulator_priv; |
263 | 263 | ||
264 | at76c651_writereg(state, 0x0c, 0xc3); | 264 | at76c651_writereg(state, 0x0c, 0xc3); |
265 | state->config->pll_set(fe, p); | 265 | state->config->pll_set(fe, p); |
@@ -276,7 +276,7 @@ static int at76c651_set_parameters(struct dvb_frontend* fe, | |||
276 | 276 | ||
277 | static int at76c651_set_defaults(struct dvb_frontend* fe) | 277 | static int at76c651_set_defaults(struct dvb_frontend* fe) |
278 | { | 278 | { |
279 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 279 | struct at76c651_state* state = fe->demodulator_priv; |
280 | 280 | ||
281 | at76c651_set_symbol_rate(state, 6900000); | 281 | at76c651_set_symbol_rate(state, 6900000); |
282 | at76c651_set_qam(state, QAM_64); | 282 | at76c651_set_qam(state, QAM_64); |
@@ -294,7 +294,7 @@ static int at76c651_set_defaults(struct dvb_frontend* fe) | |||
294 | 294 | ||
295 | static int at76c651_read_status(struct dvb_frontend* fe, fe_status_t* status) | 295 | static int at76c651_read_status(struct dvb_frontend* fe, fe_status_t* status) |
296 | { | 296 | { |
297 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 297 | struct at76c651_state* state = fe->demodulator_priv; |
298 | u8 sync; | 298 | u8 sync; |
299 | 299 | ||
300 | /* | 300 | /* |
@@ -319,7 +319,7 @@ static int at76c651_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
319 | 319 | ||
320 | static int at76c651_read_ber(struct dvb_frontend* fe, u32* ber) | 320 | static int at76c651_read_ber(struct dvb_frontend* fe, u32* ber) |
321 | { | 321 | { |
322 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 322 | struct at76c651_state* state = fe->demodulator_priv; |
323 | 323 | ||
324 | *ber = (at76c651_readreg(state, 0x81) & 0x0F) << 16; | 324 | *ber = (at76c651_readreg(state, 0x81) & 0x0F) << 16; |
325 | *ber |= at76c651_readreg(state, 0x82) << 8; | 325 | *ber |= at76c651_readreg(state, 0x82) << 8; |
@@ -331,7 +331,7 @@ static int at76c651_read_ber(struct dvb_frontend* fe, u32* ber) | |||
331 | 331 | ||
332 | static int at76c651_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 332 | static int at76c651_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
333 | { | 333 | { |
334 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 334 | struct at76c651_state* state = fe->demodulator_priv; |
335 | 335 | ||
336 | u8 gain = ~at76c651_readreg(state, 0x91); | 336 | u8 gain = ~at76c651_readreg(state, 0x91); |
337 | *strength = (gain << 8) | gain; | 337 | *strength = (gain << 8) | gain; |
@@ -341,7 +341,7 @@ static int at76c651_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
341 | 341 | ||
342 | static int at76c651_read_snr(struct dvb_frontend* fe, u16* snr) | 342 | static int at76c651_read_snr(struct dvb_frontend* fe, u16* snr) |
343 | { | 343 | { |
344 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 344 | struct at76c651_state* state = fe->demodulator_priv; |
345 | 345 | ||
346 | *snr = 0xFFFF - | 346 | *snr = 0xFFFF - |
347 | ((at76c651_readreg(state, 0x8F) << 8) | | 347 | ((at76c651_readreg(state, 0x8F) << 8) | |
@@ -352,7 +352,7 @@ static int at76c651_read_snr(struct dvb_frontend* fe, u16* snr) | |||
352 | 352 | ||
353 | static int at76c651_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 353 | static int at76c651_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
354 | { | 354 | { |
355 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 355 | struct at76c651_state* state = fe->demodulator_priv; |
356 | 356 | ||
357 | *ucblocks = at76c651_readreg(state, 0x82); | 357 | *ucblocks = at76c651_readreg(state, 0x82); |
358 | 358 | ||
@@ -369,7 +369,7 @@ static int at76c651_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronte | |||
369 | 369 | ||
370 | static void at76c651_release(struct dvb_frontend* fe) | 370 | static void at76c651_release(struct dvb_frontend* fe) |
371 | { | 371 | { |
372 | struct at76c651_state* state = (struct at76c651_state*) fe->demodulator_priv; | 372 | struct at76c651_state* state = fe->demodulator_priv; |
373 | kfree(state); | 373 | kfree(state); |
374 | } | 374 | } |
375 | 375 | ||
@@ -381,7 +381,7 @@ struct dvb_frontend* at76c651_attach(const struct at76c651_config* config, | |||
381 | struct at76c651_state* state = NULL; | 381 | struct at76c651_state* state = NULL; |
382 | 382 | ||
383 | /* allocate memory for the internal state */ | 383 | /* allocate memory for the internal state */ |
384 | state = (struct at76c651_state*) kmalloc(sizeof(struct at76c651_state), GFP_KERNEL); | 384 | state = kmalloc(sizeof(struct at76c651_state), GFP_KERNEL); |
385 | if (state == NULL) goto error; | 385 | if (state == NULL) goto error; |
386 | 386 | ||
387 | /* setup the state */ | 387 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/cx22700.c b/drivers/media/dvb/frontends/cx22700.c index a212279042b8..0c2ed4438618 100644 --- a/drivers/media/dvb/frontends/cx22700.c +++ b/drivers/media/dvb/frontends/cx22700.c | |||
@@ -232,7 +232,7 @@ static int cx22700_get_tps (struct cx22700_state* state, struct dvb_ofdm_paramet | |||
232 | 232 | ||
233 | static int cx22700_init (struct dvb_frontend* fe) | 233 | static int cx22700_init (struct dvb_frontend* fe) |
234 | 234 | ||
235 | { struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 235 | { struct cx22700_state* state = fe->demodulator_priv; |
236 | int i; | 236 | int i; |
237 | 237 | ||
238 | dprintk("cx22700_init: init chip\n"); | 238 | dprintk("cx22700_init: init chip\n"); |
@@ -258,7 +258,7 @@ static int cx22700_init (struct dvb_frontend* fe) | |||
258 | 258 | ||
259 | static int cx22700_read_status(struct dvb_frontend* fe, fe_status_t* status) | 259 | static int cx22700_read_status(struct dvb_frontend* fe, fe_status_t* status) |
260 | { | 260 | { |
261 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 261 | struct cx22700_state* state = fe->demodulator_priv; |
262 | 262 | ||
263 | u16 rs_ber = (cx22700_readreg (state, 0x0d) << 9) | 263 | u16 rs_ber = (cx22700_readreg (state, 0x0d) << 9) |
264 | | (cx22700_readreg (state, 0x0e) << 1); | 264 | | (cx22700_readreg (state, 0x0e) << 1); |
@@ -286,7 +286,7 @@ static int cx22700_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
286 | 286 | ||
287 | static int cx22700_read_ber(struct dvb_frontend* fe, u32* ber) | 287 | static int cx22700_read_ber(struct dvb_frontend* fe, u32* ber) |
288 | { | 288 | { |
289 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 289 | struct cx22700_state* state = fe->demodulator_priv; |
290 | 290 | ||
291 | *ber = cx22700_readreg (state, 0x0c) & 0x7f; | 291 | *ber = cx22700_readreg (state, 0x0c) & 0x7f; |
292 | cx22700_writereg (state, 0x0c, 0x00); | 292 | cx22700_writereg (state, 0x0c, 0x00); |
@@ -296,7 +296,7 @@ static int cx22700_read_ber(struct dvb_frontend* fe, u32* ber) | |||
296 | 296 | ||
297 | static int cx22700_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) | 297 | static int cx22700_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) |
298 | { | 298 | { |
299 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 299 | struct cx22700_state* state = fe->demodulator_priv; |
300 | 300 | ||
301 | u16 rs_ber = (cx22700_readreg (state, 0x0d) << 9) | 301 | u16 rs_ber = (cx22700_readreg (state, 0x0d) << 9) |
302 | | (cx22700_readreg (state, 0x0e) << 1); | 302 | | (cx22700_readreg (state, 0x0e) << 1); |
@@ -307,7 +307,7 @@ static int cx22700_read_signal_strength(struct dvb_frontend* fe, u16* signal_str | |||
307 | 307 | ||
308 | static int cx22700_read_snr(struct dvb_frontend* fe, u16* snr) | 308 | static int cx22700_read_snr(struct dvb_frontend* fe, u16* snr) |
309 | { | 309 | { |
310 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 310 | struct cx22700_state* state = fe->demodulator_priv; |
311 | 311 | ||
312 | u16 rs_ber = (cx22700_readreg (state, 0x0d) << 9) | 312 | u16 rs_ber = (cx22700_readreg (state, 0x0d) << 9) |
313 | | (cx22700_readreg (state, 0x0e) << 1); | 313 | | (cx22700_readreg (state, 0x0e) << 1); |
@@ -318,7 +318,7 @@ static int cx22700_read_snr(struct dvb_frontend* fe, u16* snr) | |||
318 | 318 | ||
319 | static int cx22700_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 319 | static int cx22700_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
320 | { | 320 | { |
321 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 321 | struct cx22700_state* state = fe->demodulator_priv; |
322 | 322 | ||
323 | *ucblocks = cx22700_readreg (state, 0x0f); | 323 | *ucblocks = cx22700_readreg (state, 0x0f); |
324 | cx22700_writereg (state, 0x0f, 0x00); | 324 | cx22700_writereg (state, 0x0f, 0x00); |
@@ -328,7 +328,7 @@ static int cx22700_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
328 | 328 | ||
329 | static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 329 | static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
330 | { | 330 | { |
331 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 331 | struct cx22700_state* state = fe->demodulator_priv; |
332 | 332 | ||
333 | cx22700_writereg (state, 0x00, 0x02); /* XXX CHECKME: soft reset*/ | 333 | cx22700_writereg (state, 0x00, 0x02); /* XXX CHECKME: soft reset*/ |
334 | cx22700_writereg (state, 0x00, 0x00); | 334 | cx22700_writereg (state, 0x00, 0x00); |
@@ -346,7 +346,7 @@ static int cx22700_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
346 | 346 | ||
347 | static int cx22700_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 347 | static int cx22700_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
348 | { | 348 | { |
349 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 349 | struct cx22700_state* state = fe->demodulator_priv; |
350 | u8 reg09 = cx22700_readreg (state, 0x09); | 350 | u8 reg09 = cx22700_readreg (state, 0x09); |
351 | 351 | ||
352 | p->inversion = reg09 & 0x1 ? INVERSION_ON : INVERSION_OFF; | 352 | p->inversion = reg09 & 0x1 ? INVERSION_ON : INVERSION_OFF; |
@@ -363,7 +363,7 @@ static int cx22700_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronten | |||
363 | 363 | ||
364 | static void cx22700_release(struct dvb_frontend* fe) | 364 | static void cx22700_release(struct dvb_frontend* fe) |
365 | { | 365 | { |
366 | struct cx22700_state* state = (struct cx22700_state*) fe->demodulator_priv; | 366 | struct cx22700_state* state = fe->demodulator_priv; |
367 | kfree(state); | 367 | kfree(state); |
368 | } | 368 | } |
369 | 369 | ||
@@ -375,7 +375,7 @@ struct dvb_frontend* cx22700_attach(const struct cx22700_config* config, | |||
375 | struct cx22700_state* state = NULL; | 375 | struct cx22700_state* state = NULL; |
376 | 376 | ||
377 | /* allocate memory for the internal state */ | 377 | /* allocate memory for the internal state */ |
378 | state = (struct cx22700_state*) kmalloc(sizeof(struct cx22700_state), GFP_KERNEL); | 378 | state = kmalloc(sizeof(struct cx22700_state), GFP_KERNEL); |
379 | if (state == NULL) goto error; | 379 | if (state == NULL) goto error; |
380 | 380 | ||
381 | /* setup the state */ | 381 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c index 011860ce36cc..f4aa44136c7c 100644 --- a/drivers/media/dvb/frontends/cx22702.c +++ b/drivers/media/dvb/frontends/cx22702.c | |||
@@ -200,7 +200,7 @@ static int cx22702_get_tps (struct cx22702_state *state, struct dvb_ofdm_paramet | |||
200 | static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 200 | static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
201 | { | 201 | { |
202 | u8 val; | 202 | u8 val; |
203 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 203 | struct cx22702_state* state = fe->demodulator_priv; |
204 | 204 | ||
205 | /* set PLL */ | 205 | /* set PLL */ |
206 | cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) &0xfe); | 206 | cx22702_writereg (state, 0x0D, cx22702_readreg(state,0x0D) &0xfe); |
@@ -338,7 +338,7 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet | |||
338 | static int cx22702_init (struct dvb_frontend* fe) | 338 | static int cx22702_init (struct dvb_frontend* fe) |
339 | { | 339 | { |
340 | int i; | 340 | int i; |
341 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 341 | struct cx22702_state* state = fe->demodulator_priv; |
342 | 342 | ||
343 | cx22702_writereg (state, 0x00, 0x02); | 343 | cx22702_writereg (state, 0x00, 0x02); |
344 | 344 | ||
@@ -360,7 +360,7 @@ static int cx22702_init (struct dvb_frontend* fe) | |||
360 | 360 | ||
361 | static int cx22702_read_status(struct dvb_frontend* fe, fe_status_t* status) | 361 | static int cx22702_read_status(struct dvb_frontend* fe, fe_status_t* status) |
362 | { | 362 | { |
363 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 363 | struct cx22702_state* state = fe->demodulator_priv; |
364 | u8 reg0A; | 364 | u8 reg0A; |
365 | u8 reg23; | 365 | u8 reg23; |
366 | 366 | ||
@@ -389,7 +389,7 @@ static int cx22702_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
389 | 389 | ||
390 | static int cx22702_read_ber(struct dvb_frontend* fe, u32* ber) | 390 | static int cx22702_read_ber(struct dvb_frontend* fe, u32* ber) |
391 | { | 391 | { |
392 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 392 | struct cx22702_state* state = fe->demodulator_priv; |
393 | 393 | ||
394 | if(cx22702_readreg (state, 0xE4) & 0x02) { | 394 | if(cx22702_readreg (state, 0xE4) & 0x02) { |
395 | /* Realtime statistics */ | 395 | /* Realtime statistics */ |
@@ -406,7 +406,7 @@ static int cx22702_read_ber(struct dvb_frontend* fe, u32* ber) | |||
406 | 406 | ||
407 | static int cx22702_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) | 407 | static int cx22702_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) |
408 | { | 408 | { |
409 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 409 | struct cx22702_state* state = fe->demodulator_priv; |
410 | 410 | ||
411 | *signal_strength = cx22702_readreg (state, 0x23); | 411 | *signal_strength = cx22702_readreg (state, 0x23); |
412 | 412 | ||
@@ -415,7 +415,7 @@ static int cx22702_read_signal_strength(struct dvb_frontend* fe, u16* signal_str | |||
415 | 415 | ||
416 | static int cx22702_read_snr(struct dvb_frontend* fe, u16* snr) | 416 | static int cx22702_read_snr(struct dvb_frontend* fe, u16* snr) |
417 | { | 417 | { |
418 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 418 | struct cx22702_state* state = fe->demodulator_priv; |
419 | 419 | ||
420 | u16 rs_ber=0; | 420 | u16 rs_ber=0; |
421 | if(cx22702_readreg (state, 0xE4) & 0x02) { | 421 | if(cx22702_readreg (state, 0xE4) & 0x02) { |
@@ -434,7 +434,7 @@ static int cx22702_read_snr(struct dvb_frontend* fe, u16* snr) | |||
434 | 434 | ||
435 | static int cx22702_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 435 | static int cx22702_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
436 | { | 436 | { |
437 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 437 | struct cx22702_state* state = fe->demodulator_priv; |
438 | 438 | ||
439 | u8 _ucblocks; | 439 | u8 _ucblocks; |
440 | 440 | ||
@@ -449,7 +449,7 @@ static int cx22702_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
449 | 449 | ||
450 | static int cx22702_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 450 | static int cx22702_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
451 | { | 451 | { |
452 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 452 | struct cx22702_state* state = fe->demodulator_priv; |
453 | 453 | ||
454 | u8 reg0C = cx22702_readreg (state, 0x0C); | 454 | u8 reg0C = cx22702_readreg (state, 0x0C); |
455 | 455 | ||
@@ -459,7 +459,7 @@ static int cx22702_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
459 | 459 | ||
460 | static void cx22702_release(struct dvb_frontend* fe) | 460 | static void cx22702_release(struct dvb_frontend* fe) |
461 | { | 461 | { |
462 | struct cx22702_state* state = (struct cx22702_state*) fe->demodulator_priv; | 462 | struct cx22702_state* state = fe->demodulator_priv; |
463 | kfree(state); | 463 | kfree(state); |
464 | } | 464 | } |
465 | 465 | ||
@@ -471,7 +471,7 @@ struct dvb_frontend* cx22702_attach(const struct cx22702_config* config, | |||
471 | struct cx22702_state* state = NULL; | 471 | struct cx22702_state* state = NULL; |
472 | 472 | ||
473 | /* allocate memory for the internal state */ | 473 | /* allocate memory for the internal state */ |
474 | state = (struct cx22702_state*) kmalloc(sizeof(struct cx22702_state), GFP_KERNEL); | 474 | state = kmalloc(sizeof(struct cx22702_state), GFP_KERNEL); |
475 | if (state == NULL) goto error; | 475 | if (state == NULL) goto error; |
476 | 476 | ||
477 | /* setup the state */ | 477 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c index ae16112a0653..8222b88cb486 100644 --- a/drivers/media/dvb/frontends/cx24110.c +++ b/drivers/media/dvb/frontends/cx24110.c | |||
@@ -315,7 +315,7 @@ dprintk("cx24110 debug: entering %s(%d)\n",__FUNCTION__,srate); | |||
315 | 315 | ||
316 | int cx24110_pll_write (struct dvb_frontend* fe, u32 data) | 316 | int cx24110_pll_write (struct dvb_frontend* fe, u32 data) |
317 | { | 317 | { |
318 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 318 | struct cx24110_state *state = fe->demodulator_priv; |
319 | 319 | ||
320 | /* tuner data is 21 bits long, must be left-aligned in data */ | 320 | /* tuner data is 21 bits long, must be left-aligned in data */ |
321 | /* tuner cx24108 is written through a dedicated 3wire interface on the demod chip */ | 321 | /* tuner cx24108 is written through a dedicated 3wire interface on the demod chip */ |
@@ -356,7 +356,7 @@ int cx24110_pll_write (struct dvb_frontend* fe, u32 data) | |||
356 | 356 | ||
357 | static int cx24110_initfe(struct dvb_frontend* fe) | 357 | static int cx24110_initfe(struct dvb_frontend* fe) |
358 | { | 358 | { |
359 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 359 | struct cx24110_state *state = fe->demodulator_priv; |
360 | /* fixme (low): error handling */ | 360 | /* fixme (low): error handling */ |
361 | int i; | 361 | int i; |
362 | 362 | ||
@@ -373,7 +373,7 @@ static int cx24110_initfe(struct dvb_frontend* fe) | |||
373 | 373 | ||
374 | static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) | 374 | static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) |
375 | { | 375 | { |
376 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 376 | struct cx24110_state *state = fe->demodulator_priv; |
377 | 377 | ||
378 | switch (voltage) { | 378 | switch (voltage) { |
379 | case SEC_VOLTAGE_13: | 379 | case SEC_VOLTAGE_13: |
@@ -385,8 +385,7 @@ static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltag | |||
385 | }; | 385 | }; |
386 | } | 386 | } |
387 | 387 | ||
388 | static int cx24110_diseqc_send_burst(struct dvb_frontend* fe, | 388 | static int cx24110_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) |
389 | fe_sec_mini_cmd_t burst) | ||
390 | { | 389 | { |
391 | int rv, bit, i; | 390 | int rv, bit, i; |
392 | struct cx24110_state *state = fe->demodulator_priv; | 391 | struct cx24110_state *state = fe->demodulator_priv; |
@@ -413,7 +412,7 @@ static int cx24110_send_diseqc_msg(struct dvb_frontend* fe, | |||
413 | struct dvb_diseqc_master_cmd *cmd) | 412 | struct dvb_diseqc_master_cmd *cmd) |
414 | { | 413 | { |
415 | int i, rv; | 414 | int i, rv; |
416 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 415 | struct cx24110_state *state = fe->demodulator_priv; |
417 | 416 | ||
418 | for (i = 0; i < cmd->msg_len; i++) | 417 | for (i = 0; i < cmd->msg_len; i++) |
419 | cx24110_writereg(state, 0x79 + i, cmd->msg[i]); | 418 | cx24110_writereg(state, 0x79 + i, cmd->msg[i]); |
@@ -432,7 +431,7 @@ static int cx24110_send_diseqc_msg(struct dvb_frontend* fe, | |||
432 | 431 | ||
433 | static int cx24110_read_status(struct dvb_frontend* fe, fe_status_t* status) | 432 | static int cx24110_read_status(struct dvb_frontend* fe, fe_status_t* status) |
434 | { | 433 | { |
435 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 434 | struct cx24110_state *state = fe->demodulator_priv; |
436 | 435 | ||
437 | int sync = cx24110_readreg (state, 0x55); | 436 | int sync = cx24110_readreg (state, 0x55); |
438 | 437 | ||
@@ -460,7 +459,7 @@ static int cx24110_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
460 | 459 | ||
461 | static int cx24110_read_ber(struct dvb_frontend* fe, u32* ber) | 460 | static int cx24110_read_ber(struct dvb_frontend* fe, u32* ber) |
462 | { | 461 | { |
463 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 462 | struct cx24110_state *state = fe->demodulator_priv; |
464 | 463 | ||
465 | /* fixme (maybe): value range is 16 bit. Scale? */ | 464 | /* fixme (maybe): value range is 16 bit. Scale? */ |
466 | if(cx24110_readreg(state,0x24)&0x10) { | 465 | if(cx24110_readreg(state,0x24)&0x10) { |
@@ -478,7 +477,7 @@ static int cx24110_read_ber(struct dvb_frontend* fe, u32* ber) | |||
478 | 477 | ||
479 | static int cx24110_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) | 478 | static int cx24110_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) |
480 | { | 479 | { |
481 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 480 | struct cx24110_state *state = fe->demodulator_priv; |
482 | 481 | ||
483 | /* no provision in hardware. Read the frontend AGC accumulator. No idea how to scale this, but I know it is 2s complement */ | 482 | /* no provision in hardware. Read the frontend AGC accumulator. No idea how to scale this, but I know it is 2s complement */ |
484 | u8 signal = cx24110_readreg (state, 0x27)+128; | 483 | u8 signal = cx24110_readreg (state, 0x27)+128; |
@@ -489,7 +488,7 @@ static int cx24110_read_signal_strength(struct dvb_frontend* fe, u16* signal_str | |||
489 | 488 | ||
490 | static int cx24110_read_snr(struct dvb_frontend* fe, u16* snr) | 489 | static int cx24110_read_snr(struct dvb_frontend* fe, u16* snr) |
491 | { | 490 | { |
492 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 491 | struct cx24110_state *state = fe->demodulator_priv; |
493 | 492 | ||
494 | /* no provision in hardware. Can be computed from the Es/N0 estimator, but I don't know how. */ | 493 | /* no provision in hardware. Can be computed from the Es/N0 estimator, but I don't know how. */ |
495 | if(cx24110_readreg(state,0x6a)&0x80) { | 494 | if(cx24110_readreg(state,0x6a)&0x80) { |
@@ -505,7 +504,7 @@ static int cx24110_read_snr(struct dvb_frontend* fe, u16* snr) | |||
505 | 504 | ||
506 | static int cx24110_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 505 | static int cx24110_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
507 | { | 506 | { |
508 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 507 | struct cx24110_state *state = fe->demodulator_priv; |
509 | u32 lastbyer; | 508 | u32 lastbyer; |
510 | 509 | ||
511 | if(cx24110_readreg(state,0x10)&0x40) { | 510 | if(cx24110_readreg(state,0x10)&0x40) { |
@@ -527,7 +526,7 @@ static int cx24110_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
527 | 526 | ||
528 | static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 527 | static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
529 | { | 528 | { |
530 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 529 | struct cx24110_state *state = fe->demodulator_priv; |
531 | 530 | ||
532 | state->config->pll_set(fe, p); | 531 | state->config->pll_set(fe, p); |
533 | cx24110_set_inversion (state, p->inversion); | 532 | cx24110_set_inversion (state, p->inversion); |
@@ -540,7 +539,7 @@ static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
540 | 539 | ||
541 | static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 540 | static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
542 | { | 541 | { |
543 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 542 | struct cx24110_state *state = fe->demodulator_priv; |
544 | s32 afc; unsigned sclk; | 543 | s32 afc; unsigned sclk; |
545 | 544 | ||
546 | /* cannot read back tuner settings (freq). Need to have some private storage */ | 545 | /* cannot read back tuner settings (freq). Need to have some private storage */ |
@@ -567,14 +566,14 @@ static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
567 | 566 | ||
568 | static int cx24110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | 567 | static int cx24110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) |
569 | { | 568 | { |
570 | struct cx24110_state *state = (struct cx24110_state*) fe->demodulator_priv; | 569 | struct cx24110_state *state = fe->demodulator_priv; |
571 | 570 | ||
572 | return cx24110_writereg(state,0x76,(cx24110_readreg(state,0x76)&~0x10)|(((tone==SEC_TONE_ON))?0x10:0)); | 571 | return cx24110_writereg(state,0x76,(cx24110_readreg(state,0x76)&~0x10)|(((tone==SEC_TONE_ON))?0x10:0)); |
573 | } | 572 | } |
574 | 573 | ||
575 | static void cx24110_release(struct dvb_frontend* fe) | 574 | static void cx24110_release(struct dvb_frontend* fe) |
576 | { | 575 | { |
577 | struct cx24110_state* state = (struct cx24110_state*) fe->demodulator_priv; | 576 | struct cx24110_state* state = fe->demodulator_priv; |
578 | kfree(state); | 577 | kfree(state); |
579 | } | 578 | } |
580 | 579 | ||
@@ -587,7 +586,7 @@ struct dvb_frontend* cx24110_attach(const struct cx24110_config* config, | |||
587 | int ret; | 586 | int ret; |
588 | 587 | ||
589 | /* allocate memory for the internal state */ | 588 | /* allocate memory for the internal state */ |
590 | state = (struct cx24110_state*) kmalloc(sizeof(struct cx24110_state), GFP_KERNEL); | 589 | state = kmalloc(sizeof(struct cx24110_state), GFP_KERNEL); |
591 | if (state == NULL) goto error; | 590 | if (state == NULL) goto error; |
592 | 591 | ||
593 | /* setup the state */ | 592 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/dib3000mb.c b/drivers/media/dvb/frontends/dib3000mb.c index a853d12a26f1..f2fbb7c1598e 100644 --- a/drivers/media/dvb/frontends/dib3000mb.c +++ b/drivers/media/dvb/frontends/dib3000mb.c | |||
@@ -56,7 +56,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, | |||
56 | static int dib3000mb_set_frontend(struct dvb_frontend* fe, | 56 | static int dib3000mb_set_frontend(struct dvb_frontend* fe, |
57 | struct dvb_frontend_parameters *fep, int tuner) | 57 | struct dvb_frontend_parameters *fep, int tuner) |
58 | { | 58 | { |
59 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 59 | struct dib3000_state* state = fe->demodulator_priv; |
60 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; | 60 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; |
61 | fe_code_rate_t fe_cr = FEC_NONE; | 61 | fe_code_rate_t fe_cr = FEC_NONE; |
62 | int search_state, seq; | 62 | int search_state, seq; |
@@ -317,7 +317,7 @@ static int dib3000mb_set_frontend(struct dvb_frontend* fe, | |||
317 | 317 | ||
318 | static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode) | 318 | static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode) |
319 | { | 319 | { |
320 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 320 | struct dib3000_state* state = fe->demodulator_priv; |
321 | 321 | ||
322 | deb_info("dib3000mb is getting up.\n"); | 322 | deb_info("dib3000mb is getting up.\n"); |
323 | wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_UP); | 323 | wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_UP); |
@@ -401,7 +401,7 @@ static int dib3000mb_fe_init(struct dvb_frontend* fe, int mobile_mode) | |||
401 | static int dib3000mb_get_frontend(struct dvb_frontend* fe, | 401 | static int dib3000mb_get_frontend(struct dvb_frontend* fe, |
402 | struct dvb_frontend_parameters *fep) | 402 | struct dvb_frontend_parameters *fep) |
403 | { | 403 | { |
404 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 404 | struct dib3000_state* state = fe->demodulator_priv; |
405 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; | 405 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; |
406 | fe_code_rate_t *cr; | 406 | fe_code_rate_t *cr; |
407 | u16 tps_val; | 407 | u16 tps_val; |
@@ -562,7 +562,7 @@ static int dib3000mb_get_frontend(struct dvb_frontend* fe, | |||
562 | 562 | ||
563 | static int dib3000mb_read_status(struct dvb_frontend* fe, fe_status_t *stat) | 563 | static int dib3000mb_read_status(struct dvb_frontend* fe, fe_status_t *stat) |
564 | { | 564 | { |
565 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 565 | struct dib3000_state* state = fe->demodulator_priv; |
566 | 566 | ||
567 | *stat = 0; | 567 | *stat = 0; |
568 | 568 | ||
@@ -594,7 +594,7 @@ static int dib3000mb_read_status(struct dvb_frontend* fe, fe_status_t *stat) | |||
594 | 594 | ||
595 | static int dib3000mb_read_ber(struct dvb_frontend* fe, u32 *ber) | 595 | static int dib3000mb_read_ber(struct dvb_frontend* fe, u32 *ber) |
596 | { | 596 | { |
597 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 597 | struct dib3000_state* state = fe->demodulator_priv; |
598 | 598 | ||
599 | *ber = ((rd(DIB3000MB_REG_BER_MSB) << 16) | rd(DIB3000MB_REG_BER_LSB)); | 599 | *ber = ((rd(DIB3000MB_REG_BER_MSB) << 16) | rd(DIB3000MB_REG_BER_LSB)); |
600 | return 0; | 600 | return 0; |
@@ -603,7 +603,7 @@ static int dib3000mb_read_ber(struct dvb_frontend* fe, u32 *ber) | |||
603 | /* see dib3000-watch dvb-apps for exact calcuations of signal_strength and snr */ | 603 | /* see dib3000-watch dvb-apps for exact calcuations of signal_strength and snr */ |
604 | static int dib3000mb_read_signal_strength(struct dvb_frontend* fe, u16 *strength) | 604 | static int dib3000mb_read_signal_strength(struct dvb_frontend* fe, u16 *strength) |
605 | { | 605 | { |
606 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 606 | struct dib3000_state* state = fe->demodulator_priv; |
607 | 607 | ||
608 | *strength = rd(DIB3000MB_REG_SIGNAL_POWER) * 0xffff / 0x170; | 608 | *strength = rd(DIB3000MB_REG_SIGNAL_POWER) * 0xffff / 0x170; |
609 | return 0; | 609 | return 0; |
@@ -611,7 +611,7 @@ static int dib3000mb_read_signal_strength(struct dvb_frontend* fe, u16 *strength | |||
611 | 611 | ||
612 | static int dib3000mb_read_snr(struct dvb_frontend* fe, u16 *snr) | 612 | static int dib3000mb_read_snr(struct dvb_frontend* fe, u16 *snr) |
613 | { | 613 | { |
614 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 614 | struct dib3000_state* state = fe->demodulator_priv; |
615 | short sigpow = rd(DIB3000MB_REG_SIGNAL_POWER); | 615 | short sigpow = rd(DIB3000MB_REG_SIGNAL_POWER); |
616 | int icipow = ((rd(DIB3000MB_REG_NOISE_POWER_MSB) & 0xff) << 16) | | 616 | int icipow = ((rd(DIB3000MB_REG_NOISE_POWER_MSB) & 0xff) << 16) | |
617 | rd(DIB3000MB_REG_NOISE_POWER_LSB); | 617 | rd(DIB3000MB_REG_NOISE_POWER_LSB); |
@@ -621,7 +621,7 @@ static int dib3000mb_read_snr(struct dvb_frontend* fe, u16 *snr) | |||
621 | 621 | ||
622 | static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) | 622 | static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) |
623 | { | 623 | { |
624 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 624 | struct dib3000_state* state = fe->demodulator_priv; |
625 | 625 | ||
626 | *unc = rd(DIB3000MB_REG_UNC); | 626 | *unc = rd(DIB3000MB_REG_UNC); |
627 | return 0; | 627 | return 0; |
@@ -629,7 +629,7 @@ static int dib3000mb_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) | |||
629 | 629 | ||
630 | static int dib3000mb_sleep(struct dvb_frontend* fe) | 630 | static int dib3000mb_sleep(struct dvb_frontend* fe) |
631 | { | 631 | { |
632 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 632 | struct dib3000_state* state = fe->demodulator_priv; |
633 | deb_info("dib3000mb is going to bed.\n"); | 633 | deb_info("dib3000mb is going to bed.\n"); |
634 | wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_DOWN); | 634 | wr(DIB3000MB_REG_POWER_CONTROL, DIB3000MB_POWER_DOWN); |
635 | return 0; | 635 | return 0; |
@@ -656,7 +656,7 @@ static int dib3000mb_set_frontend_and_tuner(struct dvb_frontend* fe, struct dvb_ | |||
656 | 656 | ||
657 | static void dib3000mb_release(struct dvb_frontend* fe) | 657 | static void dib3000mb_release(struct dvb_frontend* fe) |
658 | { | 658 | { |
659 | struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; | 659 | struct dib3000_state *state = fe->demodulator_priv; |
660 | kfree(state); | 660 | kfree(state); |
661 | } | 661 | } |
662 | 662 | ||
@@ -671,7 +671,7 @@ static int dib3000mb_pid_control(struct dvb_frontend *fe,int index, int pid,int | |||
671 | 671 | ||
672 | static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) | 672 | static int dib3000mb_fifo_control(struct dvb_frontend *fe, int onoff) |
673 | { | 673 | { |
674 | struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; | 674 | struct dib3000_state *state = fe->demodulator_priv; |
675 | 675 | ||
676 | deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); | 676 | deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); |
677 | if (onoff) { | 677 | if (onoff) { |
@@ -692,7 +692,7 @@ static int dib3000mb_pid_parse(struct dvb_frontend *fe, int onoff) | |||
692 | 692 | ||
693 | static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr) | 693 | static int dib3000mb_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr) |
694 | { | 694 | { |
695 | struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; | 695 | struct dib3000_state *state = fe->demodulator_priv; |
696 | if (onoff) { | 696 | if (onoff) { |
697 | wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr)); | 697 | wr(DIB3000MB_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr)); |
698 | } else { | 698 | } else { |
@@ -709,7 +709,7 @@ struct dvb_frontend* dib3000mb_attach(const struct dib3000_config* config, | |||
709 | struct dib3000_state* state = NULL; | 709 | struct dib3000_state* state = NULL; |
710 | 710 | ||
711 | /* allocate memory for the internal state */ | 711 | /* allocate memory for the internal state */ |
712 | state = (struct dib3000_state*) kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); | 712 | state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); |
713 | if (state == NULL) | 713 | if (state == NULL) |
714 | goto error; | 714 | goto error; |
715 | memset(state,0,sizeof(struct dib3000_state)); | 715 | memset(state,0,sizeof(struct dib3000_state)); |
diff --git a/drivers/media/dvb/frontends/dib3000mc.c b/drivers/media/dvb/frontends/dib3000mc.c index 4a31c05eaecd..bb0abdc78f37 100644 --- a/drivers/media/dvb/frontends/dib3000mc.c +++ b/drivers/media/dvb/frontends/dib3000mc.c | |||
@@ -297,7 +297,7 @@ static int dib3000mc_set_general_cfg(struct dib3000_state *state, struct dvb_fro | |||
297 | static int dib3000mc_get_frontend(struct dvb_frontend* fe, | 297 | static int dib3000mc_get_frontend(struct dvb_frontend* fe, |
298 | struct dvb_frontend_parameters *fep) | 298 | struct dvb_frontend_parameters *fep) |
299 | { | 299 | { |
300 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 300 | struct dib3000_state* state = fe->demodulator_priv; |
301 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; | 301 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; |
302 | fe_code_rate_t *cr; | 302 | fe_code_rate_t *cr; |
303 | u16 tps_val,cr_val; | 303 | u16 tps_val,cr_val; |
@@ -458,7 +458,7 @@ static int dib3000mc_get_frontend(struct dvb_frontend* fe, | |||
458 | static int dib3000mc_set_frontend(struct dvb_frontend* fe, | 458 | static int dib3000mc_set_frontend(struct dvb_frontend* fe, |
459 | struct dvb_frontend_parameters *fep, int tuner) | 459 | struct dvb_frontend_parameters *fep, int tuner) |
460 | { | 460 | { |
461 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 461 | struct dib3000_state* state = fe->demodulator_priv; |
462 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; | 462 | struct dvb_ofdm_parameters *ofdm = &fep->u.ofdm; |
463 | int search_state,auto_val; | 463 | int search_state,auto_val; |
464 | u16 val; | 464 | u16 val; |
@@ -659,7 +659,7 @@ static int dib3000mc_fe_init(struct dvb_frontend* fe, int mobile_mode) | |||
659 | } | 659 | } |
660 | static int dib3000mc_read_status(struct dvb_frontend* fe, fe_status_t *stat) | 660 | static int dib3000mc_read_status(struct dvb_frontend* fe, fe_status_t *stat) |
661 | { | 661 | { |
662 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 662 | struct dib3000_state* state = fe->demodulator_priv; |
663 | u16 lock = rd(DIB3000MC_REG_LOCKING); | 663 | u16 lock = rd(DIB3000MC_REG_LOCKING); |
664 | 664 | ||
665 | *stat = 0; | 665 | *stat = 0; |
@@ -679,14 +679,14 @@ static int dib3000mc_read_status(struct dvb_frontend* fe, fe_status_t *stat) | |||
679 | 679 | ||
680 | static int dib3000mc_read_ber(struct dvb_frontend* fe, u32 *ber) | 680 | static int dib3000mc_read_ber(struct dvb_frontend* fe, u32 *ber) |
681 | { | 681 | { |
682 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 682 | struct dib3000_state* state = fe->demodulator_priv; |
683 | *ber = ((rd(DIB3000MC_REG_BER_MSB) << 16) | rd(DIB3000MC_REG_BER_LSB)); | 683 | *ber = ((rd(DIB3000MC_REG_BER_MSB) << 16) | rd(DIB3000MC_REG_BER_LSB)); |
684 | return 0; | 684 | return 0; |
685 | } | 685 | } |
686 | 686 | ||
687 | static int dib3000mc_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) | 687 | static int dib3000mc_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) |
688 | { | 688 | { |
689 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 689 | struct dib3000_state* state = fe->demodulator_priv; |
690 | 690 | ||
691 | *unc = rd(DIB3000MC_REG_PACKET_ERROR_COUNT); | 691 | *unc = rd(DIB3000MC_REG_PACKET_ERROR_COUNT); |
692 | return 0; | 692 | return 0; |
@@ -695,7 +695,7 @@ static int dib3000mc_read_unc_blocks(struct dvb_frontend* fe, u32 *unc) | |||
695 | /* see dib3000mb.c for calculation comments */ | 695 | /* see dib3000mb.c for calculation comments */ |
696 | static int dib3000mc_read_signal_strength(struct dvb_frontend* fe, u16 *strength) | 696 | static int dib3000mc_read_signal_strength(struct dvb_frontend* fe, u16 *strength) |
697 | { | 697 | { |
698 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 698 | struct dib3000_state* state = fe->demodulator_priv; |
699 | u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB); | 699 | u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB); |
700 | *strength = (((val >> 6) & 0xff) << 8) + (val & 0x3f); | 700 | *strength = (((val >> 6) & 0xff) << 8) + (val & 0x3f); |
701 | 701 | ||
@@ -706,7 +706,7 @@ static int dib3000mc_read_signal_strength(struct dvb_frontend* fe, u16 *strength | |||
706 | /* see dib3000mb.c for calculation comments */ | 706 | /* see dib3000mb.c for calculation comments */ |
707 | static int dib3000mc_read_snr(struct dvb_frontend* fe, u16 *snr) | 707 | static int dib3000mc_read_snr(struct dvb_frontend* fe, u16 *snr) |
708 | { | 708 | { |
709 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 709 | struct dib3000_state* state = fe->demodulator_priv; |
710 | u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB), | 710 | u16 val = rd(DIB3000MC_REG_SIGNAL_NOISE_LSB), |
711 | val2 = rd(DIB3000MC_REG_SIGNAL_NOISE_MSB); | 711 | val2 = rd(DIB3000MC_REG_SIGNAL_NOISE_MSB); |
712 | u16 sig,noise; | 712 | u16 sig,noise; |
@@ -726,7 +726,7 @@ static int dib3000mc_read_snr(struct dvb_frontend* fe, u16 *snr) | |||
726 | 726 | ||
727 | static int dib3000mc_sleep(struct dvb_frontend* fe) | 727 | static int dib3000mc_sleep(struct dvb_frontend* fe) |
728 | { | 728 | { |
729 | struct dib3000_state* state = (struct dib3000_state*) fe->demodulator_priv; | 729 | struct dib3000_state* state = fe->demodulator_priv; |
730 | 730 | ||
731 | set_or(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_PWR_DOWN); | 731 | set_or(DIB3000MC_REG_CLK_CFG_7,DIB3000MC_CLK_CFG_7_PWR_DOWN); |
732 | wr(DIB3000MC_REG_CLK_CFG_1,DIB3000MC_CLK_CFG_1_POWER_DOWN); | 732 | wr(DIB3000MC_REG_CLK_CFG_1,DIB3000MC_CLK_CFG_1_POWER_DOWN); |
@@ -756,7 +756,7 @@ static int dib3000mc_set_frontend_and_tuner(struct dvb_frontend* fe, struct dvb_ | |||
756 | 756 | ||
757 | static void dib3000mc_release(struct dvb_frontend* fe) | 757 | static void dib3000mc_release(struct dvb_frontend* fe) |
758 | { | 758 | { |
759 | struct dib3000_state *state = (struct dib3000_state *) fe->demodulator_priv; | 759 | struct dib3000_state *state = fe->demodulator_priv; |
760 | kfree(state); | 760 | kfree(state); |
761 | } | 761 | } |
762 | 762 | ||
@@ -771,7 +771,7 @@ static int dib3000mc_pid_control(struct dvb_frontend *fe,int index, int pid,int | |||
771 | 771 | ||
772 | static int dib3000mc_fifo_control(struct dvb_frontend *fe, int onoff) | 772 | static int dib3000mc_fifo_control(struct dvb_frontend *fe, int onoff) |
773 | { | 773 | { |
774 | struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; | 774 | struct dib3000_state *state = fe->demodulator_priv; |
775 | u16 tmp = rd(DIB3000MC_REG_SMO_MODE); | 775 | u16 tmp = rd(DIB3000MC_REG_SMO_MODE); |
776 | 776 | ||
777 | deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); | 777 | deb_xfer("%s fifo\n",onoff ? "enabling" : "disabling"); |
@@ -803,7 +803,7 @@ static int dib3000mc_pid_parse(struct dvb_frontend *fe, int onoff) | |||
803 | 803 | ||
804 | static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr) | 804 | static int dib3000mc_tuner_pass_ctrl(struct dvb_frontend *fe, int onoff, u8 pll_addr) |
805 | { | 805 | { |
806 | struct dib3000_state *state = (struct dib3000_state*) fe->demodulator_priv; | 806 | struct dib3000_state *state = fe->demodulator_priv; |
807 | if (onoff) { | 807 | if (onoff) { |
808 | wr(DIB3000MC_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr)); | 808 | wr(DIB3000MC_REG_TUNER, DIB3000_TUNER_WRITE_ENABLE(pll_addr)); |
809 | } else { | 809 | } else { |
@@ -844,7 +844,7 @@ struct dvb_frontend* dib3000mc_attach(const struct dib3000_config* config, | |||
844 | u16 devid; | 844 | u16 devid; |
845 | 845 | ||
846 | /* allocate memory for the internal state */ | 846 | /* allocate memory for the internal state */ |
847 | state = (struct dib3000_state*) kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); | 847 | state = kmalloc(sizeof(struct dib3000_state), GFP_KERNEL); |
848 | if (state == NULL) | 848 | if (state == NULL) |
849 | goto error; | 849 | goto error; |
850 | memset(state,0,sizeof(struct dib3000_state)); | 850 | memset(state,0,sizeof(struct dib3000_state)); |
diff --git a/drivers/media/dvb/frontends/dvb_dummy_fe.c b/drivers/media/dvb/frontends/dvb_dummy_fe.c index c05a9b05600c..cff93b9d8ab2 100644 --- a/drivers/media/dvb/frontends/dvb_dummy_fe.c +++ b/drivers/media/dvb/frontends/dvb_dummy_fe.c | |||
@@ -100,7 +100,7 @@ static int dvb_dummy_fe_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t vo | |||
100 | 100 | ||
101 | static void dvb_dummy_fe_release(struct dvb_frontend* fe) | 101 | static void dvb_dummy_fe_release(struct dvb_frontend* fe) |
102 | { | 102 | { |
103 | struct dvb_dummy_fe_state* state = (struct dvb_dummy_fe_state*) fe->demodulator_priv; | 103 | struct dvb_dummy_fe_state* state = fe->demodulator_priv; |
104 | kfree(state); | 104 | kfree(state); |
105 | } | 105 | } |
106 | 106 | ||
@@ -111,7 +111,7 @@ struct dvb_frontend* dvb_dummy_fe_ofdm_attach(void) | |||
111 | struct dvb_dummy_fe_state* state = NULL; | 111 | struct dvb_dummy_fe_state* state = NULL; |
112 | 112 | ||
113 | /* allocate memory for the internal state */ | 113 | /* allocate memory for the internal state */ |
114 | state = (struct dvb_dummy_fe_state*) kmalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); | 114 | state = kmalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); |
115 | if (state == NULL) goto error; | 115 | if (state == NULL) goto error; |
116 | 116 | ||
117 | /* setup the state */ | 117 | /* setup the state */ |
@@ -134,7 +134,7 @@ struct dvb_frontend* dvb_dummy_fe_qpsk_attach() | |||
134 | struct dvb_dummy_fe_state* state = NULL; | 134 | struct dvb_dummy_fe_state* state = NULL; |
135 | 135 | ||
136 | /* allocate memory for the internal state */ | 136 | /* allocate memory for the internal state */ |
137 | state = (struct dvb_dummy_fe_state*) kmalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); | 137 | state = kmalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); |
138 | if (state == NULL) goto error; | 138 | if (state == NULL) goto error; |
139 | 139 | ||
140 | /* setup the state */ | 140 | /* setup the state */ |
@@ -157,7 +157,7 @@ struct dvb_frontend* dvb_dummy_fe_qam_attach() | |||
157 | struct dvb_dummy_fe_state* state = NULL; | 157 | struct dvb_dummy_fe_state* state = NULL; |
158 | 158 | ||
159 | /* allocate memory for the internal state */ | 159 | /* allocate memory for the internal state */ |
160 | state = (struct dvb_dummy_fe_state*) kmalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); | 160 | state = kmalloc(sizeof(struct dvb_dummy_fe_state), GFP_KERNEL); |
161 | if (state == NULL) goto error; | 161 | if (state == NULL) goto error; |
162 | 162 | ||
163 | /* setup the state */ | 163 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/l64781.c b/drivers/media/dvb/frontends/l64781.c index 9ac95de9834d..031a1ddc7d11 100644 --- a/drivers/media/dvb/frontends/l64781.c +++ b/drivers/media/dvb/frontends/l64781.c | |||
@@ -121,7 +121,7 @@ static int reset_and_configure (struct l64781_state* state) | |||
121 | 121 | ||
122 | static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_parameters *param) | 122 | static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_parameters *param) |
123 | { | 123 | { |
124 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 124 | struct l64781_state* state = fe->demodulator_priv; |
125 | /* The coderates for FEC_NONE, FEC_4_5 and FEC_FEC_6_7 are arbitrary */ | 125 | /* The coderates for FEC_NONE, FEC_4_5 and FEC_FEC_6_7 are arbitrary */ |
126 | static const u8 fec_tab[] = { 7, 0, 1, 2, 9, 3, 10, 4 }; | 126 | static const u8 fec_tab[] = { 7, 0, 1, 2, 9, 3, 10, 4 }; |
127 | /* QPSK, QAM_16, QAM_64 */ | 127 | /* QPSK, QAM_16, QAM_64 */ |
@@ -234,7 +234,7 @@ static int apply_frontend_param (struct dvb_frontend* fe, struct dvb_frontend_pa | |||
234 | 234 | ||
235 | static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* param) | 235 | static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* param) |
236 | { | 236 | { |
237 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 237 | struct l64781_state* state = fe->demodulator_priv; |
238 | int tmp; | 238 | int tmp; |
239 | 239 | ||
240 | 240 | ||
@@ -352,7 +352,7 @@ static int get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters* | |||
352 | 352 | ||
353 | static int l64781_read_status(struct dvb_frontend* fe, fe_status_t* status) | 353 | static int l64781_read_status(struct dvb_frontend* fe, fe_status_t* status) |
354 | { | 354 | { |
355 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 355 | struct l64781_state* state = fe->demodulator_priv; |
356 | int sync = l64781_readreg (state, 0x32); | 356 | int sync = l64781_readreg (state, 0x32); |
357 | int gain = l64781_readreg (state, 0x0e); | 357 | int gain = l64781_readreg (state, 0x0e); |
358 | 358 | ||
@@ -381,7 +381,7 @@ static int l64781_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
381 | 381 | ||
382 | static int l64781_read_ber(struct dvb_frontend* fe, u32* ber) | 382 | static int l64781_read_ber(struct dvb_frontend* fe, u32* ber) |
383 | { | 383 | { |
384 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 384 | struct l64781_state* state = fe->demodulator_priv; |
385 | 385 | ||
386 | /* XXX FIXME: set up counting period (reg 0x26...0x28) | 386 | /* XXX FIXME: set up counting period (reg 0x26...0x28) |
387 | */ | 387 | */ |
@@ -393,7 +393,7 @@ static int l64781_read_ber(struct dvb_frontend* fe, u32* ber) | |||
393 | 393 | ||
394 | static int l64781_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) | 394 | static int l64781_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) |
395 | { | 395 | { |
396 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 396 | struct l64781_state* state = fe->demodulator_priv; |
397 | 397 | ||
398 | u8 gain = l64781_readreg (state, 0x0e); | 398 | u8 gain = l64781_readreg (state, 0x0e); |
399 | *signal_strength = (gain << 8) | gain; | 399 | *signal_strength = (gain << 8) | gain; |
@@ -403,7 +403,7 @@ static int l64781_read_signal_strength(struct dvb_frontend* fe, u16* signal_stre | |||
403 | 403 | ||
404 | static int l64781_read_snr(struct dvb_frontend* fe, u16* snr) | 404 | static int l64781_read_snr(struct dvb_frontend* fe, u16* snr) |
405 | { | 405 | { |
406 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 406 | struct l64781_state* state = fe->demodulator_priv; |
407 | 407 | ||
408 | u8 avg_quality = 0xff - l64781_readreg (state, 0x33); | 408 | u8 avg_quality = 0xff - l64781_readreg (state, 0x33); |
409 | *snr = (avg_quality << 8) | avg_quality; /* not exact, but...*/ | 409 | *snr = (avg_quality << 8) | avg_quality; /* not exact, but...*/ |
@@ -413,7 +413,7 @@ static int l64781_read_snr(struct dvb_frontend* fe, u16* snr) | |||
413 | 413 | ||
414 | static int l64781_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 414 | static int l64781_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
415 | { | 415 | { |
416 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 416 | struct l64781_state* state = fe->demodulator_priv; |
417 | 417 | ||
418 | *ucblocks = l64781_readreg (state, 0x37) | 418 | *ucblocks = l64781_readreg (state, 0x37) |
419 | | (l64781_readreg (state, 0x38) << 8); | 419 | | (l64781_readreg (state, 0x38) << 8); |
@@ -423,7 +423,7 @@ static int l64781_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
423 | 423 | ||
424 | static int l64781_sleep(struct dvb_frontend* fe) | 424 | static int l64781_sleep(struct dvb_frontend* fe) |
425 | { | 425 | { |
426 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 426 | struct l64781_state* state = fe->demodulator_priv; |
427 | 427 | ||
428 | /* Power down */ | 428 | /* Power down */ |
429 | return l64781_writereg (state, 0x3e, 0x5a); | 429 | return l64781_writereg (state, 0x3e, 0x5a); |
@@ -431,7 +431,7 @@ static int l64781_sleep(struct dvb_frontend* fe) | |||
431 | 431 | ||
432 | static int l64781_init(struct dvb_frontend* fe) | 432 | static int l64781_init(struct dvb_frontend* fe) |
433 | { | 433 | { |
434 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 434 | struct l64781_state* state = fe->demodulator_priv; |
435 | 435 | ||
436 | reset_and_configure (state); | 436 | reset_and_configure (state); |
437 | 437 | ||
@@ -484,7 +484,7 @@ static int l64781_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend | |||
484 | 484 | ||
485 | static void l64781_release(struct dvb_frontend* fe) | 485 | static void l64781_release(struct dvb_frontend* fe) |
486 | { | 486 | { |
487 | struct l64781_state* state = (struct l64781_state*) fe->demodulator_priv; | 487 | struct l64781_state* state = fe->demodulator_priv; |
488 | kfree(state); | 488 | kfree(state); |
489 | } | 489 | } |
490 | 490 | ||
@@ -501,7 +501,7 @@ struct dvb_frontend* l64781_attach(const struct l64781_config* config, | |||
501 | { .addr = config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; | 501 | { .addr = config->demod_address, .flags = I2C_M_RD, .buf = b1, .len = 1 } }; |
502 | 502 | ||
503 | /* allocate memory for the internal state */ | 503 | /* allocate memory for the internal state */ |
504 | state = (struct l64781_state*) kmalloc(sizeof(struct l64781_state), GFP_KERNEL); | 504 | state = kmalloc(sizeof(struct l64781_state), GFP_KERNEL); |
505 | if (state == NULL) goto error; | 505 | if (state == NULL) goto error; |
506 | 506 | ||
507 | /* setup the state */ | 507 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c index 176a22e3441b..e455aecd76b2 100644 --- a/drivers/media/dvb/frontends/mt312.c +++ b/drivers/media/dvb/frontends/mt312.c | |||
@@ -226,7 +226,7 @@ static int mt312_get_code_rate(struct mt312_state* state, fe_code_rate_t *cr) | |||
226 | 226 | ||
227 | static int mt312_initfe(struct dvb_frontend* fe) | 227 | static int mt312_initfe(struct dvb_frontend* fe) |
228 | { | 228 | { |
229 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 229 | struct mt312_state *state = fe->demodulator_priv; |
230 | int ret; | 230 | int ret; |
231 | u8 buf[2]; | 231 | u8 buf[2]; |
232 | 232 | ||
@@ -287,7 +287,7 @@ static int mt312_initfe(struct dvb_frontend* fe) | |||
287 | static int mt312_send_master_cmd(struct dvb_frontend* fe, | 287 | static int mt312_send_master_cmd(struct dvb_frontend* fe, |
288 | struct dvb_diseqc_master_cmd *c) | 288 | struct dvb_diseqc_master_cmd *c) |
289 | { | 289 | { |
290 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 290 | struct mt312_state *state = fe->demodulator_priv; |
291 | int ret; | 291 | int ret; |
292 | u8 diseqc_mode; | 292 | u8 diseqc_mode; |
293 | 293 | ||
@@ -318,7 +318,7 @@ static int mt312_send_master_cmd(struct dvb_frontend* fe, | |||
318 | 318 | ||
319 | static int mt312_send_burst(struct dvb_frontend* fe, const fe_sec_mini_cmd_t c) | 319 | static int mt312_send_burst(struct dvb_frontend* fe, const fe_sec_mini_cmd_t c) |
320 | { | 320 | { |
321 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 321 | struct mt312_state *state = fe->demodulator_priv; |
322 | const u8 mini_tab[2] = { 0x02, 0x03 }; | 322 | const u8 mini_tab[2] = { 0x02, 0x03 }; |
323 | 323 | ||
324 | int ret; | 324 | int ret; |
@@ -340,7 +340,7 @@ static int mt312_send_burst(struct dvb_frontend* fe, const fe_sec_mini_cmd_t c) | |||
340 | 340 | ||
341 | static int mt312_set_tone(struct dvb_frontend* fe, const fe_sec_tone_mode_t t) | 341 | static int mt312_set_tone(struct dvb_frontend* fe, const fe_sec_tone_mode_t t) |
342 | { | 342 | { |
343 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 343 | struct mt312_state *state = fe->demodulator_priv; |
344 | const u8 tone_tab[2] = { 0x01, 0x00 }; | 344 | const u8 tone_tab[2] = { 0x01, 0x00 }; |
345 | 345 | ||
346 | int ret; | 346 | int ret; |
@@ -362,7 +362,7 @@ static int mt312_set_tone(struct dvb_frontend* fe, const fe_sec_tone_mode_t t) | |||
362 | 362 | ||
363 | static int mt312_set_voltage(struct dvb_frontend* fe, const fe_sec_voltage_t v) | 363 | static int mt312_set_voltage(struct dvb_frontend* fe, const fe_sec_voltage_t v) |
364 | { | 364 | { |
365 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 365 | struct mt312_state *state = fe->demodulator_priv; |
366 | const u8 volt_tab[3] = { 0x00, 0x40, 0x00 }; | 366 | const u8 volt_tab[3] = { 0x00, 0x40, 0x00 }; |
367 | 367 | ||
368 | if (v > SEC_VOLTAGE_OFF) | 368 | if (v > SEC_VOLTAGE_OFF) |
@@ -373,7 +373,7 @@ static int mt312_set_voltage(struct dvb_frontend* fe, const fe_sec_voltage_t v) | |||
373 | 373 | ||
374 | static int mt312_read_status(struct dvb_frontend* fe, fe_status_t *s) | 374 | static int mt312_read_status(struct dvb_frontend* fe, fe_status_t *s) |
375 | { | 375 | { |
376 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 376 | struct mt312_state *state = fe->demodulator_priv; |
377 | int ret; | 377 | int ret; |
378 | u8 status[3]; | 378 | u8 status[3]; |
379 | 379 | ||
@@ -400,7 +400,7 @@ static int mt312_read_status(struct dvb_frontend* fe, fe_status_t *s) | |||
400 | 400 | ||
401 | static int mt312_read_ber(struct dvb_frontend* fe, u32 *ber) | 401 | static int mt312_read_ber(struct dvb_frontend* fe, u32 *ber) |
402 | { | 402 | { |
403 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 403 | struct mt312_state *state = fe->demodulator_priv; |
404 | int ret; | 404 | int ret; |
405 | u8 buf[3]; | 405 | u8 buf[3]; |
406 | 406 | ||
@@ -414,7 +414,7 @@ static int mt312_read_ber(struct dvb_frontend* fe, u32 *ber) | |||
414 | 414 | ||
415 | static int mt312_read_signal_strength(struct dvb_frontend* fe, u16 *signal_strength) | 415 | static int mt312_read_signal_strength(struct dvb_frontend* fe, u16 *signal_strength) |
416 | { | 416 | { |
417 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 417 | struct mt312_state *state = fe->demodulator_priv; |
418 | int ret; | 418 | int ret; |
419 | u8 buf[3]; | 419 | u8 buf[3]; |
420 | u16 agc; | 420 | u16 agc; |
@@ -435,7 +435,7 @@ static int mt312_read_signal_strength(struct dvb_frontend* fe, u16 *signal_stren | |||
435 | 435 | ||
436 | static int mt312_read_snr(struct dvb_frontend* fe, u16 *snr) | 436 | static int mt312_read_snr(struct dvb_frontend* fe, u16 *snr) |
437 | { | 437 | { |
438 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 438 | struct mt312_state *state = fe->demodulator_priv; |
439 | int ret; | 439 | int ret; |
440 | u8 buf[2]; | 440 | u8 buf[2]; |
441 | 441 | ||
@@ -449,7 +449,7 @@ static int mt312_read_snr(struct dvb_frontend* fe, u16 *snr) | |||
449 | 449 | ||
450 | static int mt312_read_ucblocks(struct dvb_frontend* fe, u32 *ubc) | 450 | static int mt312_read_ucblocks(struct dvb_frontend* fe, u32 *ubc) |
451 | { | 451 | { |
452 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 452 | struct mt312_state *state = fe->demodulator_priv; |
453 | int ret; | 453 | int ret; |
454 | u8 buf[2]; | 454 | u8 buf[2]; |
455 | 455 | ||
@@ -464,7 +464,7 @@ static int mt312_read_ucblocks(struct dvb_frontend* fe, u32 *ubc) | |||
464 | static int mt312_set_frontend(struct dvb_frontend* fe, | 464 | static int mt312_set_frontend(struct dvb_frontend* fe, |
465 | struct dvb_frontend_parameters *p) | 465 | struct dvb_frontend_parameters *p) |
466 | { | 466 | { |
467 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 467 | struct mt312_state *state = fe->demodulator_priv; |
468 | int ret; | 468 | int ret; |
469 | u8 buf[5], config_val; | 469 | u8 buf[5], config_val; |
470 | u16 sr; | 470 | u16 sr; |
@@ -560,7 +560,7 @@ static int mt312_set_frontend(struct dvb_frontend* fe, | |||
560 | static int mt312_get_frontend(struct dvb_frontend* fe, | 560 | static int mt312_get_frontend(struct dvb_frontend* fe, |
561 | struct dvb_frontend_parameters *p) | 561 | struct dvb_frontend_parameters *p) |
562 | { | 562 | { |
563 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 563 | struct mt312_state *state = fe->demodulator_priv; |
564 | int ret; | 564 | int ret; |
565 | 565 | ||
566 | if ((ret = mt312_get_inversion(state, &p->inversion)) < 0) | 566 | if ((ret = mt312_get_inversion(state, &p->inversion)) < 0) |
@@ -577,7 +577,7 @@ static int mt312_get_frontend(struct dvb_frontend* fe, | |||
577 | 577 | ||
578 | static int mt312_sleep(struct dvb_frontend* fe) | 578 | static int mt312_sleep(struct dvb_frontend* fe) |
579 | { | 579 | { |
580 | struct mt312_state *state = (struct mt312_state*) fe->demodulator_priv; | 580 | struct mt312_state *state = fe->demodulator_priv; |
581 | int ret; | 581 | int ret; |
582 | u8 config; | 582 | u8 config; |
583 | 583 | ||
@@ -605,7 +605,7 @@ static int mt312_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_ | |||
605 | 605 | ||
606 | static void mt312_release(struct dvb_frontend* fe) | 606 | static void mt312_release(struct dvb_frontend* fe) |
607 | { | 607 | { |
608 | struct mt312_state* state = (struct mt312_state*) fe->demodulator_priv; | 608 | struct mt312_state* state = fe->demodulator_priv; |
609 | kfree(state); | 609 | kfree(state); |
610 | } | 610 | } |
611 | 611 | ||
@@ -617,7 +617,7 @@ struct dvb_frontend* vp310_attach(const struct mt312_config* config, | |||
617 | struct mt312_state* state = NULL; | 617 | struct mt312_state* state = NULL; |
618 | 618 | ||
619 | /* allocate memory for the internal state */ | 619 | /* allocate memory for the internal state */ |
620 | state = (struct mt312_state*) kmalloc(sizeof(struct mt312_state), GFP_KERNEL); | 620 | state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); |
621 | if (state == NULL) | 621 | if (state == NULL) |
622 | goto error; | 622 | goto error; |
623 | 623 | ||
@@ -651,7 +651,7 @@ struct dvb_frontend* mt312_attach(const struct mt312_config* config, | |||
651 | struct mt312_state* state = NULL; | 651 | struct mt312_state* state = NULL; |
652 | 652 | ||
653 | /* allocate memory for the internal state */ | 653 | /* allocate memory for the internal state */ |
654 | state = (struct mt312_state*) kmalloc(sizeof(struct mt312_state), GFP_KERNEL); | 654 | state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); |
655 | if (state == NULL) | 655 | if (state == NULL) |
656 | goto error; | 656 | goto error; |
657 | 657 | ||
diff --git a/drivers/media/dvb/frontends/nxt2002.c b/drivers/media/dvb/frontends/nxt2002.c index 4743aa17406e..8805b0f5f619 100644 --- a/drivers/media/dvb/frontends/nxt2002.c +++ b/drivers/media/dvb/frontends/nxt2002.c | |||
@@ -241,7 +241,7 @@ static void nxt2002_agc_reset(struct nxt2002_state* state) | |||
241 | static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware *fw) | 241 | static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware *fw) |
242 | { | 242 | { |
243 | 243 | ||
244 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 244 | struct nxt2002_state* state = fe->demodulator_priv; |
245 | u8 buf[256],written = 0,chunkpos = 0; | 245 | u8 buf[256],written = 0,chunkpos = 0; |
246 | u16 rambase,position,crc = 0; | 246 | u16 rambase,position,crc = 0; |
247 | 247 | ||
@@ -309,7 +309,7 @@ static int nxt2002_load_firmware (struct dvb_frontend* fe, const struct firmware | |||
309 | static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, | 309 | static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, |
310 | struct dvb_frontend_parameters *p) | 310 | struct dvb_frontend_parameters *p) |
311 | { | 311 | { |
312 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 312 | struct nxt2002_state* state = fe->demodulator_priv; |
313 | u32 freq = 0; | 313 | u32 freq = 0; |
314 | u16 tunerfreq = 0; | 314 | u16 tunerfreq = 0; |
315 | u8 buf[4]; | 315 | u8 buf[4]; |
@@ -453,7 +453,7 @@ static int nxt2002_setup_frontend_parameters (struct dvb_frontend* fe, | |||
453 | 453 | ||
454 | static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status) | 454 | static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status) |
455 | { | 455 | { |
456 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 456 | struct nxt2002_state* state = fe->demodulator_priv; |
457 | u8 lock; | 457 | u8 lock; |
458 | i2c_readbytes(state,0x31,&lock,1); | 458 | i2c_readbytes(state,0x31,&lock,1); |
459 | 459 | ||
@@ -470,7 +470,7 @@ static int nxt2002_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
470 | 470 | ||
471 | static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber) | 471 | static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber) |
472 | { | 472 | { |
473 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 473 | struct nxt2002_state* state = fe->demodulator_priv; |
474 | u8 b[3]; | 474 | u8 b[3]; |
475 | 475 | ||
476 | nxt2002_readreg_multibyte(state,0xE6,b,3); | 476 | nxt2002_readreg_multibyte(state,0xE6,b,3); |
@@ -482,7 +482,7 @@ static int nxt2002_read_ber(struct dvb_frontend* fe, u32* ber) | |||
482 | 482 | ||
483 | static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 483 | static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
484 | { | 484 | { |
485 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 485 | struct nxt2002_state* state = fe->demodulator_priv; |
486 | u8 b[2]; | 486 | u8 b[2]; |
487 | u16 temp = 0; | 487 | u16 temp = 0; |
488 | 488 | ||
@@ -502,7 +502,7 @@ static int nxt2002_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
502 | static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr) | 502 | static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr) |
503 | { | 503 | { |
504 | 504 | ||
505 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 505 | struct nxt2002_state* state = fe->demodulator_priv; |
506 | u8 b[2]; | 506 | u8 b[2]; |
507 | u16 temp = 0, temp2; | 507 | u16 temp = 0, temp2; |
508 | u32 snrdb = 0; | 508 | u32 snrdb = 0; |
@@ -536,7 +536,7 @@ static int nxt2002_read_snr(struct dvb_frontend* fe, u16* snr) | |||
536 | 536 | ||
537 | static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 537 | static int nxt2002_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
538 | { | 538 | { |
539 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 539 | struct nxt2002_state* state = fe->demodulator_priv; |
540 | u8 b[3]; | 540 | u8 b[3]; |
541 | 541 | ||
542 | nxt2002_readreg_multibyte(state,0xE6,b,3); | 542 | nxt2002_readreg_multibyte(state,0xE6,b,3); |
@@ -552,7 +552,7 @@ static int nxt2002_sleep(struct dvb_frontend* fe) | |||
552 | 552 | ||
553 | static int nxt2002_init(struct dvb_frontend* fe) | 553 | static int nxt2002_init(struct dvb_frontend* fe) |
554 | { | 554 | { |
555 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 555 | struct nxt2002_state* state = fe->demodulator_priv; |
556 | const struct firmware *fw; | 556 | const struct firmware *fw; |
557 | int ret; | 557 | int ret; |
558 | u8 buf[2]; | 558 | u8 buf[2]; |
@@ -624,7 +624,7 @@ static int nxt2002_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronten | |||
624 | 624 | ||
625 | static void nxt2002_release(struct dvb_frontend* fe) | 625 | static void nxt2002_release(struct dvb_frontend* fe) |
626 | { | 626 | { |
627 | struct nxt2002_state* state = (struct nxt2002_state*) fe->demodulator_priv; | 627 | struct nxt2002_state* state = fe->demodulator_priv; |
628 | kfree(state); | 628 | kfree(state); |
629 | } | 629 | } |
630 | 630 | ||
@@ -637,7 +637,7 @@ struct dvb_frontend* nxt2002_attach(const struct nxt2002_config* config, | |||
637 | u8 buf [] = {0,0,0,0,0}; | 637 | u8 buf [] = {0,0,0,0,0}; |
638 | 638 | ||
639 | /* allocate memory for the internal state */ | 639 | /* allocate memory for the internal state */ |
640 | state = (struct nxt2002_state*) kmalloc(sizeof(struct nxt2002_state), GFP_KERNEL); | 640 | state = kmalloc(sizeof(struct nxt2002_state), GFP_KERNEL); |
641 | if (state == NULL) goto error; | 641 | if (state == NULL) goto error; |
642 | 642 | ||
643 | /* setup the state */ | 643 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/nxt6000.c b/drivers/media/dvb/frontends/nxt6000.c index f79a69d0eb07..966de9853d18 100644 --- a/drivers/media/dvb/frontends/nxt6000.c +++ b/drivers/media/dvb/frontends/nxt6000.c | |||
@@ -176,7 +176,7 @@ static int nxt6000_set_transmission_mode(struct nxt6000_state* state, fe_transmi | |||
176 | 176 | ||
177 | static void nxt6000_setup(struct dvb_frontend* fe) | 177 | static void nxt6000_setup(struct dvb_frontend* fe) |
178 | { | 178 | { |
179 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 179 | struct nxt6000_state* state = fe->demodulator_priv; |
180 | 180 | ||
181 | nxt6000_writereg(state, RS_COR_SYNC_PARAM, SYNC_PARAM); | 181 | nxt6000_writereg(state, RS_COR_SYNC_PARAM, SYNC_PARAM); |
182 | nxt6000_writereg(state, BER_CTRL, /*(1 << 2) | */ (0x01 << 1) | 0x01); | 182 | nxt6000_writereg(state, BER_CTRL, /*(1 << 2) | */ (0x01 << 1) | 0x01); |
@@ -427,7 +427,7 @@ static void nxt6000_dump_status(struct nxt6000_state *state) | |||
427 | static int nxt6000_read_status(struct dvb_frontend* fe, fe_status_t* status) | 427 | static int nxt6000_read_status(struct dvb_frontend* fe, fe_status_t* status) |
428 | { | 428 | { |
429 | u8 core_status; | 429 | u8 core_status; |
430 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 430 | struct nxt6000_state* state = fe->demodulator_priv; |
431 | 431 | ||
432 | *status = 0; | 432 | *status = 0; |
433 | 433 | ||
@@ -456,7 +456,7 @@ static int nxt6000_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
456 | 456 | ||
457 | static int nxt6000_init(struct dvb_frontend* fe) | 457 | static int nxt6000_init(struct dvb_frontend* fe) |
458 | { | 458 | { |
459 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 459 | struct nxt6000_state* state = fe->demodulator_priv; |
460 | 460 | ||
461 | nxt6000_reset(state); | 461 | nxt6000_reset(state); |
462 | nxt6000_setup(fe); | 462 | nxt6000_setup(fe); |
@@ -466,7 +466,7 @@ static int nxt6000_init(struct dvb_frontend* fe) | |||
466 | 466 | ||
467 | static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *param) | 467 | static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *param) |
468 | { | 468 | { |
469 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 469 | struct nxt6000_state* state = fe->demodulator_priv; |
470 | int result; | 470 | int result; |
471 | 471 | ||
472 | nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x01); /* open i2c bus switch */ | 472 | nxt6000_writereg(state, ENABLE_TUNER_IIC, 0x01); /* open i2c bus switch */ |
@@ -487,13 +487,13 @@ static int nxt6000_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
487 | 487 | ||
488 | static void nxt6000_release(struct dvb_frontend* fe) | 488 | static void nxt6000_release(struct dvb_frontend* fe) |
489 | { | 489 | { |
490 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 490 | struct nxt6000_state* state = fe->demodulator_priv; |
491 | kfree(state); | 491 | kfree(state); |
492 | } | 492 | } |
493 | 493 | ||
494 | static int nxt6000_read_snr(struct dvb_frontend* fe, u16* snr) | 494 | static int nxt6000_read_snr(struct dvb_frontend* fe, u16* snr) |
495 | { | 495 | { |
496 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 496 | struct nxt6000_state* state = fe->demodulator_priv; |
497 | 497 | ||
498 | *snr = nxt6000_readreg( state, OFDM_CHC_SNR) / 8; | 498 | *snr = nxt6000_readreg( state, OFDM_CHC_SNR) / 8; |
499 | 499 | ||
@@ -502,7 +502,7 @@ static int nxt6000_read_snr(struct dvb_frontend* fe, u16* snr) | |||
502 | 502 | ||
503 | static int nxt6000_read_ber(struct dvb_frontend* fe, u32* ber) | 503 | static int nxt6000_read_ber(struct dvb_frontend* fe, u32* ber) |
504 | { | 504 | { |
505 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 505 | struct nxt6000_state* state = fe->demodulator_priv; |
506 | 506 | ||
507 | nxt6000_writereg( state, VIT_COR_INTSTAT, 0x18 ); | 507 | nxt6000_writereg( state, VIT_COR_INTSTAT, 0x18 ); |
508 | 508 | ||
@@ -516,7 +516,7 @@ static int nxt6000_read_ber(struct dvb_frontend* fe, u32* ber) | |||
516 | 516 | ||
517 | static int nxt6000_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) | 517 | static int nxt6000_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) |
518 | { | 518 | { |
519 | struct nxt6000_state* state = (struct nxt6000_state*) fe->demodulator_priv; | 519 | struct nxt6000_state* state = fe->demodulator_priv; |
520 | 520 | ||
521 | *signal_strength = (short) (511 - | 521 | *signal_strength = (short) (511 - |
522 | (nxt6000_readreg(state, AGC_GAIN_1) + | 522 | (nxt6000_readreg(state, AGC_GAIN_1) + |
@@ -533,7 +533,7 @@ struct dvb_frontend* nxt6000_attach(const struct nxt6000_config* config, | |||
533 | struct nxt6000_state* state = NULL; | 533 | struct nxt6000_state* state = NULL; |
534 | 534 | ||
535 | /* allocate memory for the internal state */ | 535 | /* allocate memory for the internal state */ |
536 | state = (struct nxt6000_state*) kmalloc(sizeof(struct nxt6000_state), GFP_KERNEL); | 536 | state = kmalloc(sizeof(struct nxt6000_state), GFP_KERNEL); |
537 | if (state == NULL) goto error; | 537 | if (state == NULL) goto error; |
538 | 538 | ||
539 | /* setup the state */ | 539 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/or51132.c b/drivers/media/dvb/frontends/or51132.c index df5dee7760a3..cc0a77c790f1 100644 --- a/drivers/media/dvb/frontends/or51132.c +++ b/drivers/media/dvb/frontends/or51132.c | |||
@@ -102,7 +102,7 @@ static u8 i2c_readbytes (struct or51132_state* state, u8 reg, u8* buf, int len) | |||
102 | 102 | ||
103 | static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware *fw) | 103 | static int or51132_load_firmware (struct dvb_frontend* fe, const struct firmware *fw) |
104 | { | 104 | { |
105 | struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; | 105 | struct or51132_state* state = fe->demodulator_priv; |
106 | static u8 run_buf[] = {0x7F,0x01}; | 106 | static u8 run_buf[] = {0x7F,0x01}; |
107 | static u8 get_ver_buf[] = {0x04,0x00,0x30,0x00,0x00}; | 107 | static u8 get_ver_buf[] = {0x04,0x00,0x30,0x00,0x00}; |
108 | u8 rec_buf[14]; | 108 | u8 rec_buf[14]; |
@@ -240,7 +240,7 @@ static int or51132_sleep(struct dvb_frontend* fe) | |||
240 | 240 | ||
241 | static int or51132_setmode(struct dvb_frontend* fe) | 241 | static int or51132_setmode(struct dvb_frontend* fe) |
242 | { | 242 | { |
243 | struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; | 243 | struct or51132_state* state = fe->demodulator_priv; |
244 | unsigned char cmd_buf[4]; | 244 | unsigned char cmd_buf[4]; |
245 | 245 | ||
246 | dprintk("setmode %d\n",(int)state->current_modulation); | 246 | dprintk("setmode %d\n",(int)state->current_modulation); |
@@ -316,7 +316,7 @@ static int or51132_set_parameters(struct dvb_frontend* fe, | |||
316 | { | 316 | { |
317 | int ret; | 317 | int ret; |
318 | u8 buf[4]; | 318 | u8 buf[4]; |
319 | struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; | 319 | struct or51132_state* state = fe->demodulator_priv; |
320 | const struct firmware *fw; | 320 | const struct firmware *fw; |
321 | 321 | ||
322 | /* Change only if we are actually changing the modulation */ | 322 | /* Change only if we are actually changing the modulation */ |
@@ -391,7 +391,7 @@ static int or51132_set_parameters(struct dvb_frontend* fe, | |||
391 | 391 | ||
392 | static int or51132_read_status(struct dvb_frontend* fe, fe_status_t* status) | 392 | static int or51132_read_status(struct dvb_frontend* fe, fe_status_t* status) |
393 | { | 393 | { |
394 | struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; | 394 | struct or51132_state* state = fe->demodulator_priv; |
395 | unsigned char rec_buf[2]; | 395 | unsigned char rec_buf[2]; |
396 | unsigned char snd_buf[2]; | 396 | unsigned char snd_buf[2]; |
397 | *status = 0; | 397 | *status = 0; |
@@ -464,7 +464,7 @@ static unsigned int i20Log10(unsigned short val) | |||
464 | 464 | ||
465 | static int or51132_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 465 | static int or51132_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
466 | { | 466 | { |
467 | struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; | 467 | struct or51132_state* state = fe->demodulator_priv; |
468 | unsigned char rec_buf[2]; | 468 | unsigned char rec_buf[2]; |
469 | unsigned char snd_buf[2]; | 469 | unsigned char snd_buf[2]; |
470 | u8 rcvr_stat; | 470 | u8 rcvr_stat; |
@@ -512,7 +512,7 @@ static int or51132_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
512 | 512 | ||
513 | static int or51132_read_snr(struct dvb_frontend* fe, u16* snr) | 513 | static int or51132_read_snr(struct dvb_frontend* fe, u16* snr) |
514 | { | 514 | { |
515 | struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; | 515 | struct or51132_state* state = fe->demodulator_priv; |
516 | unsigned char rec_buf[2]; | 516 | unsigned char rec_buf[2]; |
517 | unsigned char snd_buf[2]; | 517 | unsigned char snd_buf[2]; |
518 | u16 snr_equ; | 518 | u16 snr_equ; |
@@ -549,7 +549,7 @@ static int or51132_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronten | |||
549 | 549 | ||
550 | static void or51132_release(struct dvb_frontend* fe) | 550 | static void or51132_release(struct dvb_frontend* fe) |
551 | { | 551 | { |
552 | struct or51132_state* state = (struct or51132_state*) fe->demodulator_priv; | 552 | struct or51132_state* state = fe->demodulator_priv; |
553 | kfree(state); | 553 | kfree(state); |
554 | } | 554 | } |
555 | 555 | ||
diff --git a/drivers/media/dvb/frontends/sp8870.c b/drivers/media/dvb/frontends/sp8870.c index 58ad34ef0a00..764a95a2e212 100644 --- a/drivers/media/dvb/frontends/sp8870.c +++ b/drivers/media/dvb/frontends/sp8870.c | |||
@@ -248,7 +248,7 @@ static int sp8870_wake_up(struct sp8870_state* state) | |||
248 | static int sp8870_set_frontend_parameters (struct dvb_frontend* fe, | 248 | static int sp8870_set_frontend_parameters (struct dvb_frontend* fe, |
249 | struct dvb_frontend_parameters *p) | 249 | struct dvb_frontend_parameters *p) |
250 | { | 250 | { |
251 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 251 | struct sp8870_state* state = fe->demodulator_priv; |
252 | int err; | 252 | int err; |
253 | u16 reg0xc05; | 253 | u16 reg0xc05; |
254 | 254 | ||
@@ -302,7 +302,7 @@ static int sp8870_set_frontend_parameters (struct dvb_frontend* fe, | |||
302 | 302 | ||
303 | static int sp8870_init (struct dvb_frontend* fe) | 303 | static int sp8870_init (struct dvb_frontend* fe) |
304 | { | 304 | { |
305 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 305 | struct sp8870_state* state = fe->demodulator_priv; |
306 | const struct firmware *fw = NULL; | 306 | const struct firmware *fw = NULL; |
307 | 307 | ||
308 | sp8870_wake_up(state); | 308 | sp8870_wake_up(state); |
@@ -358,7 +358,7 @@ static int sp8870_init (struct dvb_frontend* fe) | |||
358 | 358 | ||
359 | static int sp8870_read_status (struct dvb_frontend* fe, fe_status_t * fe_status) | 359 | static int sp8870_read_status (struct dvb_frontend* fe, fe_status_t * fe_status) |
360 | { | 360 | { |
361 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 361 | struct sp8870_state* state = fe->demodulator_priv; |
362 | int status; | 362 | int status; |
363 | int signal; | 363 | int signal; |
364 | 364 | ||
@@ -384,7 +384,7 @@ static int sp8870_read_status (struct dvb_frontend* fe, fe_status_t * fe_status) | |||
384 | 384 | ||
385 | static int sp8870_read_ber (struct dvb_frontend* fe, u32 * ber) | 385 | static int sp8870_read_ber (struct dvb_frontend* fe, u32 * ber) |
386 | { | 386 | { |
387 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 387 | struct sp8870_state* state = fe->demodulator_priv; |
388 | int ret; | 388 | int ret; |
389 | u32 tmp; | 389 | u32 tmp; |
390 | 390 | ||
@@ -412,7 +412,7 @@ static int sp8870_read_ber (struct dvb_frontend* fe, u32 * ber) | |||
412 | 412 | ||
413 | static int sp8870_read_signal_strength(struct dvb_frontend* fe, u16 * signal) | 413 | static int sp8870_read_signal_strength(struct dvb_frontend* fe, u16 * signal) |
414 | { | 414 | { |
415 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 415 | struct sp8870_state* state = fe->demodulator_priv; |
416 | int ret; | 416 | int ret; |
417 | u16 tmp; | 417 | u16 tmp; |
418 | 418 | ||
@@ -438,7 +438,7 @@ static int sp8870_read_signal_strength(struct dvb_frontend* fe, u16 * signal) | |||
438 | 438 | ||
439 | static int sp8870_read_uncorrected_blocks (struct dvb_frontend* fe, u32* ublocks) | 439 | static int sp8870_read_uncorrected_blocks (struct dvb_frontend* fe, u32* ublocks) |
440 | { | 440 | { |
441 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 441 | struct sp8870_state* state = fe->demodulator_priv; |
442 | int ret; | 442 | int ret; |
443 | 443 | ||
444 | *ublocks = 0; | 444 | *ublocks = 0; |
@@ -467,7 +467,7 @@ static int switches = 0; | |||
467 | 467 | ||
468 | static int sp8870_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 468 | static int sp8870_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
469 | { | 469 | { |
470 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 470 | struct sp8870_state* state = fe->demodulator_priv; |
471 | 471 | ||
472 | /* | 472 | /* |
473 | The firmware of the sp8870 sometimes locks up after setting frontend parameters. | 473 | The firmware of the sp8870 sometimes locks up after setting frontend parameters. |
@@ -524,7 +524,7 @@ static int sp8870_set_frontend (struct dvb_frontend* fe, struct dvb_frontend_par | |||
524 | 524 | ||
525 | static int sp8870_sleep(struct dvb_frontend* fe) | 525 | static int sp8870_sleep(struct dvb_frontend* fe) |
526 | { | 526 | { |
527 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 527 | struct sp8870_state* state = fe->demodulator_priv; |
528 | 528 | ||
529 | // tristate TS output and disable interface pins | 529 | // tristate TS output and disable interface pins |
530 | return sp8870_writereg(state, 0xC18, 0x000); | 530 | return sp8870_writereg(state, 0xC18, 0x000); |
@@ -540,7 +540,7 @@ static int sp8870_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend | |||
540 | 540 | ||
541 | static void sp8870_release(struct dvb_frontend* fe) | 541 | static void sp8870_release(struct dvb_frontend* fe) |
542 | { | 542 | { |
543 | struct sp8870_state* state = (struct sp8870_state*) fe->demodulator_priv; | 543 | struct sp8870_state* state = fe->demodulator_priv; |
544 | kfree(state); | 544 | kfree(state); |
545 | } | 545 | } |
546 | 546 | ||
@@ -552,7 +552,7 @@ struct dvb_frontend* sp8870_attach(const struct sp8870_config* config, | |||
552 | struct sp8870_state* state = NULL; | 552 | struct sp8870_state* state = NULL; |
553 | 553 | ||
554 | /* allocate memory for the internal state */ | 554 | /* allocate memory for the internal state */ |
555 | state = (struct sp8870_state*) kmalloc(sizeof(struct sp8870_state), GFP_KERNEL); | 555 | state = kmalloc(sizeof(struct sp8870_state), GFP_KERNEL); |
556 | if (state == NULL) goto error; | 556 | if (state == NULL) goto error; |
557 | 557 | ||
558 | /* setup the state */ | 558 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/sp887x.c b/drivers/media/dvb/frontends/sp887x.c index 7eae833ece49..d868a6927a16 100644 --- a/drivers/media/dvb/frontends/sp887x.c +++ b/drivers/media/dvb/frontends/sp887x.c | |||
@@ -135,7 +135,7 @@ static void sp887x_setup_agc (struct sp887x_state* state) | |||
135 | */ | 135 | */ |
136 | static int sp887x_initial_setup (struct dvb_frontend* fe, const struct firmware *fw) | 136 | static int sp887x_initial_setup (struct dvb_frontend* fe, const struct firmware *fw) |
137 | { | 137 | { |
138 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 138 | struct sp887x_state* state = fe->demodulator_priv; |
139 | u8 buf [BLOCKSIZE+2]; | 139 | u8 buf [BLOCKSIZE+2]; |
140 | int i; | 140 | int i; |
141 | int fw_size = fw->size; | 141 | int fw_size = fw->size; |
@@ -344,7 +344,7 @@ static void sp887x_correct_offsets (struct sp887x_state* state, | |||
344 | static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe, | 344 | static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe, |
345 | struct dvb_frontend_parameters *p) | 345 | struct dvb_frontend_parameters *p) |
346 | { | 346 | { |
347 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 347 | struct sp887x_state* state = fe->demodulator_priv; |
348 | int actual_freq, err; | 348 | int actual_freq, err; |
349 | u16 val, reg0xc05; | 349 | u16 val, reg0xc05; |
350 | 350 | ||
@@ -405,7 +405,7 @@ static int sp887x_setup_frontend_parameters (struct dvb_frontend* fe, | |||
405 | 405 | ||
406 | static int sp887x_read_status(struct dvb_frontend* fe, fe_status_t* status) | 406 | static int sp887x_read_status(struct dvb_frontend* fe, fe_status_t* status) |
407 | { | 407 | { |
408 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 408 | struct sp887x_state* state = fe->demodulator_priv; |
409 | u16 snr12 = sp887x_readreg(state, 0xf16); | 409 | u16 snr12 = sp887x_readreg(state, 0xf16); |
410 | u16 sync0x200 = sp887x_readreg(state, 0x200); | 410 | u16 sync0x200 = sp887x_readreg(state, 0x200); |
411 | u16 sync0xf17 = sp887x_readreg(state, 0xf17); | 411 | u16 sync0xf17 = sp887x_readreg(state, 0xf17); |
@@ -439,7 +439,7 @@ static int sp887x_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
439 | 439 | ||
440 | static int sp887x_read_ber(struct dvb_frontend* fe, u32* ber) | 440 | static int sp887x_read_ber(struct dvb_frontend* fe, u32* ber) |
441 | { | 441 | { |
442 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 442 | struct sp887x_state* state = fe->demodulator_priv; |
443 | 443 | ||
444 | *ber = (sp887x_readreg(state, 0xc08) & 0x3f) | | 444 | *ber = (sp887x_readreg(state, 0xc08) & 0x3f) | |
445 | (sp887x_readreg(state, 0xc07) << 6); | 445 | (sp887x_readreg(state, 0xc07) << 6); |
@@ -453,7 +453,7 @@ static int sp887x_read_ber(struct dvb_frontend* fe, u32* ber) | |||
453 | 453 | ||
454 | static int sp887x_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 454 | static int sp887x_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
455 | { | 455 | { |
456 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 456 | struct sp887x_state* state = fe->demodulator_priv; |
457 | 457 | ||
458 | u16 snr12 = sp887x_readreg(state, 0xf16); | 458 | u16 snr12 = sp887x_readreg(state, 0xf16); |
459 | u32 signal = 3 * (snr12 << 4); | 459 | u32 signal = 3 * (snr12 << 4); |
@@ -464,7 +464,7 @@ static int sp887x_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
464 | 464 | ||
465 | static int sp887x_read_snr(struct dvb_frontend* fe, u16* snr) | 465 | static int sp887x_read_snr(struct dvb_frontend* fe, u16* snr) |
466 | { | 466 | { |
467 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 467 | struct sp887x_state* state = fe->demodulator_priv; |
468 | 468 | ||
469 | u16 snr12 = sp887x_readreg(state, 0xf16); | 469 | u16 snr12 = sp887x_readreg(state, 0xf16); |
470 | *snr = (snr12 << 4) | (snr12 >> 8); | 470 | *snr = (snr12 << 4) | (snr12 >> 8); |
@@ -474,7 +474,7 @@ static int sp887x_read_snr(struct dvb_frontend* fe, u16* snr) | |||
474 | 474 | ||
475 | static int sp887x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 475 | static int sp887x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
476 | { | 476 | { |
477 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 477 | struct sp887x_state* state = fe->demodulator_priv; |
478 | 478 | ||
479 | *ucblocks = sp887x_readreg(state, 0xc0c); | 479 | *ucblocks = sp887x_readreg(state, 0xc0c); |
480 | if (*ucblocks == 0xfff) | 480 | if (*ucblocks == 0xfff) |
@@ -485,7 +485,7 @@ static int sp887x_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
485 | 485 | ||
486 | static int sp887x_sleep(struct dvb_frontend* fe) | 486 | static int sp887x_sleep(struct dvb_frontend* fe) |
487 | { | 487 | { |
488 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 488 | struct sp887x_state* state = fe->demodulator_priv; |
489 | 489 | ||
490 | /* tristate TS output and disable interface pins */ | 490 | /* tristate TS output and disable interface pins */ |
491 | sp887x_writereg(state, 0xc18, 0x000); | 491 | sp887x_writereg(state, 0xc18, 0x000); |
@@ -495,7 +495,7 @@ static int sp887x_sleep(struct dvb_frontend* fe) | |||
495 | 495 | ||
496 | static int sp887x_init(struct dvb_frontend* fe) | 496 | static int sp887x_init(struct dvb_frontend* fe) |
497 | { | 497 | { |
498 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 498 | struct sp887x_state* state = fe->demodulator_priv; |
499 | const struct firmware *fw = NULL; | 499 | const struct firmware *fw = NULL; |
500 | int ret; | 500 | int ret; |
501 | 501 | ||
@@ -534,7 +534,7 @@ static int sp887x_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend | |||
534 | 534 | ||
535 | static void sp887x_release(struct dvb_frontend* fe) | 535 | static void sp887x_release(struct dvb_frontend* fe) |
536 | { | 536 | { |
537 | struct sp887x_state* state = (struct sp887x_state*) fe->demodulator_priv; | 537 | struct sp887x_state* state = fe->demodulator_priv; |
538 | kfree(state); | 538 | kfree(state); |
539 | } | 539 | } |
540 | 540 | ||
@@ -546,7 +546,7 @@ struct dvb_frontend* sp887x_attach(const struct sp887x_config* config, | |||
546 | struct sp887x_state* state = NULL; | 546 | struct sp887x_state* state = NULL; |
547 | 547 | ||
548 | /* allocate memory for the internal state */ | 548 | /* allocate memory for the internal state */ |
549 | state = (struct sp887x_state*) kmalloc(sizeof(struct sp887x_state), GFP_KERNEL); | 549 | state = kmalloc(sizeof(struct sp887x_state), GFP_KERNEL); |
550 | if (state == NULL) goto error; | 550 | if (state == NULL) goto error; |
551 | 551 | ||
552 | /* setup the state */ | 552 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c index 502c6403dfc6..e681263bf079 100644 --- a/drivers/media/dvb/frontends/stv0297.c +++ b/drivers/media/dvb/frontends/stv0297.c | |||
@@ -365,7 +365,7 @@ static int stv0297_set_inversion(struct stv0297_state *state, fe_spectral_invers | |||
365 | 365 | ||
366 | int stv0297_enable_plli2c(struct dvb_frontend *fe) | 366 | int stv0297_enable_plli2c(struct dvb_frontend *fe) |
367 | { | 367 | { |
368 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 368 | struct stv0297_state *state = fe->demodulator_priv; |
369 | 369 | ||
370 | stv0297_writereg(state, 0x87, 0x78); | 370 | stv0297_writereg(state, 0x87, 0x78); |
371 | stv0297_writereg(state, 0x86, 0xc8); | 371 | stv0297_writereg(state, 0x86, 0xc8); |
@@ -375,7 +375,7 @@ int stv0297_enable_plli2c(struct dvb_frontend *fe) | |||
375 | 375 | ||
376 | static int stv0297_init(struct dvb_frontend *fe) | 376 | static int stv0297_init(struct dvb_frontend *fe) |
377 | { | 377 | { |
378 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 378 | struct stv0297_state *state = fe->demodulator_priv; |
379 | int i; | 379 | int i; |
380 | 380 | ||
381 | /* soft reset */ | 381 | /* soft reset */ |
@@ -416,7 +416,7 @@ static int stv0297_init(struct dvb_frontend *fe) | |||
416 | 416 | ||
417 | static int stv0297_sleep(struct dvb_frontend *fe) | 417 | static int stv0297_sleep(struct dvb_frontend *fe) |
418 | { | 418 | { |
419 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 419 | struct stv0297_state *state = fe->demodulator_priv; |
420 | 420 | ||
421 | stv0297_writereg_mask(state, 0x80, 1, 1); | 421 | stv0297_writereg_mask(state, 0x80, 1, 1); |
422 | 422 | ||
@@ -425,7 +425,7 @@ static int stv0297_sleep(struct dvb_frontend *fe) | |||
425 | 425 | ||
426 | static int stv0297_read_status(struct dvb_frontend *fe, fe_status_t * status) | 426 | static int stv0297_read_status(struct dvb_frontend *fe, fe_status_t * status) |
427 | { | 427 | { |
428 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 428 | struct stv0297_state *state = fe->demodulator_priv; |
429 | 429 | ||
430 | u8 sync = stv0297_readreg(state, 0xDF); | 430 | u8 sync = stv0297_readreg(state, 0xDF); |
431 | 431 | ||
@@ -438,7 +438,7 @@ static int stv0297_read_status(struct dvb_frontend *fe, fe_status_t * status) | |||
438 | 438 | ||
439 | static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber) | 439 | static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber) |
440 | { | 440 | { |
441 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 441 | struct stv0297_state *state = fe->demodulator_priv; |
442 | u8 BER[3]; | 442 | u8 BER[3]; |
443 | 443 | ||
444 | stv0297_writereg(state, 0xA0, 0x80); // Start Counting bit errors for 4096 Bytes | 444 | stv0297_writereg(state, 0xA0, 0x80); // Start Counting bit errors for 4096 Bytes |
@@ -453,7 +453,7 @@ static int stv0297_read_ber(struct dvb_frontend *fe, u32 * ber) | |||
453 | 453 | ||
454 | static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength) | 454 | static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength) |
455 | { | 455 | { |
456 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 456 | struct stv0297_state *state = fe->demodulator_priv; |
457 | u8 STRENGTH[2]; | 457 | u8 STRENGTH[2]; |
458 | 458 | ||
459 | stv0297_readregs(state, 0x41, STRENGTH, 2); | 459 | stv0297_readregs(state, 0x41, STRENGTH, 2); |
@@ -464,7 +464,7 @@ static int stv0297_read_signal_strength(struct dvb_frontend *fe, u16 * strength) | |||
464 | 464 | ||
465 | static int stv0297_read_snr(struct dvb_frontend *fe, u16 * snr) | 465 | static int stv0297_read_snr(struct dvb_frontend *fe, u16 * snr) |
466 | { | 466 | { |
467 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 467 | struct stv0297_state *state = fe->demodulator_priv; |
468 | u8 SNR[2]; | 468 | u8 SNR[2]; |
469 | 469 | ||
470 | stv0297_readregs(state, 0x07, SNR, 2); | 470 | stv0297_readregs(state, 0x07, SNR, 2); |
@@ -475,7 +475,7 @@ static int stv0297_read_snr(struct dvb_frontend *fe, u16 * snr) | |||
475 | 475 | ||
476 | static int stv0297_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks) | 476 | static int stv0297_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks) |
477 | { | 477 | { |
478 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 478 | struct stv0297_state *state = fe->demodulator_priv; |
479 | 479 | ||
480 | *ucblocks = (stv0297_readreg(state, 0xD5) << 8) | 480 | *ucblocks = (stv0297_readreg(state, 0xD5) << 8) |
481 | | stv0297_readreg(state, 0xD4); | 481 | | stv0297_readreg(state, 0xD4); |
@@ -485,7 +485,7 @@ static int stv0297_read_ucblocks(struct dvb_frontend *fe, u32 * ucblocks) | |||
485 | 485 | ||
486 | static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) | 486 | static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) |
487 | { | 487 | { |
488 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 488 | struct stv0297_state *state = fe->demodulator_priv; |
489 | int u_threshold; | 489 | int u_threshold; |
490 | int initial_u; | 490 | int initial_u; |
491 | int blind_u; | 491 | int blind_u; |
@@ -689,7 +689,7 @@ timeout: | |||
689 | 689 | ||
690 | static int stv0297_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) | 690 | static int stv0297_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_parameters *p) |
691 | { | 691 | { |
692 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 692 | struct stv0297_state *state = fe->demodulator_priv; |
693 | int reg_00, reg_83; | 693 | int reg_00, reg_83; |
694 | 694 | ||
695 | reg_00 = stv0297_readreg(state, 0x00); | 695 | reg_00 = stv0297_readreg(state, 0x00); |
@@ -725,7 +725,7 @@ static int stv0297_get_frontend(struct dvb_frontend *fe, struct dvb_frontend_par | |||
725 | 725 | ||
726 | static void stv0297_release(struct dvb_frontend *fe) | 726 | static void stv0297_release(struct dvb_frontend *fe) |
727 | { | 727 | { |
728 | struct stv0297_state *state = (struct stv0297_state *) fe->demodulator_priv; | 728 | struct stv0297_state *state = fe->demodulator_priv; |
729 | kfree(state); | 729 | kfree(state); |
730 | } | 730 | } |
731 | 731 | ||
@@ -737,7 +737,7 @@ struct dvb_frontend *stv0297_attach(const struct stv0297_config *config, | |||
737 | struct stv0297_state *state = NULL; | 737 | struct stv0297_state *state = NULL; |
738 | 738 | ||
739 | /* allocate memory for the internal state */ | 739 | /* allocate memory for the internal state */ |
740 | state = (struct stv0297_state *) kmalloc(sizeof(struct stv0297_state), GFP_KERNEL); | 740 | state = kmalloc(sizeof(struct stv0297_state), GFP_KERNEL); |
741 | if (state == NULL) | 741 | if (state == NULL) |
742 | goto error; | 742 | goto error; |
743 | 743 | ||
diff --git a/drivers/media/dvb/frontends/stv0299.c b/drivers/media/dvb/frontends/stv0299.c index a47cd2b32d60..cfa3928bb487 100644 --- a/drivers/media/dvb/frontends/stv0299.c +++ b/drivers/media/dvb/frontends/stv0299.c | |||
@@ -94,7 +94,7 @@ static int stv0299_writeregI (struct stv0299_state* state, u8 reg, u8 data) | |||
94 | 94 | ||
95 | int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data) | 95 | int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data) |
96 | { | 96 | { |
97 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 97 | struct stv0299_state* state = fe->demodulator_priv; |
98 | 98 | ||
99 | return stv0299_writeregI(state, reg, data); | 99 | return stv0299_writeregI(state, reg, data); |
100 | } | 100 | } |
@@ -219,7 +219,7 @@ static int stv0299_wait_diseqc_idle (struct stv0299_state* state, int timeout) | |||
219 | 219 | ||
220 | static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) | 220 | static int stv0299_set_symbolrate (struct dvb_frontend* fe, u32 srate) |
221 | { | 221 | { |
222 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 222 | struct stv0299_state* state = fe->demodulator_priv; |
223 | u64 big = srate; | 223 | u64 big = srate; |
224 | u32 ratio; | 224 | u32 ratio; |
225 | 225 | ||
@@ -270,7 +270,7 @@ static int stv0299_get_symbolrate (struct stv0299_state* state) | |||
270 | static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, | 270 | static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, |
271 | struct dvb_diseqc_master_cmd *m) | 271 | struct dvb_diseqc_master_cmd *m) |
272 | { | 272 | { |
273 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 273 | struct stv0299_state* state = fe->demodulator_priv; |
274 | u8 val; | 274 | u8 val; |
275 | int i; | 275 | int i; |
276 | 276 | ||
@@ -300,7 +300,7 @@ static int stv0299_send_diseqc_msg (struct dvb_frontend* fe, | |||
300 | 300 | ||
301 | static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) | 301 | static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) |
302 | { | 302 | { |
303 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 303 | struct stv0299_state* state = fe->demodulator_priv; |
304 | u8 val; | 304 | u8 val; |
305 | 305 | ||
306 | dprintk ("%s\n", __FUNCTION__); | 306 | dprintk ("%s\n", __FUNCTION__); |
@@ -327,7 +327,7 @@ static int stv0299_send_diseqc_burst (struct dvb_frontend* fe, fe_sec_mini_cmd_t | |||
327 | 327 | ||
328 | static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | 328 | static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) |
329 | { | 329 | { |
330 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 330 | struct stv0299_state* state = fe->demodulator_priv; |
331 | u8 val; | 331 | u8 val; |
332 | 332 | ||
333 | if (stv0299_wait_diseqc_idle (state, 100) < 0) | 333 | if (stv0299_wait_diseqc_idle (state, 100) < 0) |
@@ -349,7 +349,7 @@ static int stv0299_set_tone (struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | |||
349 | 349 | ||
350 | static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) | 350 | static int stv0299_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) |
351 | { | 351 | { |
352 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 352 | struct stv0299_state* state = fe->demodulator_priv; |
353 | u8 reg0x08; | 353 | u8 reg0x08; |
354 | u8 reg0x0c; | 354 | u8 reg0x0c; |
355 | 355 | ||
@@ -471,7 +471,7 @@ static int stv0299_send_legacy_dish_cmd (struct dvb_frontend* fe, u32 cmd) | |||
471 | 471 | ||
472 | static int stv0299_init (struct dvb_frontend* fe) | 472 | static int stv0299_init (struct dvb_frontend* fe) |
473 | { | 473 | { |
474 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 474 | struct stv0299_state* state = fe->demodulator_priv; |
475 | int i; | 475 | int i; |
476 | 476 | ||
477 | dprintk("stv0299: init chip\n"); | 477 | dprintk("stv0299: init chip\n"); |
@@ -490,7 +490,7 @@ static int stv0299_init (struct dvb_frontend* fe) | |||
490 | 490 | ||
491 | static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) | 491 | static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) |
492 | { | 492 | { |
493 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 493 | struct stv0299_state* state = fe->demodulator_priv; |
494 | 494 | ||
495 | u8 signal = 0xff - stv0299_readreg (state, 0x18); | 495 | u8 signal = 0xff - stv0299_readreg (state, 0x18); |
496 | u8 sync = stv0299_readreg (state, 0x1b); | 496 | u8 sync = stv0299_readreg (state, 0x1b); |
@@ -518,7 +518,7 @@ static int stv0299_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
518 | 518 | ||
519 | static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) | 519 | static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) |
520 | { | 520 | { |
521 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 521 | struct stv0299_state* state = fe->demodulator_priv; |
522 | 522 | ||
523 | if (state->errmode != STATUS_BER) return 0; | 523 | if (state->errmode != STATUS_BER) return 0; |
524 | *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); | 524 | *ber = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); |
@@ -528,7 +528,7 @@ static int stv0299_read_ber(struct dvb_frontend* fe, u32* ber) | |||
528 | 528 | ||
529 | static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 529 | static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
530 | { | 530 | { |
531 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 531 | struct stv0299_state* state = fe->demodulator_priv; |
532 | 532 | ||
533 | s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8) | 533 | s32 signal = 0xffff - ((stv0299_readreg (state, 0x18) << 8) |
534 | | stv0299_readreg (state, 0x19)); | 534 | | stv0299_readreg (state, 0x19)); |
@@ -545,7 +545,7 @@ static int stv0299_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
545 | 545 | ||
546 | static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) | 546 | static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) |
547 | { | 547 | { |
548 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 548 | struct stv0299_state* state = fe->demodulator_priv; |
549 | 549 | ||
550 | s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8) | 550 | s32 xsnr = 0xffff - ((stv0299_readreg (state, 0x24) << 8) |
551 | | stv0299_readreg (state, 0x25)); | 551 | | stv0299_readreg (state, 0x25)); |
@@ -557,7 +557,7 @@ static int stv0299_read_snr(struct dvb_frontend* fe, u16* snr) | |||
557 | 557 | ||
558 | static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 558 | static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
559 | { | 559 | { |
560 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 560 | struct stv0299_state* state = fe->demodulator_priv; |
561 | 561 | ||
562 | if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; | 562 | if (state->errmode != STATUS_UCBLOCKS) *ucblocks = 0; |
563 | else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); | 563 | else *ucblocks = (stv0299_readreg (state, 0x1d) << 8) | stv0299_readreg (state, 0x1e); |
@@ -567,7 +567,7 @@ static int stv0299_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
567 | 567 | ||
568 | static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) | 568 | static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) |
569 | { | 569 | { |
570 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 570 | struct stv0299_state* state = fe->demodulator_priv; |
571 | int invval = 0; | 571 | int invval = 0; |
572 | 572 | ||
573 | dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__); | 573 | dprintk ("%s : FE_SET_FRONTEND\n", __FUNCTION__); |
@@ -635,7 +635,7 @@ static int stv0299_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
635 | 635 | ||
636 | static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) | 636 | static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters * p) |
637 | { | 637 | { |
638 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 638 | struct stv0299_state* state = fe->demodulator_priv; |
639 | s32 derot_freq; | 639 | s32 derot_freq; |
640 | int invval; | 640 | int invval; |
641 | 641 | ||
@@ -660,7 +660,7 @@ static int stv0299_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
660 | 660 | ||
661 | static int stv0299_sleep(struct dvb_frontend* fe) | 661 | static int stv0299_sleep(struct dvb_frontend* fe) |
662 | { | 662 | { |
663 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 663 | struct stv0299_state* state = fe->demodulator_priv; |
664 | 664 | ||
665 | stv0299_writeregI(state, 0x02, 0x80); | 665 | stv0299_writeregI(state, 0x02, 0x80); |
666 | state->initialised = 0; | 666 | state->initialised = 0; |
@@ -670,7 +670,7 @@ static int stv0299_sleep(struct dvb_frontend* fe) | |||
670 | 670 | ||
671 | static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) | 671 | static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* fesettings) |
672 | { | 672 | { |
673 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 673 | struct stv0299_state* state = fe->demodulator_priv; |
674 | 674 | ||
675 | fesettings->min_delay_ms = state->config->min_delay_ms; | 675 | fesettings->min_delay_ms = state->config->min_delay_ms; |
676 | if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) { | 676 | if (fesettings->parameters.u.qpsk.symbol_rate < 10000000) { |
@@ -685,7 +685,7 @@ static int stv0299_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronten | |||
685 | 685 | ||
686 | static void stv0299_release(struct dvb_frontend* fe) | 686 | static void stv0299_release(struct dvb_frontend* fe) |
687 | { | 687 | { |
688 | struct stv0299_state* state = (struct stv0299_state*) fe->demodulator_priv; | 688 | struct stv0299_state* state = fe->demodulator_priv; |
689 | kfree(state); | 689 | kfree(state); |
690 | } | 690 | } |
691 | 691 | ||
@@ -698,7 +698,7 @@ struct dvb_frontend* stv0299_attach(const struct stv0299_config* config, | |||
698 | int id; | 698 | int id; |
699 | 699 | ||
700 | /* allocate memory for the internal state */ | 700 | /* allocate memory for the internal state */ |
701 | state = (struct stv0299_state*) kmalloc(sizeof(struct stv0299_state), GFP_KERNEL); | 701 | state = kmalloc(sizeof(struct stv0299_state), GFP_KERNEL); |
702 | if (state == NULL) goto error; | 702 | if (state == NULL) goto error; |
703 | 703 | ||
704 | /* setup the state */ | 704 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/tda10021.c b/drivers/media/dvb/frontends/tda10021.c index 4e40d95ee95d..87d5f4d8790f 100644 --- a/drivers/media/dvb/frontends/tda10021.c +++ b/drivers/media/dvb/frontends/tda10021.c | |||
@@ -205,7 +205,7 @@ static int tda10021_set_symbolrate (struct tda10021_state* state, u32 symbolrate | |||
205 | 205 | ||
206 | static int tda10021_init (struct dvb_frontend *fe) | 206 | static int tda10021_init (struct dvb_frontend *fe) |
207 | { | 207 | { |
208 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 208 | struct tda10021_state* state = fe->demodulator_priv; |
209 | int i; | 209 | int i; |
210 | 210 | ||
211 | dprintk("DVB: TDA10021(%d): init chip\n", fe->adapter->num); | 211 | dprintk("DVB: TDA10021(%d): init chip\n", fe->adapter->num); |
@@ -238,7 +238,7 @@ static int tda10021_init (struct dvb_frontend *fe) | |||
238 | static int tda10021_set_parameters (struct dvb_frontend *fe, | 238 | static int tda10021_set_parameters (struct dvb_frontend *fe, |
239 | struct dvb_frontend_parameters *p) | 239 | struct dvb_frontend_parameters *p) |
240 | { | 240 | { |
241 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 241 | struct tda10021_state* state = fe->demodulator_priv; |
242 | 242 | ||
243 | //table for QAM4-QAM256 ready QAM4 QAM16 QAM32 QAM64 QAM128 QAM256 | 243 | //table for QAM4-QAM256 ready QAM4 QAM16 QAM32 QAM64 QAM128 QAM256 |
244 | //CONF | 244 | //CONF |
@@ -278,7 +278,7 @@ static int tda10021_set_parameters (struct dvb_frontend *fe, | |||
278 | 278 | ||
279 | static int tda10021_read_status(struct dvb_frontend* fe, fe_status_t* status) | 279 | static int tda10021_read_status(struct dvb_frontend* fe, fe_status_t* status) |
280 | { | 280 | { |
281 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 281 | struct tda10021_state* state = fe->demodulator_priv; |
282 | int sync; | 282 | int sync; |
283 | 283 | ||
284 | *status = 0; | 284 | *status = 0; |
@@ -303,7 +303,7 @@ static int tda10021_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
303 | 303 | ||
304 | static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber) | 304 | static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber) |
305 | { | 305 | { |
306 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 306 | struct tda10021_state* state = fe->demodulator_priv; |
307 | 307 | ||
308 | u32 _ber = tda10021_readreg(state, 0x14) | | 308 | u32 _ber = tda10021_readreg(state, 0x14) | |
309 | (tda10021_readreg(state, 0x15) << 8) | | 309 | (tda10021_readreg(state, 0x15) << 8) | |
@@ -315,7 +315,7 @@ static int tda10021_read_ber(struct dvb_frontend* fe, u32* ber) | |||
315 | 315 | ||
316 | static int tda10021_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 316 | static int tda10021_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
317 | { | 317 | { |
318 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 318 | struct tda10021_state* state = fe->demodulator_priv; |
319 | 319 | ||
320 | u8 gain = tda10021_readreg(state, 0x17); | 320 | u8 gain = tda10021_readreg(state, 0x17); |
321 | *strength = (gain << 8) | gain; | 321 | *strength = (gain << 8) | gain; |
@@ -325,7 +325,7 @@ static int tda10021_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
325 | 325 | ||
326 | static int tda10021_read_snr(struct dvb_frontend* fe, u16* snr) | 326 | static int tda10021_read_snr(struct dvb_frontend* fe, u16* snr) |
327 | { | 327 | { |
328 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 328 | struct tda10021_state* state = fe->demodulator_priv; |
329 | 329 | ||
330 | u8 quality = ~tda10021_readreg(state, 0x18); | 330 | u8 quality = ~tda10021_readreg(state, 0x18); |
331 | *snr = (quality << 8) | quality; | 331 | *snr = (quality << 8) | quality; |
@@ -335,7 +335,7 @@ static int tda10021_read_snr(struct dvb_frontend* fe, u16* snr) | |||
335 | 335 | ||
336 | static int tda10021_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 336 | static int tda10021_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
337 | { | 337 | { |
338 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 338 | struct tda10021_state* state = fe->demodulator_priv; |
339 | 339 | ||
340 | *ucblocks = tda10021_readreg (state, 0x13) & 0x7f; | 340 | *ucblocks = tda10021_readreg (state, 0x13) & 0x7f; |
341 | if (*ucblocks == 0x7f) | 341 | if (*ucblocks == 0x7f) |
@@ -350,7 +350,7 @@ static int tda10021_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
350 | 350 | ||
351 | static int tda10021_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 351 | static int tda10021_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
352 | { | 352 | { |
353 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 353 | struct tda10021_state* state = fe->demodulator_priv; |
354 | int sync; | 354 | int sync; |
355 | s8 afc = 0; | 355 | s8 afc = 0; |
356 | 356 | ||
@@ -378,7 +378,7 @@ static int tda10021_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
378 | 378 | ||
379 | static int tda10021_sleep(struct dvb_frontend* fe) | 379 | static int tda10021_sleep(struct dvb_frontend* fe) |
380 | { | 380 | { |
381 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 381 | struct tda10021_state* state = fe->demodulator_priv; |
382 | 382 | ||
383 | tda10021_writereg (state, 0x1b, 0x02); /* pdown ADC */ | 383 | tda10021_writereg (state, 0x1b, 0x02); /* pdown ADC */ |
384 | tda10021_writereg (state, 0x00, 0x80); /* standby */ | 384 | tda10021_writereg (state, 0x00, 0x80); /* standby */ |
@@ -388,7 +388,7 @@ static int tda10021_sleep(struct dvb_frontend* fe) | |||
388 | 388 | ||
389 | static void tda10021_release(struct dvb_frontend* fe) | 389 | static void tda10021_release(struct dvb_frontend* fe) |
390 | { | 390 | { |
391 | struct tda10021_state* state = (struct tda10021_state*) fe->demodulator_priv; | 391 | struct tda10021_state* state = fe->demodulator_priv; |
392 | kfree(state); | 392 | kfree(state); |
393 | } | 393 | } |
394 | 394 | ||
@@ -401,7 +401,7 @@ struct dvb_frontend* tda10021_attach(const struct tda10021_config* config, | |||
401 | struct tda10021_state* state = NULL; | 401 | struct tda10021_state* state = NULL; |
402 | 402 | ||
403 | /* allocate memory for the internal state */ | 403 | /* allocate memory for the internal state */ |
404 | state = (struct tda10021_state*) kmalloc(sizeof(struct tda10021_state), GFP_KERNEL); | 404 | state = kmalloc(sizeof(struct tda10021_state), GFP_KERNEL); |
405 | if (state == NULL) goto error; | 405 | if (state == NULL) goto error; |
406 | 406 | ||
407 | /* setup the state */ | 407 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/tda8083.c b/drivers/media/dvb/frontends/tda8083.c index da82e90d6d13..168e013d23bd 100644 --- a/drivers/media/dvb/frontends/tda8083.c +++ b/drivers/media/dvb/frontends/tda8083.c | |||
@@ -226,7 +226,7 @@ static int tda8083_send_diseqc_burst (struct tda8083_state* state, fe_sec_mini_c | |||
226 | static int tda8083_send_diseqc_msg (struct dvb_frontend* fe, | 226 | static int tda8083_send_diseqc_msg (struct dvb_frontend* fe, |
227 | struct dvb_diseqc_master_cmd *m) | 227 | struct dvb_diseqc_master_cmd *m) |
228 | { | 228 | { |
229 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 229 | struct tda8083_state* state = fe->demodulator_priv; |
230 | int i; | 230 | int i; |
231 | 231 | ||
232 | tda8083_writereg (state, 0x29, (m->msg_len - 3) | (1 << 2)); /* enable */ | 232 | tda8083_writereg (state, 0x29, (m->msg_len - 3) | (1 << 2)); /* enable */ |
@@ -243,7 +243,7 @@ static int tda8083_send_diseqc_msg (struct dvb_frontend* fe, | |||
243 | 243 | ||
244 | static int tda8083_read_status(struct dvb_frontend* fe, fe_status_t* status) | 244 | static int tda8083_read_status(struct dvb_frontend* fe, fe_status_t* status) |
245 | { | 245 | { |
246 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 246 | struct tda8083_state* state = fe->demodulator_priv; |
247 | 247 | ||
248 | u8 signal = ~tda8083_readreg (state, 0x01); | 248 | u8 signal = ~tda8083_readreg (state, 0x01); |
249 | u8 sync = tda8083_readreg (state, 0x02); | 249 | u8 sync = tda8083_readreg (state, 0x02); |
@@ -270,7 +270,7 @@ static int tda8083_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
270 | 270 | ||
271 | static int tda8083_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 271 | static int tda8083_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
272 | { | 272 | { |
273 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 273 | struct tda8083_state* state = fe->demodulator_priv; |
274 | 274 | ||
275 | u8 signal = ~tda8083_readreg (state, 0x01); | 275 | u8 signal = ~tda8083_readreg (state, 0x01); |
276 | *strength = (signal << 8) | signal; | 276 | *strength = (signal << 8) | signal; |
@@ -280,7 +280,7 @@ static int tda8083_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
280 | 280 | ||
281 | static int tda8083_read_snr(struct dvb_frontend* fe, u16* snr) | 281 | static int tda8083_read_snr(struct dvb_frontend* fe, u16* snr) |
282 | { | 282 | { |
283 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 283 | struct tda8083_state* state = fe->demodulator_priv; |
284 | 284 | ||
285 | u8 _snr = tda8083_readreg (state, 0x08); | 285 | u8 _snr = tda8083_readreg (state, 0x08); |
286 | *snr = (_snr << 8) | _snr; | 286 | *snr = (_snr << 8) | _snr; |
@@ -290,7 +290,7 @@ static int tda8083_read_snr(struct dvb_frontend* fe, u16* snr) | |||
290 | 290 | ||
291 | static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 291 | static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
292 | { | 292 | { |
293 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 293 | struct tda8083_state* state = fe->demodulator_priv; |
294 | 294 | ||
295 | state->config->pll_set(fe, p); | 295 | state->config->pll_set(fe, p); |
296 | tda8083_set_inversion (state, p->inversion); | 296 | tda8083_set_inversion (state, p->inversion); |
@@ -305,7 +305,7 @@ static int tda8083_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
305 | 305 | ||
306 | static int tda8083_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 306 | static int tda8083_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
307 | { | 307 | { |
308 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 308 | struct tda8083_state* state = fe->demodulator_priv; |
309 | 309 | ||
310 | /* FIXME: get symbolrate & frequency offset...*/ | 310 | /* FIXME: get symbolrate & frequency offset...*/ |
311 | /*p->frequency = ???;*/ | 311 | /*p->frequency = ???;*/ |
@@ -319,7 +319,7 @@ static int tda8083_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
319 | 319 | ||
320 | static int tda8083_sleep(struct dvb_frontend* fe) | 320 | static int tda8083_sleep(struct dvb_frontend* fe) |
321 | { | 321 | { |
322 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 322 | struct tda8083_state* state = fe->demodulator_priv; |
323 | 323 | ||
324 | tda8083_writereg (state, 0x00, 0x02); | 324 | tda8083_writereg (state, 0x00, 0x02); |
325 | return 0; | 325 | return 0; |
@@ -327,7 +327,7 @@ static int tda8083_sleep(struct dvb_frontend* fe) | |||
327 | 327 | ||
328 | static int tda8083_init(struct dvb_frontend* fe) | 328 | static int tda8083_init(struct dvb_frontend* fe) |
329 | { | 329 | { |
330 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 330 | struct tda8083_state* state = fe->demodulator_priv; |
331 | int i; | 331 | int i; |
332 | 332 | ||
333 | for (i=0; i<44; i++) | 333 | for (i=0; i<44; i++) |
@@ -343,7 +343,7 @@ static int tda8083_init(struct dvb_frontend* fe) | |||
343 | 343 | ||
344 | static int tda8083_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) | 344 | static int tda8083_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) |
345 | { | 345 | { |
346 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 346 | struct tda8083_state* state = fe->demodulator_priv; |
347 | 347 | ||
348 | tda8083_send_diseqc_burst (state, burst); | 348 | tda8083_send_diseqc_burst (state, burst); |
349 | tda8083_writereg (state, 0x00, 0x3c); | 349 | tda8083_writereg (state, 0x00, 0x3c); |
@@ -354,7 +354,7 @@ static int tda8083_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t | |||
354 | 354 | ||
355 | static int tda8083_diseqc_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | 355 | static int tda8083_diseqc_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) |
356 | { | 356 | { |
357 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 357 | struct tda8083_state* state = fe->demodulator_priv; |
358 | 358 | ||
359 | tda8083_set_tone (state, tone); | 359 | tda8083_set_tone (state, tone); |
360 | tda8083_writereg (state, 0x00, 0x3c); | 360 | tda8083_writereg (state, 0x00, 0x3c); |
@@ -365,7 +365,7 @@ static int tda8083_diseqc_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t t | |||
365 | 365 | ||
366 | static int tda8083_diseqc_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) | 366 | static int tda8083_diseqc_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) |
367 | { | 367 | { |
368 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 368 | struct tda8083_state* state = fe->demodulator_priv; |
369 | 369 | ||
370 | tda8083_set_voltage (state, voltage); | 370 | tda8083_set_voltage (state, voltage); |
371 | tda8083_writereg (state, 0x00, 0x3c); | 371 | tda8083_writereg (state, 0x00, 0x3c); |
@@ -376,7 +376,7 @@ static int tda8083_diseqc_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t | |||
376 | 376 | ||
377 | static void tda8083_release(struct dvb_frontend* fe) | 377 | static void tda8083_release(struct dvb_frontend* fe) |
378 | { | 378 | { |
379 | struct tda8083_state* state = (struct tda8083_state*) fe->demodulator_priv; | 379 | struct tda8083_state* state = fe->demodulator_priv; |
380 | kfree(state); | 380 | kfree(state); |
381 | } | 381 | } |
382 | 382 | ||
@@ -388,7 +388,7 @@ struct dvb_frontend* tda8083_attach(const struct tda8083_config* config, | |||
388 | struct tda8083_state* state = NULL; | 388 | struct tda8083_state* state = NULL; |
389 | 389 | ||
390 | /* allocate memory for the internal state */ | 390 | /* allocate memory for the internal state */ |
391 | state = (struct tda8083_state*) kmalloc(sizeof(struct tda8083_state), GFP_KERNEL); | 391 | state = kmalloc(sizeof(struct tda8083_state), GFP_KERNEL); |
392 | if (state == NULL) goto error; | 392 | if (state == NULL) goto error; |
393 | 393 | ||
394 | /* setup the state */ | 394 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/tda80xx.c b/drivers/media/dvb/frontends/tda80xx.c index c99632114283..00c145521f4f 100644 --- a/drivers/media/dvb/frontends/tda80xx.c +++ b/drivers/media/dvb/frontends/tda80xx.c | |||
@@ -400,7 +400,7 @@ static void tda80xx_wait_diseqc_fifo(struct tda80xx_state* state) | |||
400 | 400 | ||
401 | static int tda8044_init(struct dvb_frontend* fe) | 401 | static int tda8044_init(struct dvb_frontend* fe) |
402 | { | 402 | { |
403 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 403 | struct tda80xx_state* state = fe->demodulator_priv; |
404 | int ret; | 404 | int ret; |
405 | 405 | ||
406 | /* | 406 | /* |
@@ -432,7 +432,7 @@ static int tda8044_init(struct dvb_frontend* fe) | |||
432 | 432 | ||
433 | static int tda8083_init(struct dvb_frontend* fe) | 433 | static int tda8083_init(struct dvb_frontend* fe) |
434 | { | 434 | { |
435 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 435 | struct tda80xx_state* state = fe->demodulator_priv; |
436 | 436 | ||
437 | tda80xx_write(state, 0x00, tda8083_inittab, sizeof(tda8083_inittab)); | 437 | tda80xx_write(state, 0x00, tda8083_inittab, sizeof(tda8083_inittab)); |
438 | 438 | ||
@@ -447,7 +447,7 @@ static int tda8083_init(struct dvb_frontend* fe) | |||
447 | 447 | ||
448 | static int tda80xx_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) | 448 | static int tda80xx_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage) |
449 | { | 449 | { |
450 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 450 | struct tda80xx_state* state = fe->demodulator_priv; |
451 | 451 | ||
452 | switch (voltage) { | 452 | switch (voltage) { |
453 | case SEC_VOLTAGE_13: | 453 | case SEC_VOLTAGE_13: |
@@ -463,7 +463,7 @@ static int tda80xx_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage | |||
463 | 463 | ||
464 | static int tda80xx_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | 464 | static int tda80xx_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) |
465 | { | 465 | { |
466 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 466 | struct tda80xx_state* state = fe->demodulator_priv; |
467 | 467 | ||
468 | switch (tone) { | 468 | switch (tone) { |
469 | case SEC_TONE_OFF: | 469 | case SEC_TONE_OFF: |
@@ -477,7 +477,7 @@ static int tda80xx_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | |||
477 | 477 | ||
478 | static int tda80xx_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) | 478 | static int tda80xx_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) |
479 | { | 479 | { |
480 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 480 | struct tda80xx_state* state = fe->demodulator_priv; |
481 | 481 | ||
482 | if (cmd->msg_len > 6) | 482 | if (cmd->msg_len > 6) |
483 | return -EINVAL; | 483 | return -EINVAL; |
@@ -492,7 +492,7 @@ static int tda80xx_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_ma | |||
492 | 492 | ||
493 | static int tda80xx_send_diseqc_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t cmd) | 493 | static int tda80xx_send_diseqc_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t cmd) |
494 | { | 494 | { |
495 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 495 | struct tda80xx_state* state = fe->demodulator_priv; |
496 | 496 | ||
497 | switch (cmd) { | 497 | switch (cmd) { |
498 | case SEC_MINI_A: | 498 | case SEC_MINI_A: |
@@ -512,7 +512,7 @@ static int tda80xx_send_diseqc_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t | |||
512 | 512 | ||
513 | static int tda80xx_sleep(struct dvb_frontend* fe) | 513 | static int tda80xx_sleep(struct dvb_frontend* fe) |
514 | { | 514 | { |
515 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 515 | struct tda80xx_state* state = fe->demodulator_priv; |
516 | 516 | ||
517 | tda80xx_writereg(state, 0x00, 0x02); /* enter standby */ | 517 | tda80xx_writereg(state, 0x00, 0x02); /* enter standby */ |
518 | 518 | ||
@@ -521,7 +521,7 @@ static int tda80xx_sleep(struct dvb_frontend* fe) | |||
521 | 521 | ||
522 | static int tda80xx_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 522 | static int tda80xx_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
523 | { | 523 | { |
524 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 524 | struct tda80xx_state* state = fe->demodulator_priv; |
525 | 525 | ||
526 | tda80xx_writereg(state, 0x1c, 0x80); | 526 | tda80xx_writereg(state, 0x1c, 0x80); |
527 | state->config->pll_set(fe, p); | 527 | state->config->pll_set(fe, p); |
@@ -537,7 +537,7 @@ static int tda80xx_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
537 | 537 | ||
538 | static int tda80xx_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 538 | static int tda80xx_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
539 | { | 539 | { |
540 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 540 | struct tda80xx_state* state = fe->demodulator_priv; |
541 | 541 | ||
542 | if (!state->config->irq) | 542 | if (!state->config->irq) |
543 | tda80xx_read_status_int(state); | 543 | tda80xx_read_status_int(state); |
@@ -550,7 +550,7 @@ static int tda80xx_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
550 | 550 | ||
551 | static int tda80xx_read_status(struct dvb_frontend* fe, fe_status_t* status) | 551 | static int tda80xx_read_status(struct dvb_frontend* fe, fe_status_t* status) |
552 | { | 552 | { |
553 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 553 | struct tda80xx_state* state = fe->demodulator_priv; |
554 | 554 | ||
555 | if (!state->config->irq) | 555 | if (!state->config->irq) |
556 | tda80xx_read_status_int(state); | 556 | tda80xx_read_status_int(state); |
@@ -561,7 +561,7 @@ static int tda80xx_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
561 | 561 | ||
562 | static int tda80xx_read_ber(struct dvb_frontend* fe, u32* ber) | 562 | static int tda80xx_read_ber(struct dvb_frontend* fe, u32* ber) |
563 | { | 563 | { |
564 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 564 | struct tda80xx_state* state = fe->demodulator_priv; |
565 | int ret; | 565 | int ret; |
566 | u8 buf[3]; | 566 | u8 buf[3]; |
567 | 567 | ||
@@ -575,7 +575,7 @@ static int tda80xx_read_ber(struct dvb_frontend* fe, u32* ber) | |||
575 | 575 | ||
576 | static int tda80xx_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 576 | static int tda80xx_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
577 | { | 577 | { |
578 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 578 | struct tda80xx_state* state = fe->demodulator_priv; |
579 | 579 | ||
580 | u8 gain = ~tda80xx_readreg(state, 0x01); | 580 | u8 gain = ~tda80xx_readreg(state, 0x01); |
581 | *strength = (gain << 8) | gain; | 581 | *strength = (gain << 8) | gain; |
@@ -585,7 +585,7 @@ static int tda80xx_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
585 | 585 | ||
586 | static int tda80xx_read_snr(struct dvb_frontend* fe, u16* snr) | 586 | static int tda80xx_read_snr(struct dvb_frontend* fe, u16* snr) |
587 | { | 587 | { |
588 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 588 | struct tda80xx_state* state = fe->demodulator_priv; |
589 | 589 | ||
590 | u8 quality = tda80xx_readreg(state, 0x08); | 590 | u8 quality = tda80xx_readreg(state, 0x08); |
591 | *snr = (quality << 8) | quality; | 591 | *snr = (quality << 8) | quality; |
@@ -595,7 +595,7 @@ static int tda80xx_read_snr(struct dvb_frontend* fe, u16* snr) | |||
595 | 595 | ||
596 | static int tda80xx_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 596 | static int tda80xx_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
597 | { | 597 | { |
598 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 598 | struct tda80xx_state* state = fe->demodulator_priv; |
599 | 599 | ||
600 | *ucblocks = tda80xx_readreg(state, 0x0f); | 600 | *ucblocks = tda80xx_readreg(state, 0x0f); |
601 | if (*ucblocks == 0xff) | 601 | if (*ucblocks == 0xff) |
@@ -606,7 +606,7 @@ static int tda80xx_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
606 | 606 | ||
607 | static int tda80xx_init(struct dvb_frontend* fe) | 607 | static int tda80xx_init(struct dvb_frontend* fe) |
608 | { | 608 | { |
609 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 609 | struct tda80xx_state* state = fe->demodulator_priv; |
610 | 610 | ||
611 | switch(state->id) { | 611 | switch(state->id) { |
612 | case ID_TDA8044: | 612 | case ID_TDA8044: |
@@ -620,7 +620,7 @@ static int tda80xx_init(struct dvb_frontend* fe) | |||
620 | 620 | ||
621 | static void tda80xx_release(struct dvb_frontend* fe) | 621 | static void tda80xx_release(struct dvb_frontend* fe) |
622 | { | 622 | { |
623 | struct tda80xx_state* state = (struct tda80xx_state*) fe->demodulator_priv; | 623 | struct tda80xx_state* state = fe->demodulator_priv; |
624 | 624 | ||
625 | if (state->config->irq) | 625 | if (state->config->irq) |
626 | free_irq(state->config->irq, &state->worklet); | 626 | free_irq(state->config->irq, &state->worklet); |
@@ -637,7 +637,7 @@ struct dvb_frontend* tda80xx_attach(const struct tda80xx_config* config, | |||
637 | int ret; | 637 | int ret; |
638 | 638 | ||
639 | /* allocate memory for the internal state */ | 639 | /* allocate memory for the internal state */ |
640 | state = (struct tda80xx_state*) kmalloc(sizeof(struct tda80xx_state), GFP_KERNEL); | 640 | state = kmalloc(sizeof(struct tda80xx_state), GFP_KERNEL); |
641 | if (state == NULL) goto error; | 641 | if (state == NULL) goto error; |
642 | 642 | ||
643 | /* setup the state */ | 643 | /* setup the state */ |
diff --git a/drivers/media/dvb/frontends/ves1820.c b/drivers/media/dvb/frontends/ves1820.c index 9c0d23e1d9e5..05dc1cdf6d55 100644 --- a/drivers/media/dvb/frontends/ves1820.c +++ b/drivers/media/dvb/frontends/ves1820.c | |||
@@ -193,7 +193,7 @@ static int ves1820_set_symbolrate(struct ves1820_state *state, u32 symbolrate) | |||
193 | 193 | ||
194 | static int ves1820_init(struct dvb_frontend* fe) | 194 | static int ves1820_init(struct dvb_frontend* fe) |
195 | { | 195 | { |
196 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 196 | struct ves1820_state* state = fe->demodulator_priv; |
197 | int i; | 197 | int i; |
198 | int val; | 198 | int val; |
199 | 199 | ||
@@ -214,7 +214,7 @@ static int ves1820_init(struct dvb_frontend* fe) | |||
214 | 214 | ||
215 | static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 215 | static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
216 | { | 216 | { |
217 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 217 | struct ves1820_state* state = fe->demodulator_priv; |
218 | static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; | 218 | static const u8 reg0x00[] = { 0x00, 0x04, 0x08, 0x0c, 0x10 }; |
219 | static const u8 reg0x01[] = { 140, 140, 106, 100, 92 }; | 219 | static const u8 reg0x01[] = { 140, 140, 106, 100, 92 }; |
220 | static const u8 reg0x05[] = { 135, 100, 70, 54, 38 }; | 220 | static const u8 reg0x05[] = { 135, 100, 70, 54, 38 }; |
@@ -241,7 +241,7 @@ static int ves1820_set_parameters(struct dvb_frontend* fe, struct dvb_frontend_p | |||
241 | 241 | ||
242 | static int ves1820_read_status(struct dvb_frontend* fe, fe_status_t* status) | 242 | static int ves1820_read_status(struct dvb_frontend* fe, fe_status_t* status) |
243 | { | 243 | { |
244 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 244 | struct ves1820_state* state = fe->demodulator_priv; |
245 | int sync; | 245 | int sync; |
246 | 246 | ||
247 | *status = 0; | 247 | *status = 0; |
@@ -267,7 +267,7 @@ static int ves1820_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
267 | 267 | ||
268 | static int ves1820_read_ber(struct dvb_frontend* fe, u32* ber) | 268 | static int ves1820_read_ber(struct dvb_frontend* fe, u32* ber) |
269 | { | 269 | { |
270 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 270 | struct ves1820_state* state = fe->demodulator_priv; |
271 | 271 | ||
272 | u32 _ber = ves1820_readreg(state, 0x14) | | 272 | u32 _ber = ves1820_readreg(state, 0x14) | |
273 | (ves1820_readreg(state, 0x15) << 8) | | 273 | (ves1820_readreg(state, 0x15) << 8) | |
@@ -279,7 +279,7 @@ static int ves1820_read_ber(struct dvb_frontend* fe, u32* ber) | |||
279 | 279 | ||
280 | static int ves1820_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 280 | static int ves1820_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
281 | { | 281 | { |
282 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 282 | struct ves1820_state* state = fe->demodulator_priv; |
283 | 283 | ||
284 | u8 gain = ves1820_readreg(state, 0x17); | 284 | u8 gain = ves1820_readreg(state, 0x17); |
285 | *strength = (gain << 8) | gain; | 285 | *strength = (gain << 8) | gain; |
@@ -289,7 +289,7 @@ static int ves1820_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
289 | 289 | ||
290 | static int ves1820_read_snr(struct dvb_frontend* fe, u16* snr) | 290 | static int ves1820_read_snr(struct dvb_frontend* fe, u16* snr) |
291 | { | 291 | { |
292 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 292 | struct ves1820_state* state = fe->demodulator_priv; |
293 | 293 | ||
294 | u8 quality = ~ves1820_readreg(state, 0x18); | 294 | u8 quality = ~ves1820_readreg(state, 0x18); |
295 | *snr = (quality << 8) | quality; | 295 | *snr = (quality << 8) | quality; |
@@ -299,7 +299,7 @@ static int ves1820_read_snr(struct dvb_frontend* fe, u16* snr) | |||
299 | 299 | ||
300 | static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 300 | static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
301 | { | 301 | { |
302 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 302 | struct ves1820_state* state = fe->demodulator_priv; |
303 | 303 | ||
304 | *ucblocks = ves1820_readreg(state, 0x13) & 0x7f; | 304 | *ucblocks = ves1820_readreg(state, 0x13) & 0x7f; |
305 | if (*ucblocks == 0x7f) | 305 | if (*ucblocks == 0x7f) |
@@ -314,7 +314,7 @@ static int ves1820_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
314 | 314 | ||
315 | static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 315 | static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
316 | { | 316 | { |
317 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 317 | struct ves1820_state* state = fe->demodulator_priv; |
318 | int sync; | 318 | int sync; |
319 | s8 afc = 0; | 319 | s8 afc = 0; |
320 | 320 | ||
@@ -345,7 +345,7 @@ static int ves1820_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
345 | 345 | ||
346 | static int ves1820_sleep(struct dvb_frontend* fe) | 346 | static int ves1820_sleep(struct dvb_frontend* fe) |
347 | { | 347 | { |
348 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 348 | struct ves1820_state* state = fe->demodulator_priv; |
349 | 349 | ||
350 | ves1820_writereg(state, 0x1b, 0x02); /* pdown ADC */ | 350 | ves1820_writereg(state, 0x1b, 0x02); /* pdown ADC */ |
351 | ves1820_writereg(state, 0x00, 0x80); /* standby */ | 351 | ves1820_writereg(state, 0x00, 0x80); /* standby */ |
@@ -364,7 +364,7 @@ static int ves1820_get_tune_settings(struct dvb_frontend* fe, struct dvb_fronten | |||
364 | 364 | ||
365 | static void ves1820_release(struct dvb_frontend* fe) | 365 | static void ves1820_release(struct dvb_frontend* fe) |
366 | { | 366 | { |
367 | struct ves1820_state* state = (struct ves1820_state*) fe->demodulator_priv; | 367 | struct ves1820_state* state = fe->demodulator_priv; |
368 | kfree(state); | 368 | kfree(state); |
369 | } | 369 | } |
370 | 370 | ||
@@ -377,7 +377,7 @@ struct dvb_frontend* ves1820_attach(const struct ves1820_config* config, | |||
377 | struct ves1820_state* state = NULL; | 377 | struct ves1820_state* state = NULL; |
378 | 378 | ||
379 | /* allocate memory for the internal state */ | 379 | /* allocate memory for the internal state */ |
380 | state = (struct ves1820_state*) kmalloc(sizeof(struct ves1820_state), GFP_KERNEL); | 380 | state = kmalloc(sizeof(struct ves1820_state), GFP_KERNEL); |
381 | if (state == NULL) | 381 | if (state == NULL) |
382 | goto error; | 382 | goto error; |
383 | 383 | ||
diff --git a/drivers/media/dvb/frontends/ves1x93.c b/drivers/media/dvb/frontends/ves1x93.c index edcad283aa86..821df8e839d0 100644 --- a/drivers/media/dvb/frontends/ves1x93.c +++ b/drivers/media/dvb/frontends/ves1x93.c | |||
@@ -263,7 +263,7 @@ static int ves1x93_set_symbolrate (struct ves1x93_state* state, u32 srate) | |||
263 | 263 | ||
264 | static int ves1x93_init (struct dvb_frontend* fe) | 264 | static int ves1x93_init (struct dvb_frontend* fe) |
265 | { | 265 | { |
266 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 266 | struct ves1x93_state* state = fe->demodulator_priv; |
267 | int i; | 267 | int i; |
268 | int val; | 268 | int val; |
269 | 269 | ||
@@ -289,7 +289,7 @@ static int ves1x93_init (struct dvb_frontend* fe) | |||
289 | 289 | ||
290 | static int ves1x93_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) | 290 | static int ves1x93_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) |
291 | { | 291 | { |
292 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 292 | struct ves1x93_state* state = fe->demodulator_priv; |
293 | 293 | ||
294 | switch (voltage) { | 294 | switch (voltage) { |
295 | case SEC_VOLTAGE_13: | 295 | case SEC_VOLTAGE_13: |
@@ -305,7 +305,7 @@ static int ves1x93_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltag | |||
305 | 305 | ||
306 | static int ves1x93_read_status(struct dvb_frontend* fe, fe_status_t* status) | 306 | static int ves1x93_read_status(struct dvb_frontend* fe, fe_status_t* status) |
307 | { | 307 | { |
308 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 308 | struct ves1x93_state* state = fe->demodulator_priv; |
309 | 309 | ||
310 | u8 sync = ves1x93_readreg (state, 0x0e); | 310 | u8 sync = ves1x93_readreg (state, 0x0e); |
311 | 311 | ||
@@ -346,7 +346,7 @@ static int ves1x93_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
346 | 346 | ||
347 | static int ves1x93_read_ber(struct dvb_frontend* fe, u32* ber) | 347 | static int ves1x93_read_ber(struct dvb_frontend* fe, u32* ber) |
348 | { | 348 | { |
349 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 349 | struct ves1x93_state* state = fe->demodulator_priv; |
350 | 350 | ||
351 | *ber = ves1x93_readreg (state, 0x15); | 351 | *ber = ves1x93_readreg (state, 0x15); |
352 | *ber |= (ves1x93_readreg (state, 0x16) << 8); | 352 | *ber |= (ves1x93_readreg (state, 0x16) << 8); |
@@ -358,7 +358,7 @@ static int ves1x93_read_ber(struct dvb_frontend* fe, u32* ber) | |||
358 | 358 | ||
359 | static int ves1x93_read_signal_strength(struct dvb_frontend* fe, u16* strength) | 359 | static int ves1x93_read_signal_strength(struct dvb_frontend* fe, u16* strength) |
360 | { | 360 | { |
361 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 361 | struct ves1x93_state* state = fe->demodulator_priv; |
362 | 362 | ||
363 | u8 signal = ~ves1x93_readreg (state, 0x0b); | 363 | u8 signal = ~ves1x93_readreg (state, 0x0b); |
364 | *strength = (signal << 8) | signal; | 364 | *strength = (signal << 8) | signal; |
@@ -368,7 +368,7 @@ static int ves1x93_read_signal_strength(struct dvb_frontend* fe, u16* strength) | |||
368 | 368 | ||
369 | static int ves1x93_read_snr(struct dvb_frontend* fe, u16* snr) | 369 | static int ves1x93_read_snr(struct dvb_frontend* fe, u16* snr) |
370 | { | 370 | { |
371 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 371 | struct ves1x93_state* state = fe->demodulator_priv; |
372 | 372 | ||
373 | u8 _snr = ~ves1x93_readreg (state, 0x1c); | 373 | u8 _snr = ~ves1x93_readreg (state, 0x1c); |
374 | *snr = (_snr << 8) | _snr; | 374 | *snr = (_snr << 8) | _snr; |
@@ -378,7 +378,7 @@ static int ves1x93_read_snr(struct dvb_frontend* fe, u16* snr) | |||
378 | 378 | ||
379 | static int ves1x93_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | 379 | static int ves1x93_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) |
380 | { | 380 | { |
381 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 381 | struct ves1x93_state* state = fe->demodulator_priv; |
382 | 382 | ||
383 | *ucblocks = ves1x93_readreg (state, 0x18) & 0x7f; | 383 | *ucblocks = ves1x93_readreg (state, 0x18) & 0x7f; |
384 | 384 | ||
@@ -393,7 +393,7 @@ static int ves1x93_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
393 | 393 | ||
394 | static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 394 | static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
395 | { | 395 | { |
396 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 396 | struct ves1x93_state* state = fe->demodulator_priv; |
397 | 397 | ||
398 | ves1x93_writereg(state, 0x00, 0x11); | 398 | ves1x93_writereg(state, 0x00, 0x11); |
399 | state->config->pll_set(fe, p); | 399 | state->config->pll_set(fe, p); |
@@ -408,7 +408,7 @@ static int ves1x93_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
408 | 408 | ||
409 | static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 409 | static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
410 | { | 410 | { |
411 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 411 | struct ves1x93_state* state = fe->demodulator_priv; |
412 | int afc; | 412 | int afc; |
413 | 413 | ||
414 | afc = ((int)((char)(ves1x93_readreg (state, 0x0a) << 1)))/2; | 414 | afc = ((int)((char)(ves1x93_readreg (state, 0x0a) << 1)))/2; |
@@ -431,14 +431,14 @@ static int ves1x93_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
431 | 431 | ||
432 | static int ves1x93_sleep(struct dvb_frontend* fe) | 432 | static int ves1x93_sleep(struct dvb_frontend* fe) |
433 | { | 433 | { |
434 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 434 | struct ves1x93_state* state = fe->demodulator_priv; |
435 | 435 | ||
436 | return ves1x93_writereg (state, 0x00, 0x08); | 436 | return ves1x93_writereg (state, 0x00, 0x08); |
437 | } | 437 | } |
438 | 438 | ||
439 | static void ves1x93_release(struct dvb_frontend* fe) | 439 | static void ves1x93_release(struct dvb_frontend* fe) |
440 | { | 440 | { |
441 | struct ves1x93_state* state = (struct ves1x93_state*) fe->demodulator_priv; | 441 | struct ves1x93_state* state = fe->demodulator_priv; |
442 | kfree(state); | 442 | kfree(state); |
443 | } | 443 | } |
444 | 444 | ||
@@ -451,7 +451,7 @@ struct dvb_frontend* ves1x93_attach(const struct ves1x93_config* config, | |||
451 | u8 identity; | 451 | u8 identity; |
452 | 452 | ||
453 | /* allocate memory for the internal state */ | 453 | /* allocate memory for the internal state */ |
454 | state = (struct ves1x93_state*) kmalloc(sizeof(struct ves1x93_state), GFP_KERNEL); | 454 | state = kmalloc(sizeof(struct ves1x93_state), GFP_KERNEL); |
455 | if (state == NULL) goto error; | 455 | if (state == NULL) goto error; |
456 | 456 | ||
457 | /* setup the state */ | 457 | /* setup the state */ |