summaryrefslogtreecommitdiffstats
path: root/drivers/media/radio
diff options
context:
space:
mode:
authorAlexey Klimov <klimov.linux@gmail.com>2008-10-09 13:46:59 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-10-13 07:16:10 -0200
commitb4be2048ce62d05d93608f82d5e986612ed4fdf7 (patch)
tree74695e055eaccbd16089801ecac40b32b888e1b2 /drivers/media/radio
parent90b698dd47f3929f20746f828e2cd648bc6539dd (diff)
downloadop-kernel-dev-b4be2048ce62d05d93608f82d5e986612ed4fdf7.zip
op-kernel-dev-b4be2048ce62d05d93608f82d5e986612ed4fdf7.tar.gz
V4L/DVB (9152): radio-zoltrix: Add checking for frequency
This patch adds printk messages, adds checking if frequency is set, adds return -EINVAL in right places in zoltrix-radio. Signed-off-by: Alexey Klimov <klimov.linux@gmail.com> Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r--drivers/media/radio/radio-zoltrix.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c
index f75da63..15b10ba 100644
--- a/drivers/media/radio/radio-zoltrix.c
+++ b/drivers/media/radio/radio-zoltrix.c
@@ -123,8 +123,11 @@ static int zol_setfreq(struct zol_device *dev, unsigned long freq)
unsigned int stereo = dev->stereo;
int i;
- if (freq == 0)
- return 1;
+ if (freq == 0) {
+ printk(KERN_WARNING "zoltrix: received zero freq. Failed to set.\n");
+ return -EINVAL;
+ }
+
m = (freq / 160 - 8800) * 2;
f = (unsigned long long) m + 0x4d1c;
@@ -279,7 +282,10 @@ static int vidioc_s_frequency(struct file *file, void *priv,
struct zol_device *zol = video_drvdata(file);
zol->curfreq = f->frequency;
- zol_setfreq(zol, zol->curfreq);
+ if (zol_setfreq(zol, zol->curfreq) != 0) {
+ printk(KERN_WARNING "zoltrix: Set frequency failed.\n");
+ return -EINVAL;
+ }
return 0;
}
@@ -343,7 +349,10 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
return 0;
}
zol->stereo = 1;
- zol_setfreq(zol, zol->curfreq);
+ if (zol_setfreq(zol, zol->curfreq) != 0) {
+ printk(KERN_WARNING "zoltrix: Set frequency failed.\n");
+ return -EINVAL;
+ }
#if 0
/* FIXME: Implement stereo/mono switch on V4L2 */
if (v->mode & VIDEO_SOUND_STEREO) {
OpenPOWER on IntegriCloud