Commit 617ade61 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

[media] radio drivers: in non-blocking mode return EAGAIN in hwseek

VIDIOC_S_HW_FREQ_SEEK should return EAGAIN when called in non-blocking
mode. This might change in the future if we add support for this in the
future, but right now this is not supported.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f9611240
......@@ -360,6 +360,9 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *priv,
if (seek->tuner != 0 || !seek->wrap_around)
return -EINVAL;
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
retval = amradio_send_cmd(radio,
AMRADIO_SET_SEARCH_LVL, 0, buf, 8, false);
if (retval)
......
......@@ -397,6 +397,9 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
if (a->tuner || a->wrap_around)
return -EINVAL;
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
if (rangelow || rangehigh) {
for (i = 0; i < ARRAY_SIZE(bands); i++) {
if (i == BAND_AM && !tea->has_am)
......
......@@ -1693,6 +1693,9 @@ static int wl1273_fm_vidioc_s_hw_freq_seek(struct file *file, void *priv,
if (seek->tuner != 0 || seek->type != V4L2_TUNER_RADIO)
return -EINVAL;
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
if (mutex_lock_interruptible(&core->lock))
return -EINTR;
......
......@@ -708,6 +708,9 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv,
if (seek->tuner != 0)
return -EINVAL;
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
return si470x_set_seek(radio, seek);
}
......
......@@ -408,6 +408,9 @@ static int fm_v4l2_vidioc_s_hw_freq_seek(struct file *file, void *priv,
struct fmdev *fmdev = video_drvdata(file);
int ret;
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
if (fmdev->curr_fmmode != FM_MODE_RX) {
ret = fmc_set_mode(fmdev, FM_MODE_RX);
if (ret != 0) {
......
......@@ -368,6 +368,9 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh,
if (a->tuner || a->wrap_around)
return -EINVAL;
if (file->f_flags & O_NONBLOCK)
return -EWOULDBLOCK;
if (a->rangelow || a->rangehigh) {
for (i = 0; i < ARRAY_SIZE(bands); i++) {
if ((i == BAND_FM && tea->tea5759) ||
......
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