diff options
author | Douglas Schilling Landgraf <dougsland@linuxtv.org> | 2008-10-09 12:46:59 -0400 |
---|---|---|
committer | Douglas Schilling Landgraf <dougsland@linuxtv.org> | 2008-10-09 12:46:59 -0400 |
commit | 9ae1eb9215c9776d675d335f9ad0264b2ce06bf2 (patch) | |
tree | 850b26630288fc353d531107c8112af7b53e41c2 /linux/drivers/media | |
parent | 9842bd3e4e6f5729e0b66e18c358f3c0f5ad4dda (diff) | |
download | mediapointer-dvb-s2-9ae1eb9215c9776d675d335f9ad0264b2ce06bf2.tar.gz mediapointer-dvb-s2-9ae1eb9215c9776d675d335f9ad0264b2ce06bf2.tar.bz2 |
radio-zoltrix: Add checking for frequency
From: Alexey Klimov <klimov.linux@gmail.com>
This patch adds printk messages, adds checking if frequency is set,
adds return -EINVAL in right places in zoltrix-radio.
Priority: normal
Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
Signed-off-by: Douglas Schilling Landgraf <dougsland@linuxtv.org>
Diffstat (limited to 'linux/drivers/media')
-rw-r--r-- | linux/drivers/media/radio/radio-zoltrix.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/linux/drivers/media/radio/radio-zoltrix.c b/linux/drivers/media/radio/radio-zoltrix.c index 615165b57..61b0366ab 100644 --- a/linux/drivers/media/radio/radio-zoltrix.c +++ b/linux/drivers/media/radio/radio-zoltrix.c @@ -124,8 +124,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; @@ -280,7 +283,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; } @@ -344,7 +350,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 /*keep*/ /* FIXME: Implement stereo/mono switch on V4L2 */ if (v->mode & VIDEO_SOUND_STEREO) { |