diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-04-30 18:49:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 12:44:56 -0400 |
commit | 340bd4c16cead8bf8f5205c7d283a3bd9d699f76 (patch) | |
tree | 4284e06391c111f8dcb45e88a4cba2c429b13c1f /drivers/media/radio | |
parent | eae63ae007fd72d5040d6749339d68fbfd99d8c7 (diff) |
[media] radio-si470x-common.c: remove unnecessary kernel log spam
There is no need to report an error in the log, you are already returning
that error to userspace after all.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Tobias Lorenz <tobias.lorenz@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r-- | drivers/media/radio/si470x/radio-si470x-common.c | 78 |
1 files changed, 17 insertions, 61 deletions
diff --git a/drivers/media/radio/si470x/radio-si470x-common.c b/drivers/media/radio/si470x/radio-si470x-common.c index e70badf7c6e9..b9a44d4a032f 100644 --- a/drivers/media/radio/si470x/radio-si470x-common.c +++ b/drivers/media/radio/si470x/radio-si470x-common.c | |||
@@ -327,7 +327,7 @@ static int si470x_set_seek(struct si470x_device *radio, | |||
327 | radio->registers[POWERCFG] &= ~POWERCFG_SEEKUP; | 327 | radio->registers[POWERCFG] &= ~POWERCFG_SEEKUP; |
328 | retval = si470x_set_register(radio, POWERCFG); | 328 | retval = si470x_set_register(radio, POWERCFG); |
329 | if (retval < 0) | 329 | if (retval < 0) |
330 | goto done; | 330 | return retval; |
331 | 331 | ||
332 | /* currently I2C driver only uses interrupt way to seek */ | 332 | /* currently I2C driver only uses interrupt way to seek */ |
333 | if (radio->stci_enabled) { | 333 | if (radio->stci_enabled) { |
@@ -355,20 +355,15 @@ static int si470x_set_seek(struct si470x_device *radio, | |||
355 | if (radio->registers[STATUSRSSI] & STATUSRSSI_SF) | 355 | if (radio->registers[STATUSRSSI] & STATUSRSSI_SF) |
356 | dev_warn(&radio->videodev.dev, | 356 | dev_warn(&radio->videodev.dev, |
357 | "seek failed / band limit reached\n"); | 357 | "seek failed / band limit reached\n"); |
358 | if (timed_out) | ||
359 | dev_warn(&radio->videodev.dev, | ||
360 | "seek timed out after %u ms\n", seek_timeout); | ||
361 | 358 | ||
362 | stop: | 359 | stop: |
363 | /* stop seeking */ | 360 | /* stop seeking */ |
364 | radio->registers[POWERCFG] &= ~POWERCFG_SEEK; | 361 | radio->registers[POWERCFG] &= ~POWERCFG_SEEK; |
365 | retval = si470x_set_register(radio, POWERCFG); | 362 | retval = si470x_set_register(radio, POWERCFG); |
366 | 363 | ||
367 | done: | ||
368 | /* try again, if timed out */ | 364 | /* try again, if timed out */ |
369 | if ((retval == 0) && timed_out) | 365 | if (retval == 0 && timed_out) |
370 | retval = -EAGAIN; | 366 | return -EAGAIN; |
371 | |||
372 | return retval; | 367 | return retval; |
373 | } | 368 | } |
374 | 369 | ||
@@ -589,16 +584,14 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, | |||
589 | struct v4l2_tuner *tuner) | 584 | struct v4l2_tuner *tuner) |
590 | { | 585 | { |
591 | struct si470x_device *radio = video_drvdata(file); | 586 | struct si470x_device *radio = video_drvdata(file); |
592 | int retval = 0; | 587 | int retval; |
593 | 588 | ||
594 | if (tuner->index != 0) { | 589 | if (tuner->index != 0) |
595 | retval = -EINVAL; | 590 | return -EINVAL; |
596 | goto done; | ||
597 | } | ||
598 | 591 | ||
599 | retval = si470x_get_register(radio, STATUSRSSI); | 592 | retval = si470x_get_register(radio, STATUSRSSI); |
600 | if (retval < 0) | 593 | if (retval < 0) |
601 | goto done; | 594 | return retval; |
602 | 595 | ||
603 | /* driver constants */ | 596 | /* driver constants */ |
604 | strcpy(tuner->name, "FM"); | 597 | strcpy(tuner->name, "FM"); |
@@ -653,10 +646,6 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, | |||
653 | /* AFCRL does only indicate that freq. differs, not if too low/high */ | 646 | /* AFCRL does only indicate that freq. differs, not if too low/high */ |
654 | tuner->afc = (radio->registers[STATUSRSSI] & STATUSRSSI_AFCRL) ? 1 : 0; | 647 | tuner->afc = (radio->registers[STATUSRSSI] & STATUSRSSI_AFCRL) ? 1 : 0; |
655 | 648 | ||
656 | done: | ||
657 | if (retval < 0) | ||
658 | dev_warn(&radio->videodev.dev, | ||
659 | "get tuner failed with %d\n", retval); | ||
660 | return retval; | 649 | return retval; |
661 | } | 650 | } |
662 | 651 | ||
@@ -668,7 +657,6 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv, | |||
668 | struct v4l2_tuner *tuner) | 657 | struct v4l2_tuner *tuner) |
669 | { | 658 | { |
670 | struct si470x_device *radio = video_drvdata(file); | 659 | struct si470x_device *radio = video_drvdata(file); |
671 | int retval = 0; | ||
672 | 660 | ||
673 | if (tuner->index != 0) | 661 | if (tuner->index != 0) |
674 | return -EINVAL; | 662 | return -EINVAL; |
@@ -684,12 +672,7 @@ static int si470x_vidioc_s_tuner(struct file *file, void *priv, | |||
684 | break; | 672 | break; |
685 | } | 673 | } |
686 | 674 | ||
687 | retval = si470x_set_register(radio, POWERCFG); | 675 | return si470x_set_register(radio, POWERCFG); |
688 | |||
689 | if (retval < 0) | ||
690 | dev_warn(&radio->videodev.dev, | ||
691 | "set tuner failed with %d\n", retval); | ||
692 | return retval; | ||
693 | } | 676 | } |
694 | 677 | ||
695 | 678 | ||
@@ -700,21 +683,12 @@ static int si470x_vidioc_g_frequency(struct file *file, void *priv, | |||
700 | struct v4l2_frequency *freq) | 683 | struct v4l2_frequency *freq) |
701 | { | 684 | { |
702 | struct si470x_device *radio = video_drvdata(file); | 685 | struct si470x_device *radio = video_drvdata(file); |
703 | int retval = 0; | ||
704 | 686 | ||
705 | if (freq->tuner != 0) { | 687 | if (freq->tuner != 0) |
706 | retval = -EINVAL; | 688 | return -EINVAL; |
707 | goto done; | ||
708 | } | ||
709 | 689 | ||
710 | freq->type = V4L2_TUNER_RADIO; | 690 | freq->type = V4L2_TUNER_RADIO; |
711 | retval = si470x_get_freq(radio, &freq->frequency); | 691 | return si470x_get_freq(radio, &freq->frequency); |
712 | |||
713 | done: | ||
714 | if (retval < 0) | ||
715 | dev_warn(&radio->videodev.dev, | ||
716 | "get frequency failed with %d\n", retval); | ||
717 | return retval; | ||
718 | } | 692 | } |
719 | 693 | ||
720 | 694 | ||
@@ -725,20 +699,11 @@ static int si470x_vidioc_s_frequency(struct file *file, void *priv, | |||
725 | struct v4l2_frequency *freq) | 699 | struct v4l2_frequency *freq) |
726 | { | 700 | { |
727 | struct si470x_device *radio = video_drvdata(file); | 701 | struct si470x_device *radio = video_drvdata(file); |
728 | int retval = 0; | ||
729 | |||
730 | if (freq->tuner != 0) { | ||
731 | retval = -EINVAL; | ||
732 | goto done; | ||
733 | } | ||
734 | 702 | ||
735 | retval = si470x_set_freq(radio, freq->frequency); | 703 | if (freq->tuner != 0) |
704 | return -EINVAL; | ||
736 | 705 | ||
737 | done: | 706 | return si470x_set_freq(radio, freq->frequency); |
738 | if (retval < 0) | ||
739 | dev_warn(&radio->videodev.dev, | ||
740 | "set frequency failed with %d\n", retval); | ||
741 | return retval; | ||
742 | } | 707 | } |
743 | 708 | ||
744 | 709 | ||
@@ -749,20 +714,11 @@ static int si470x_vidioc_s_hw_freq_seek(struct file *file, void *priv, | |||
749 | struct v4l2_hw_freq_seek *seek) | 714 | struct v4l2_hw_freq_seek *seek) |
750 | { | 715 | { |
751 | struct si470x_device *radio = video_drvdata(file); | 716 | struct si470x_device *radio = video_drvdata(file); |
752 | int retval = 0; | ||
753 | |||
754 | if (seek->tuner != 0) { | ||
755 | retval = -EINVAL; | ||
756 | goto done; | ||
757 | } | ||
758 | 717 | ||
759 | retval = si470x_set_seek(radio, seek->wrap_around, seek->seek_upward); | 718 | if (seek->tuner != 0) |
719 | return -EINVAL; | ||
760 | 720 | ||
761 | done: | 721 | return si470x_set_seek(radio, seek->wrap_around, seek->seek_upward); |
762 | if (retval < 0) | ||
763 | dev_warn(&radio->videodev.dev, | ||
764 | "set hardware frequency seek failed with %d\n", retval); | ||
765 | return retval; | ||
766 | } | 722 | } |
767 | 723 | ||
768 | const struct v4l2_ctrl_ops si470x_ctrl_ops = { | 724 | const struct v4l2_ctrl_ops si470x_ctrl_ops = { |