Skip to content

Commit

Permalink
V4L/DVB (13073): radio-mr800: set radio frequency only upon success
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Ellingsworth authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent 16a72f4 commit 798166d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/media/radio/radio-mr800.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 798166d

Please sign in to comment.