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) { struct wl1273_core *core = radio->core; int r = 0; + unsigned long t; if (freq < WL1273_BAND_TX_LOW) { dev_err(radio->dev, @@ -378,11 +379,11 @@ static int wl1273_fm_set_tx_freq(struct wl1273_device *radio, unsigned int freq) reinit_completion(&radio->busy); /* wait for the FR IRQ */ - r = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); - if (!r) + t = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); + if (!t) return -ETIMEDOUT; - dev_dbg(radio->dev, "WL1273_CHANL_SET: %d\n", r); + dev_dbg(radio->dev, "WL1273_CHANL_SET: %lu\n", t); /* Enable the output power */ 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) reinit_completion(&radio->busy); /* wait for the POWER_ENB IRQ */ - r = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); - if (!r) + t = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); + if (!t) return -ETIMEDOUT; radio->tx_frequency = freq; - dev_dbg(radio->dev, "WL1273_POWER_ENB_SET: %d\n", r); + dev_dbg(radio->dev, "WL1273_POWER_ENB_SET: %lu\n", t); return 0; } @@ -406,6 +407,7 @@ static int wl1273_fm_set_rx_freq(struct wl1273_device *radio, unsigned int freq) { struct wl1273_core *core = radio->core; int r, f; + unsigned long t; if (freq < radio->rangelow) { dev_err(radio->dev, @@ -446,8 +448,8 @@ static int wl1273_fm_set_rx_freq(struct wl1273_device *radio, unsigned int freq) reinit_completion(&radio->busy); - r = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); - if (!r) { + t = wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(2000)); + if (!t) { dev_err(radio->dev, "%s: TIMEOUT\n", __func__); return -ETIMEDOUT; } @@ -826,9 +828,12 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio, if (r) goto out; + /* wait for the FR IRQ */ wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); - if (!(radio->irq_received & WL1273_BL_EVENT)) + if (!(radio->irq_received & WL1273_BL_EVENT)) { + r = -ETIMEDOUT; goto out; + } radio->irq_received &= ~WL1273_BL_EVENT; @@ -854,7 +859,9 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio, if (r) goto out; - wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); + /* wait for the FR IRQ */ + if (!wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000))) + r = -ETIMEDOUT; out: dev_dbg(radio->dev, "%s: Err: %d\n", __func__, r); return r; |