From 9842bd3e4e6f5729e0b66e18c358f3c0f5ad4dda Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Thu, 9 Oct 2008 12:42:32 -0400 Subject: dsbr100: Add returns and fix codingstyle for vidioc_s_ctrl From: Alexey Klimov Added return -EBUSY and fixed codingstyle issue Priority: normal Signed-off-by: Alexey Klimov Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/radio/dsbr100.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/radio/dsbr100.c b/linux/drivers/media/radio/dsbr100.c index f3af92b59..7172977c7 100644 --- a/linux/drivers/media/radio/dsbr100.c +++ b/linux/drivers/media/radio/dsbr100.c @@ -361,11 +361,15 @@ static int vidioc_s_ctrl(struct file *file, void *priv, switch (ctrl->id) { case V4L2_CID_AUDIO_MUTE: if (ctrl->value) { - if (dsbr100_stop(radio)==-1) + if (dsbr100_stop(radio) == -1) { warn("Radio did not respond properly"); + return -EBUSY; + } } else { - if (dsbr100_start(radio)==-1) + if (dsbr100_start(radio) == -1) { warn("Radio did not respond properly"); + return -EBUSY; + } } return 0; } -- cgit v1.2.3 From 9ae1eb9215c9776d675d335f9ad0264b2ce06bf2 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Thu, 9 Oct 2008 12:46:59 -0400 Subject: radio-zoltrix: Add checking for frequency From: Alexey Klimov 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 Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/radio/radio-zoltrix.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'linux/drivers/media') 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) { -- cgit v1.2.3 From 84cd3a09ddb269ab040c5f58a9a667948f55f037 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Thu, 9 Oct 2008 12:57:17 -0400 Subject: radio-mr800: Fix issue for kernel < 2.6.23 From: Alexey Klimov Fixed issue for kernel < 2.6.23 * Added compat.h * Added macro validation Priority: normal Signed-off-by: Alexey Klimov Signed-off-by: Douglas Schilling Landgraf --- linux/drivers/media/radio/radio-mr800.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux/drivers/media') diff --git a/linux/drivers/media/radio/radio-mr800.c b/linux/drivers/media/radio/radio-mr800.c index a33717c48..2ae8e1447 100644 --- a/linux/drivers/media/radio/radio-mr800.c +++ b/linux/drivers/media/radio/radio-mr800.c @@ -58,6 +58,7 @@ #include #include #include /* for KERNEL_VERSION MACRO */ +#include "compat.h" /* driver and module definitions */ #define DRIVER_AUTHOR "Alexey Klimov " @@ -159,7 +160,9 @@ static struct usb_driver usb_amradio_driver = { .disconnect = usb_amradio_disconnect, .suspend = usb_amradio_suspend, .resume = usb_amradio_resume, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) .reset_resume = usb_amradio_resume, +#endif .id_table = usb_amradio_device_table, .supports_autosuspend = 1, }; -- cgit v1.2.3