Commit c973f76e authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Mauro Carvalho Chehab

[media] media: radio: handle timeouts

Add handling for timeout case.
Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent daa939db
...@@ -828,9 +828,12 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio, ...@@ -828,9 +828,12 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio,
if (r) if (r)
goto out; goto out;
/* wait for the FR IRQ */
wait_for_completion_timeout(&radio->busy, msecs_to_jiffies(1000)); 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; goto out;
}
radio->irq_received &= ~WL1273_BL_EVENT; radio->irq_received &= ~WL1273_BL_EVENT;
...@@ -856,7 +859,9 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio, ...@@ -856,7 +859,9 @@ static int wl1273_fm_set_seek(struct wl1273_device *radio,
if (r) if (r)
goto out; 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: out:
dev_dbg(radio->dev, "%s: Err: %d\n", __func__, r); dev_dbg(radio->dev, "%s: Err: %d\n", __func__, r);
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment