[media] radio drivers: in non-blocking mode return EAGAIN in hwseek
authorHans Verkuil <hans.verkuil@cisco.com>
Fri, 21 Sep 2012 12:33:35 +0000 (09:33 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 26 Sep 2012 20:51:41 +0000 (17:51 -0300)
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>
drivers/media/radio/radio-mr800.c
drivers/media/radio/radio-tea5777.c
drivers/media/radio/radio-wl1273.c
drivers/media/radio/si470x/radio-si470x-common.c
drivers/media/radio/wl128x/fmdrv_v4l2.c
sound/i2c/other/tea575x-tuner.c

index 720bf0da599cece60a2d36e80b7c393efb36a45b..9c5a267b60b46f80f35a0326771cffa3666a12c9 100644 (file)
@@ -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)
index c1a2ea6e87a3fd48270b3ffc8a9145fd22a4e303..4b5190d4fea5d701b06853bedb5b89408742fb3c 100644 (file)
@@ -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)
index b53ecbc67f172b18205737036d3248d654f0a36d..9b0c9fa0beb80307ac0a4b95785a2aaaa50fb0f3 100644 (file)
@@ -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;
 
index 74a5c901471fb07e9355aa3371f0fd5389c372a0..18989388ddc14d32f3134f650615c33e43bb55bb 100644 (file)
@@ -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);
 }
 
index 8a672a31a65629a43f9aa4aebac65237af2b83db..048de45360360251095639d1422f9931853d3fba 100644 (file)
@@ -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) {
index 4a8fad674f02904dd30e943af1a5ab594cdaca19..3c6c1e3226f365c82c45cc1f98065520d24bfbb7 100644 (file)
@@ -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) ||