public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cx88: fix setting input when using DVB
@ 2010-03-27 12:45 istvan_v
  0 siblings, 0 replies; 2+ messages in thread
From: istvan_v @ 2010-03-27 12:45 UTC (permalink / raw)
  To: linux-media

In cx88-mpeg.c, there is code that sets core->input to CX88_VMUX_DVB.
However, this may be incorrect, since core->input is actually an
index to core->board.input[], which has not enough elements to be
indexed by the value of CX88_VMUX_DVB. So, the modified code searches
core->board.input[] for an input with a type of CX88_VMUX_DVB, and if
it does not find one, the index is simply set to zero.
The change may not have much effect, though, since it appears the only
case when core->input is actually used is when the current input is
being queried.

Signed-off-by: Istvan Varga <istvanv@users.sourceforge.net>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] cx88: fix setting input when using DVB
@ 2010-03-27 12:47 istvan_v
  0 siblings, 0 replies; 2+ messages in thread
From: istvan_v @ 2010-03-27 12:47 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

(Sorry for the double post, the previous one did not include the patch)

In cx88-mpeg.c, there is code that sets core->input to CX88_VMUX_DVB.
However, this may be incorrect, since core->input is actually an
index to core->board.input[], which has not enough elements to be
indexed by the value of CX88_VMUX_DVB. So, the modified code searches
core->board.input[] for an input with a type of CX88_VMUX_DVB, and if
it does not find one, the index is simply set to zero.
The change may not have much effect, though, since it appears the only
case when core->input is actually used is when the current input is
being queried.

Signed-off-by: Istvan Varga <istvanv@users.sourceforge.net>

[-- Attachment #2: cx88-vmux-dvb.patch --]
[-- Type: text/x-patch, Size: 1026 bytes --]

diff -r -d -N -U4 v4l-dvb-a79dd2ae4d0e.old/linux/drivers/media/video/cx88/cx88-mpeg.c v4l-dvb-a79dd2ae4d0e/linux/drivers/media/video/cx88/cx88-mpeg.c
--- v4l-dvb-a79dd2ae4d0e.old/linux/drivers/media/video/cx88/cx88-mpeg.c	2010-03-23 03:39:52.000000000 +0100
+++ v4l-dvb-a79dd2ae4d0e/linux/drivers/media/video/cx88/cx88-mpeg.c	2010-03-23 19:07:26.000000000 +0100
@@ -637,15 +637,24 @@
 /* Driver asked for hardware access. */
 static int cx8802_request_acquire(struct cx8802_driver *drv)
 {
 	struct cx88_core *core = drv->core;
+	unsigned int	i;
 
 	/* Fail a request for hardware if the device is busy. */
 	if (core->active_type_id != CX88_BOARD_NONE &&
 	    core->active_type_id != drv->type_id)
 		return -EBUSY;
 
-	core->input = CX88_VMUX_DVB;
+	core->input = 0;
+	for (i = 0;
+	     i < (sizeof(core->board.input) / sizeof(struct cx88_input));
+	     i++) {
+		if (core->board.input[i].type == CX88_VMUX_DVB) {
+			core->input = i;
+			break;
+		}
+	}
 
 	if (drv->advise_acquire)
 	{
 		mutex_lock(&drv->core->lock);

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-27 12:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-27 12:47 [PATCH] cx88: fix setting input when using DVB istvan_v
  -- strict thread matches above, loose matches on Subject: below --
2010-03-27 12:45 istvan_v

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox