diff options
-rw-r--r-- | drivers/media/radio/radio-si476x.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/media/radio/radio-si476x.c b/drivers/media/radio/radio-si476x.c index 0895a0c23787..9430c6a29937 100644 --- a/drivers/media/radio/radio-si476x.c +++ b/drivers/media/radio/radio-si476x.c | |||
@@ -472,7 +472,7 @@ static int si476x_radio_g_tuner(struct file *file, void *priv, | |||
472 | } | 472 | } |
473 | 473 | ||
474 | static int si476x_radio_s_tuner(struct file *file, void *priv, | 474 | static int si476x_radio_s_tuner(struct file *file, void *priv, |
475 | struct v4l2_tuner *tuner) | 475 | const struct v4l2_tuner *tuner) |
476 | { | 476 | { |
477 | struct si476x_radio *radio = video_drvdata(file); | 477 | struct si476x_radio *radio = video_drvdata(file); |
478 | 478 | ||
@@ -699,15 +699,16 @@ static int si476x_radio_g_frequency(struct file *file, void *priv, | |||
699 | } | 699 | } |
700 | 700 | ||
701 | static int si476x_radio_s_frequency(struct file *file, void *priv, | 701 | static int si476x_radio_s_frequency(struct file *file, void *priv, |
702 | struct v4l2_frequency *f) | 702 | const struct v4l2_frequency *f) |
703 | { | 703 | { |
704 | int err; | 704 | int err; |
705 | u32 freq = f->frequency; | ||
705 | struct si476x_tune_freq_args args; | 706 | struct si476x_tune_freq_args args; |
706 | struct si476x_radio *radio = video_drvdata(file); | 707 | struct si476x_radio *radio = video_drvdata(file); |
707 | 708 | ||
708 | const u32 midrange = (si476x_bands[SI476X_BAND_AM].rangehigh + | 709 | const u32 midrange = (si476x_bands[SI476X_BAND_AM].rangehigh + |
709 | si476x_bands[SI476X_BAND_FM].rangelow) / 2; | 710 | si476x_bands[SI476X_BAND_FM].rangelow) / 2; |
710 | const int band = (f->frequency > midrange) ? | 711 | const int band = (freq > midrange) ? |
711 | SI476X_BAND_FM : SI476X_BAND_AM; | 712 | SI476X_BAND_FM : SI476X_BAND_AM; |
712 | const enum si476x_func func = (band == SI476X_BAND_AM) ? | 713 | const enum si476x_func func = (band == SI476X_BAND_AM) ? |
713 | SI476X_FUNC_AM_RECEIVER : SI476X_FUNC_FM_RECEIVER; | 714 | SI476X_FUNC_AM_RECEIVER : SI476X_FUNC_FM_RECEIVER; |
@@ -718,11 +719,11 @@ static int si476x_radio_s_frequency(struct file *file, void *priv, | |||
718 | 719 | ||
719 | si476x_core_lock(radio->core); | 720 | si476x_core_lock(radio->core); |
720 | 721 | ||
721 | f->frequency = clamp(f->frequency, | 722 | freq = clamp(freq, |
722 | si476x_bands[band].rangelow, | 723 | si476x_bands[band].rangelow, |
723 | si476x_bands[band].rangehigh); | 724 | si476x_bands[band].rangehigh); |
724 | 725 | ||
725 | if (si476x_radio_freq_is_inside_of_the_band(f->frequency, | 726 | if (si476x_radio_freq_is_inside_of_the_band(freq, |
726 | SI476X_BAND_AM) && | 727 | SI476X_BAND_AM) && |
727 | (!si476x_core_has_am(radio->core) || | 728 | (!si476x_core_has_am(radio->core) || |
728 | si476x_core_is_a_secondary_tuner(radio->core))) { | 729 | si476x_core_is_a_secondary_tuner(radio->core))) { |
@@ -737,8 +738,7 @@ static int si476x_radio_s_frequency(struct file *file, void *priv, | |||
737 | args.zifsr = false; | 738 | args.zifsr = false; |
738 | args.hd = false; | 739 | args.hd = false; |
739 | args.injside = SI476X_INJSIDE_AUTO; | 740 | args.injside = SI476X_INJSIDE_AUTO; |
740 | args.freq = v4l2_to_si476x(radio->core, | 741 | args.freq = v4l2_to_si476x(radio->core, freq); |
741 | f->frequency); | ||
742 | args.tunemode = SI476X_TM_VALIDATED_NORMAL_TUNE; | 742 | args.tunemode = SI476X_TM_VALIDATED_NORMAL_TUNE; |
743 | args.smoothmetrics = SI476X_SM_INITIALIZE_AUDIO; | 743 | args.smoothmetrics = SI476X_SM_INITIALIZE_AUDIO; |
744 | args.antcap = 0; | 744 | args.antcap = 0; |
@@ -1046,7 +1046,7 @@ static int si476x_radio_g_register(struct file *file, void *fh, | |||
1046 | return err; | 1046 | return err; |
1047 | } | 1047 | } |
1048 | static int si476x_radio_s_register(struct file *file, void *fh, | 1048 | static int si476x_radio_s_register(struct file *file, void *fh, |
1049 | struct v4l2_dbg_register *reg) | 1049 | const struct v4l2_dbg_register *reg) |
1050 | { | 1050 | { |
1051 | 1051 | ||
1052 | int err; | 1052 | int err; |