summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/gspca/pac_common.h
diff options
context:
space:
mode:
authorMarton Nemeth <nm127@freemail.hu>2009-11-02 12:05:51 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 21:41:15 +0100
commita6b69e409a41144c24dcbecdc174a5c847631de2 (patch)
treee92a3b7fdef8fe4e453645ce84ff9753194c4951 /drivers/media/video/gspca/pac_common.h
parentV4L/DVB (13297): dib0700_devices: EvolutePC TvWay+ USB ISDB-Tb remote control... (diff)
downloadlinux-a6b69e409a41144c24dcbecdc174a5c847631de2.tar.xz
linux-a6b69e409a41144c24dcbecdc174a5c847631de2.zip
V4L/DVB (13298): gspca - pac207/pac7311/mr97310a: Simplify pac_find_sof.
Remove struct sd dependency from pac_find_sof() function implementation. This step prepares separation of pac7302 and pac7311 specific parts of struct sd. Signed-off-by: Marton Nemeth <nm127@freemail.hu> Signed-off-by: Jean-Francois Moine <moinejf@free.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/gspca/pac_common.h')
-rw-r--r--drivers/media/video/gspca/pac_common.h27
1 files changed, 13 insertions, 14 deletions
diff --git a/drivers/media/video/gspca/pac_common.h b/drivers/media/video/gspca/pac_common.h
index d3006539fb82..20f67d9b8c06 100644
--- a/drivers/media/video/gspca/pac_common.h
+++ b/drivers/media/video/gspca/pac_common.h
@@ -72,42 +72,41 @@ static const unsigned char pac_sof_marker[5] =
+----------+
*/
-static unsigned char *pac_find_sof(struct gspca_dev *gspca_dev,
+static unsigned char *pac_find_sof(u8 *sof_read,
unsigned char *m, int len)
{
- struct sd *sd = (struct sd *) gspca_dev;
int i;
/* Search for the SOF marker (fixed part) in the header */
for (i = 0; i < len; i++) {
- switch (sd->sof_read) {
+ switch (*sof_read) {
case 0:
if (m[i] == 0xff)
- sd->sof_read = 1;
+ *sof_read = 1;
break;
case 1:
if (m[i] == 0xff)
- sd->sof_read = 2;
+ *sof_read = 2;
else
- sd->sof_read = 0;
+ *sof_read = 0;
break;
case 2:
switch (m[i]) {
case 0x00:
- sd->sof_read = 3;
+ *sof_read = 3;
break;
case 0xff:
/* stay in this state */
break;
default:
- sd->sof_read = 0;
+ *sof_read = 0;
}
break;
case 3:
if (m[i] == 0xff)
- sd->sof_read = 4;
+ *sof_read = 4;
else
- sd->sof_read = 0;
+ *sof_read = 0;
break;
case 4:
switch (m[i]) {
@@ -117,18 +116,18 @@ static unsigned char *pac_find_sof(struct gspca_dev *gspca_dev,
"SOF found, bytes to analyze: %u."
" Frame starts at byte #%u",
len, i + 1);
- sd->sof_read = 0;
+ *sof_read = 0;
return m + i + 1;
break;
case 0xff:
- sd->sof_read = 2;
+ *sof_read = 2;
break;
default:
- sd->sof_read = 0;
+ *sof_read = 0;
}
break;
default:
- sd->sof_read = 0;
+ *sof_read = 0;
}
}