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>
if (retval < 0 || size != BUFFER_LENGTH)
goto out_err;
+ radio->curfreq = freq;
goto out;
out_err:
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 */