diff options
author | Alexey Klimov <klimov.linux@gmail.com> | 2008-10-09 12:46:59 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-13 05:16:10 -0400 |
commit | b4be2048ce62d05d93608f82d5e986612ed4fdf7 (patch) | |
tree | 74695e055eaccbd16089801ecac40b32b888e1b2 /drivers/media | |
parent | 90b698dd47f3929f20746f828e2cd648bc6539dd (diff) |
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')
-rw-r--r-- | drivers/media/radio/radio-zoltrix.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/radio/radio-zoltrix.c b/drivers/media/radio/radio-zoltrix.c index f75da63b1634..15b10bad6796 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) | |||
123 | unsigned int stereo = dev->stereo; | 123 | unsigned int stereo = dev->stereo; |
124 | int i; | 124 | int i; |
125 | 125 | ||
126 | if (freq == 0) | 126 | if (freq == 0) { |
127 | return 1; | 127 | printk(KERN_WARNING "zoltrix: received zero freq. Failed to set.\n"); |
128 | return -EINVAL; | ||
129 | } | ||
130 | |||
128 | m = (freq / 160 - 8800) * 2; | 131 | m = (freq / 160 - 8800) * 2; |
129 | f = (unsigned long long) m + 0x4d1c; | 132 | f = (unsigned long long) m + 0x4d1c; |
130 | 133 | ||
@@ -279,7 +282,10 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
279 | struct zol_device *zol = video_drvdata(file); | 282 | struct zol_device *zol = video_drvdata(file); |
280 | 283 | ||
281 | zol->curfreq = f->frequency; | 284 | zol->curfreq = f->frequency; |
282 | zol_setfreq(zol, zol->curfreq); | 285 | if (zol_setfreq(zol, zol->curfreq) != 0) { |
286 | printk(KERN_WARNING "zoltrix: Set frequency failed.\n"); | ||
287 | return -EINVAL; | ||
288 | } | ||
283 | return 0; | 289 | return 0; |
284 | } | 290 | } |
285 | 291 | ||
@@ -343,7 +349,10 @@ static int vidioc_s_ctrl(struct file *file, void *priv, | |||
343 | return 0; | 349 | return 0; |
344 | } | 350 | } |
345 | zol->stereo = 1; | 351 | zol->stereo = 1; |
346 | zol_setfreq(zol, zol->curfreq); | 352 | if (zol_setfreq(zol, zol->curfreq) != 0) { |
353 | printk(KERN_WARNING "zoltrix: Set frequency failed.\n"); | ||
354 | return -EINVAL; | ||
355 | } | ||
347 | #if 0 | 356 | #if 0 |
348 | /* FIXME: Implement stereo/mono switch on V4L2 */ | 357 | /* FIXME: Implement stereo/mono switch on V4L2 */ |
349 | if (v->mode & VIDEO_SOUND_STEREO) { | 358 | if (v->mode & VIDEO_SOUND_STEREO) { |