Commit 798166db authored by David Ellingsworth's avatar David Ellingsworth Committed by Mauro Carvalho Chehab

V4L/DVB (13073): radio-mr800: set radio frequency only upon success

Set radio frequency only upon success.
Signed-off-by: default avatarDavid Ellingsworth <david@identd.dyndns.org>
Acked-by: default avatarAlexey Klimov <klimov.linux@gmail.com>
Signed-off-by: default avatarDouglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 16a72f41
...@@ -235,6 +235,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq) ...@@ -235,6 +235,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
if (retval < 0 || size != BUFFER_LENGTH) if (retval < 0 || size != BUFFER_LENGTH)
goto out_err; goto out_err;
radio->curfreq = freq;
goto out; goto out;
out_err: out_err:
...@@ -371,13 +372,8 @@ static int vidioc_s_frequency(struct file *file, void *priv, ...@@ -371,13 +372,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f) struct v4l2_frequency *f)
{ {
struct amradio_device *radio = file->private_data; struct amradio_device *radio = file->private_data;
int retval = 0;
radio->curfreq = f->frequency;
retval = amradio_setfreq(radio, radio->curfreq); return amradio_setfreq(radio, f->frequency);
return retval;
} }
/* vidioc_g_frequency - get tuner radio frequency */ /* vidioc_g_frequency - get tuner radio frequency */
......
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