aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/cx24110.c
diff options
context:
space:
mode:
authorJohannes Stezenbach <js@linuxtv.org>2005-05-17 00:54:31 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-17 10:59:30 -0400
commitb8742700f13163ffa00cddce2a3c940b9ab2ab5a (patch)
treeff82ac83508dc63d0dec63a3479df3b966018b34 /drivers/media/dvb/frontends/cx24110.c
parent591ad98db3be2cd596ac5e0cfba7b164c3bdfb52 (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>
Diffstat (limited to 'drivers/media/dvb/frontends/cx24110.c')
-rw-r--r--drivers/media/dvb/frontends/cx24110.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/media/dvb/frontends/cx24110.c b/drivers/media/dvb/frontends/cx24110.c
index ae16112a065..8222b88cb48 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
316int cx24110_pll_write (struct dvb_frontend* fe, u32 data) 316int 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
357static int cx24110_initfe(struct dvb_frontend* fe) 357static 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
374static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage) 374static 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
388static int cx24110_diseqc_send_burst(struct dvb_frontend* fe, 388static 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
433static int cx24110_read_status(struct dvb_frontend* fe, fe_status_t* status) 432static 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
461static int cx24110_read_ber(struct dvb_frontend* fe, u32* ber) 460static 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
479static int cx24110_read_signal_strength(struct dvb_frontend* fe, u16* signal_strength) 478static 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
490static int cx24110_read_snr(struct dvb_frontend* fe, u16* snr) 489static 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
506static int cx24110_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) 505static 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
528static int cx24110_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 527static 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
541static int cx24110_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) 540static 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
568static int cx24110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) 567static 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
575static void cx24110_release(struct dvb_frontend* fe) 574static 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 */