diff options
Diffstat (limited to 'drivers/media/radio/radio-wl1273.c')
-rw-r--r-- | drivers/media/radio/radio-wl1273.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index b8f36445516b..a93f681aa9d6 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c | |||
@@ -347,6 +347,7 @@ static int wl1273_fm_set_tx_freq(struct wl1273_device *radio, unsigned int freq) | |||
347 | { | 347 | { |
348 | struct wl1273_core *core = radio->core; | 348 | struct wl1273_core *core = radio->core; |
349 | int r = 0; | 349 | int r = 0; |
350 | unsigned long t; | ||
350 | 351 | ||
351 | if (freq < WL1273_BAND_TX_LOW) { | 352 | if (freq < WL1273_BAND_TX_LOW) { |
352 | dev_err(radio->dev, | 353 | dev_err(radio->dev, |
@@ -378,11 +379,11 @@ static int wl1273_fm_set_tx_freq(struct wl1273_device *radio, unsigned int freq) | |||
378 | reinit_completion(&radio->busy); | 379 | reinit_completion(&radio->busy); |
379 | 380 | ||
380 | /* wait for the FR IRQ */ | 381 | /* wait for the FR IRQ */ |
381 | r = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); | 382 | t = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); |
382 | if (!r) | 383 | if (!t) |
383 | return -ETIMEDOUT; | 384 | return -ETIMEDOUT; |
384 | 385 | ||
385 | dev_dbg(radio->dev, "WL1273_CHANL_SET: %d\n", r); | 386 | dev_dbg(radio->dev, "WL1273_CHANL_SET: %lu\n", t); |
386 | 387 | ||
387 | /* Enable the output power */ | 388 | /* Enable the output power */ |
388 | r = core->write(core, WL1273_POWER_ENB_SET, 1); | 389 | r = core->write(core, WL1273_POWER_ENB_SET, 1); |
@@ -392,12 +393,12 @@ static int wl1273_fm_set_tx_freq(struct wl1273_device *radio, unsigned int freq) | |||
392 | reinit_completion(&radio->busy); | 393 | reinit_completion(&radio->busy); |
393 | 394 | ||
394 | /* wait for the POWER_ENB IRQ */ | 395 | /* wait for the POWER_ENB IRQ */ |
395 | r = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); | 396 | t = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); |
396 | if (!r) | 397 | if (!t) |
397 | return -ETIMEDOUT; | 398 | return -ETIMEDOUT; |
398 | 399 | ||
399 | radio->tx_frequency = freq; | 400 | radio->tx_frequency = freq; |
400 | dev_dbg(radio->dev, "WL1273_POWER_ENB_SET: %d\n", r); | 401 | dev_dbg(radio->dev, "WL1273_POWER_ENB_SET: %lu\n", t); |
401 | 402 | ||
402 | return 0; | 403 | return 0; |
403 | } | 404 | } |
@@ -406,6 +407,7 @@ static int wl1273_fm_set_rx_freq(struct wl1273_device *radio, unsigned int freq) | |||
406 | { | 407 | { |
407 | struct wl1273_core *core = radio->core; | 408 | struct wl1273_core *core = radio->core; |
408 | int r, f; | 409 | int r, f; |
410 | unsigned long t; | ||
409 | 411 | ||
410 | if (freq < radio->rangelow) { | 412 | if (freq < radio->rangelow) { |
411 | dev_err(radio->dev, | 413 | dev_err(radio->dev, |
@@ -446,8 +448,8 @@ static int wl1273_fm_set_rx_freq(struct wl1273_device *radio, unsigned int freq) | |||
446 | 448 | ||
447 | reinit_completion(&radio->busy); | 449 | reinit_completion(&radio->busy); |
448 | 450 | ||
449 | r = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); | 451 | t = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); |
450 | if (!r) { | 452 | if (!t) { |
451 | dev_err(radio->dev, "%s: TIMEOUT\n", __func__); | 453 | dev_err(radio->dev, "%s: TIMEOUT\n", __func__); |
452 | return -ETIMEDOUT; | 454 | return -ETIMEDOUT; |
453 | } | 455 | } |
@@ -826,9 +828,12 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio, | |||
826 | if (r) | 828 | if (r) |
827 | goto out; | 829 | goto out; |
828 | 830 | ||
831 | /* wait for the FR IRQ */ | ||
829 | wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); | 832 | wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); |
830 | if (!(radio->irq_received & WL1273_BL_EVENT)) | 833 | if (!(radio->irq_received & WL1273_BL_EVENT)) { |
834 | r = -ETIMEDOUT; | ||
831 | goto out; | 835 | goto out; |
836 | } | ||
832 | 837 | ||
833 | radio->irq_received &= ~WL1273_BL_EVENT; | 838 | radio->irq_received &= ~WL1273_BL_EVENT; |
834 | 839 | ||
@@ -854,7 +859,9 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio, | |||
854 | if (r) | 859 | if (r) |
855 | goto out; | 860 | goto out; |
856 | 861 | ||
857 | wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); | 862 | /* wait for the FR IRQ */ |
863 | if (!wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000))) | ||
864 | r = -ETIMEDOUT; | ||
858 | out: | 865 | out: |
859 | dev_dbg(radio->dev, "%s: Err: %d\n", __func__, r); | 866 | dev_dbg(radio->dev, "%s: Err: %d\n", __func__, r); |
860 | return r; | 867 | return r; |