aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 10:40:19 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-23 10:40:19 -0700
commit135aae340d66c5e273af297bbd5178a5e5c458ee (patch)
tree7301bfc6a1c85e74788a2fbcc36eb5b78122df31 /drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
parent811e42cfba334d27797989ac8b0bea4981cb9581 (diff)
parenteebf8d86acf0db974dfaad8e8285f4e12ca488e2 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6: (62 commits) V4L/DVB (12131): BUGFIX: An incorrect Carrier Recovery Loop optimization table was being V4L/DVB (12130): Fix a redundant compiler warning V4L/DVB (12003): v4l2: Move bounding code outside I2C ifdef block V4L/DVB (11913): cx231xx: TRY_FMT should not actually set anything V4L/DVB (11912): em28xx: Use v4l bounding/alignment function V4L/DVB (11911): cx231xx: Use v4l bounding/alignment function V4L/DVB (11910): mt9: Use v4l bounding/alignment function V4L/DVB (11909): cx23885: Use v4l bounding/alignment function V4L/DVB (11908): w8968cf: Use v4l bounding/alignment function V4L/DVB (11907): cx88: Use v4l bounding/alignment function V4L/DVB (11906): saa7134: Use v4l bounding/alignment function V4L/DVB (11905): vivi: Use v4l bounding/alignment function V4L/DVB (11904): zoran: Use v4l bounding/alignment functiob V4L/DVB (11903): sh_mobile_ceu_camera: Use v4l bounding/alignment function V4L/DVB (11902): pxa-camera: Use v4l bounding/alignment function V4L/DVB (11901): v4l2: Create helper function for bounding and aligning images V4L/DVB (12128): v4l2: update framework documentation. V4L/DVB (12125): v4l2: add new s_config subdev ops and v4l2_i2c_new_subdev_cfg/board calls V4L/DVB (12122): pvrusb2: De-obfuscate code which handles routing schemes V4L/DVB (12121): pvrusb2: Improve handling of routing schemes ...
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c')
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c37
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
index 05e52358ae4..82c13583575 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c
@@ -68,6 +68,11 @@ static const struct routing_scheme_item routing_scheme0[] = {
},
};
+static const struct routing_scheme routing_def0 = {
+ .def = routing_scheme0,
+ .cnt = ARRAY_SIZE(routing_scheme0),
+};
+
/* Specific to gotview device */
static const struct routing_scheme_item routing_schemegv[] = {
[PVR2_CVAL_INPUT_TV] = {
@@ -90,15 +95,14 @@ static const struct routing_scheme_item routing_schemegv[] = {
},
};
-static const struct routing_scheme routing_schemes[] = {
- [PVR2_ROUTING_SCHEME_HAUPPAUGE] = {
- .def = routing_scheme0,
- .cnt = ARRAY_SIZE(routing_scheme0),
- },
- [PVR2_ROUTING_SCHEME_GOTVIEW] = {
- .def = routing_schemegv,
- .cnt = ARRAY_SIZE(routing_schemegv),
- },
+static const struct routing_scheme routing_defgv = {
+ .def = routing_schemegv,
+ .cnt = ARRAY_SIZE(routing_schemegv),
+};
+
+static const struct routing_scheme *routing_schemes[] = {
+ [PVR2_ROUTING_SCHEME_HAUPPAUGE] = &routing_def0,
+ [PVR2_ROUTING_SCHEME_GOTVIEW] = &routing_defgv,
};
void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
@@ -110,13 +114,11 @@ void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
const struct routing_scheme *sp;
unsigned int sid = hdw->hdw_desc->signal_routing_scheme;
- if ((sid < ARRAY_SIZE(routing_schemes)) &&
- ((sp = routing_schemes + sid) != NULL) &&
- (hdw->input_val >= 0) &&
- (hdw->input_val < sp->cnt)) {
- vid_input = sp->def[hdw->input_val].vid;
- aud_input = sp->def[hdw->input_val].aud;
- } else {
+ sp = (sid < ARRAY_SIZE(routing_schemes)) ?
+ routing_schemes[sid] : NULL;
+ if ((sp == NULL) ||
+ (hdw->input_val < 0) ||
+ (hdw->input_val >= sp->cnt)) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"*** WARNING *** subdev cx2584x set_input:"
" Invalid routing scheme (%u)"
@@ -124,7 +126,8 @@ void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd)
sid, hdw->input_val);
return;
}
-
+ vid_input = sp->def[hdw->input_val].vid;
+ aud_input = sp->def[hdw->input_val].aud;
pvr2_trace(PVR2_TRACE_CHIPS,
"subdev cx2584x set_input vid=0x%x aud=0x%x",
vid_input, aud_input);