aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 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) {