V4L/DVB (13073): radio-mr800: set radio frequency only upon success
authorDavid Ellingsworth <david@identd.dyndns.org>
Wed, 23 Sep 2009 21:31:26 +0000 (18:31 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:40:12 +0000 (18:40 -0200)
Set radio frequency only upon success.

Signed-off-by: David Ellingsworth <david@identd.dyndns.org>
Acked-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/radio/radio-mr800.c

index 5506fac5fd49555ec0573dbfe6c7a00e9376bfb6..4064109c4205cfb079f6590f0b3664a2cf2c3318 100644 (file)
@@ -235,6 +235,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
        if (retval < 0 || size != BUFFER_LENGTH)
                goto out_err;
 
+       radio->curfreq = freq;
        goto out;
 
 out_err:
@@ -371,13 +372,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
                                struct v4l2_frequency *f)
 {
        struct amradio_device *radio = file->private_data;
-       int retval = 0;
-
-       radio->curfreq = f->frequency;
 
-       retval = amradio_setfreq(radio, radio->curfreq);
-
-       return retval;
+       return amradio_setfreq(radio, f->frequency);
 }
 
 /* vidioc_g_frequency - get tuner radio frequency */