diff options
author | Istvan Varga <istvan_v@mailbox.hu> | 2011-06-04 11:18:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 16:52:39 -0400 |
commit | e75873c1f80380f190d0270fec566410f59c4829 (patch) | |
tree | b62df93301695dc0b5eaf49b7b2177c7822d7466 /drivers/media/common | |
parent | 818a1776a45c230c4f230c8e4e2d0c7bdf5f8fa3 (diff) |
[media] xc4000: xc_tune_channel() cleanup
Minor coding changes related to the xc_tune_channel() function.
Signed-off-by: Istvan Varga <istvan_v@mailbox.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r-- | drivers/media/common/tuners/xc4000.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/media/common/tuners/xc4000.c b/drivers/media/common/tuners/xc4000.c index 52375498257c..c3e564e9f8ca 100644 --- a/drivers/media/common/tuners/xc4000.c +++ b/drivers/media/common/tuners/xc4000.c | |||
@@ -516,12 +516,10 @@ static u16 WaitForLock(struct xc4000_priv *priv) | |||
516 | return lockState; | 516 | return lockState; |
517 | } | 517 | } |
518 | 518 | ||
519 | #define XC_TUNE_ANALOG 0 | 519 | static int xc_tune_channel(struct xc4000_priv *priv, u32 freq_hz) |
520 | #define XC_TUNE_DIGITAL 1 | ||
521 | static int xc_tune_channel(struct xc4000_priv *priv, u32 freq_hz, int mode) | ||
522 | { | 520 | { |
523 | int found = 0; | 521 | int found = 1; |
524 | int result = 0; | 522 | int result; |
525 | 523 | ||
526 | dprintk(1, "%s(%u)\n", __func__, freq_hz); | 524 | dprintk(1, "%s(%u)\n", __func__, freq_hz); |
527 | 525 | ||
@@ -533,9 +531,10 @@ static int xc_tune_channel(struct xc4000_priv *priv, u32 freq_hz, int mode) | |||
533 | if (result != XC_RESULT_SUCCESS) | 531 | if (result != XC_RESULT_SUCCESS) |
534 | return 0; | 532 | return 0; |
535 | 533 | ||
536 | if (mode == XC_TUNE_ANALOG) { | 534 | /* wait for lock only in analog TV mode */ |
537 | if (WaitForLock(priv) == 1) | 535 | if ((priv->cur_fw.type & (FM | DTV6 | DTV7 | DTV78 | DTV8)) == 0) { |
538 | found = 1; | 536 | if (WaitForLock(priv) != 1) |
537 | found = 0; | ||
539 | } | 538 | } |
540 | 539 | ||
541 | /* Wait for stats to stabilize. | 540 | /* Wait for stats to stabilize. |
@@ -1269,7 +1268,7 @@ static int xc4000_set_params(struct dvb_frontend *fe, | |||
1269 | } | 1268 | } |
1270 | } | 1269 | } |
1271 | 1270 | ||
1272 | xc_tune_channel(priv, priv->freq_hz, XC_TUNE_DIGITAL); | 1271 | xc_tune_channel(priv, priv->freq_hz); |
1273 | 1272 | ||
1274 | ret = 0; | 1273 | ret = 0; |
1275 | 1274 | ||
@@ -1468,7 +1467,7 @@ tune_channel: | |||
1468 | } | 1467 | } |
1469 | } | 1468 | } |
1470 | 1469 | ||
1471 | xc_tune_channel(priv, priv->freq_hz, XC_TUNE_ANALOG); | 1470 | xc_tune_channel(priv, priv->freq_hz); |
1472 | 1471 | ||
1473 | ret = 0; | 1472 | ret = 0; |
1474 | 1473 | ||