diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-09-21 08:33:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-09-26 16:51:41 -0400 |
commit | 617ade61ea88a370c89960918eddfa10c41316f5 (patch) | |
tree | 454f435d429f26ba0268fd2b02cff539dc98fbfa | |
parent | f9611240b96fd18359531e939b09969fee556221 (diff) |
[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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/radio/radio-mr800.c | 3 | ||||
-rw-r--r-- | drivers/media/radio/radio-tea5777.c | 3 | ||||
-rw-r--r-- | drivers/media/radio/radio-wl1273.c | 3 | ||||
-rw-r--r-- | drivers/media/radio/si470x/radio-si470x-common.c | 3 | ||||
-rw-r--r-- | drivers/media/radio/wl128x/fmdrv_v4l2.c | 3 | ||||
-rw-r--r-- | sound/i2c/other/tea575x-tuner.c | 3 |
6 files changed, 18 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c index 720bf0da599c..9c5a267b60b4 100644 --- a/drivers/media/radio/radio-mr800.c +++ b/drivers/media/radio/radio-mr800.c | |||
@@ -360,6 +360,9 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *priv, | |||
360 | if (seek->tuner != 0 || !seek->wrap_around) | 360 | if (seek->tuner != 0 || !seek->wrap_around) |
361 | return -EINVAL; | 361 | return -EINVAL; |
362 | 362 | ||
363 | if (file->f_flags & O_NONBLOCK) | ||
364 | return -EWOULDBLOCK; | ||
365 | |||
363 | retval = amradio_send_cmd(radio, | 366 | retval = amradio_send_cmd(radio, |
364 | AMRADIO_SET_SEARCH_LVL, 0, buf, 8, false); | 367 | AMRADIO_SET_SEARCH_LVL, 0, buf, 8, false); |
365 | if (retval) | 368 | if (retval) |
diff --git a/drivers/media/radio/radio-tea5777.c b/drivers/media/radio/radio-tea5777.c index c1a2ea6e87a3..4b5190d4fea5 100644 --- a/drivers/media/radio/radio-tea5777.c +++ b/drivers/media/radio/radio-tea5777.c | |||
@@ -397,6 +397,9 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh, | |||
397 | if (a->tuner || a->wrap_around) | 397 | if (a->tuner || a->wrap_around) |
398 | return -EINVAL; | 398 | return -EINVAL; |
399 | 399 | ||
400 | if (file->f_flags & O_NONBLOCK) | ||
401 | return -EWOULDBLOCK; | ||
402 | |||
400 | if (rangelow || rangehigh) { | 403 | if (rangelow || rangehigh) { |
401 | for (i = 0; i < ARRAY_SIZE(bands); i++) { | 404 | for (i = 0; i < ARRAY_SIZE(bands); i++) { |
402 | if (i == BAND_AM && !tea->has_am) | 405 | if (i == BAND_AM && !tea->has_am) |
diff --git a/drivers/media/radio/radio-wl1273.c b/drivers/media/radio/radio-wl1273.c index b53ecbc67f17..9b0c9fa0beb8 100644 --- a/drivers/media/radio/radio-wl1273.c +++ b/drivers/media/radio/radio-wl1273.c | |||
@@ -1693,6 +1693,9 @@ static int wl1273_fm_vidioc_s_hw_freq_seek(struct file *file, void *priv, | |||
1693 | if (seek->tuner != 0 || seek->type != V4L2_TUNER_RADIO) | 1693 | if (seek->tuner != 0 || seek->type != V4L2_TUNER_RADIO) |
1694 | return -EINVAL; | 1694 | return -EINVAL; |
1695 | 1695 | ||
1696 | if (file->f_flags & O_NONBLOCK) | ||
1697 | return -EWOULDBLOCK; | ||
1698 | |||
1696 | if (mutex_lock_interruptible(&core->lock)) | 1699 | if (mutex_lock_interruptible(&core->lock)) |
1697 | return -EINTR; | 1700 | return -EINTR; |
1698 | 1701 | ||
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c index 74a5c901471f..18989388ddc1 100644 --- a/drivers/media/radio/si470x/radio-si470x-common.c +++ b/drivers/media/radio/si470x/radio-si470x-common.c | |||
@@ -708,6 +708,9 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv, | |||
708 | if (seek->tuner != 0) | 708 | if (seek->tuner != 0) |
709 | return -EINVAL; | 709 | return -EINVAL; |
710 | 710 | ||
711 | if (file->f_flags & O_NONBLOCK) | ||
712 | return -EWOULDBLOCK; | ||
713 | |||
711 | return si470x_set_seek(radio, seek); | 714 | return si470x_set_seek(radio, seek); |
712 | } | 715 | } |
713 | 716 | ||
diff --git a/drivers/media/radio/wl128x/fmdrv_v4l2.c b/drivers/media/radio/wl128x/fmdrv_v4l2.c index 8a672a31a656..048de4536036 100644 --- a/drivers/media/radio/wl128x/fmdrv_v4l2.c +++ b/drivers/media/radio/wl128x/fmdrv_v4l2.c | |||
@@ -408,6 +408,9 @@ static int fm_v4l2_vidioc_s_hw_freq_seek(struct file *file, void *priv, | |||
408 | struct fmdev *fmdev = video_drvdata(file); | 408 | struct fmdev *fmdev = video_drvdata(file); |
409 | int ret; | 409 | int ret; |
410 | 410 | ||
411 | if (file->f_flags & O_NONBLOCK) | ||
412 | return -EWOULDBLOCK; | ||
413 | |||
411 | if (fmdev->curr_fmmode != FM_MODE_RX) { | 414 | if (fmdev->curr_fmmode != FM_MODE_RX) { |
412 | ret = fmc_set_mode(fmdev, FM_MODE_RX); | 415 | ret = fmc_set_mode(fmdev, FM_MODE_RX); |
413 | if (ret != 0) { | 416 | if (ret != 0) { |
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c index 4a8fad674f02..3c6c1e3226f3 100644 --- a/sound/i2c/other/tea575x-tuner.c +++ b/sound/i2c/other/tea575x-tuner.c | |||
@@ -368,6 +368,9 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *fh, | |||
368 | if (a->tuner || a->wrap_around) | 368 | if (a->tuner || a->wrap_around) |
369 | return -EINVAL; | 369 | return -EINVAL; |
370 | 370 | ||
371 | if (file->f_flags & O_NONBLOCK) | ||
372 | return -EWOULDBLOCK; | ||
373 | |||
371 | if (a->rangelow || a->rangehigh) { | 374 | if (a->rangelow || a->rangehigh) { |
372 | for (i = 0; i < ARRAY_SIZE(bands); i++) { | 375 | for (i = 0; i < ARRAY_SIZE(bands); i++) { |
373 | if ((i == BAND_FM && tea->tea5759) || | 376 | if ((i == BAND_FM && tea->tea5759) || |