diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 37 |
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 05e52358ae49..82c135835753 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[] = { | |||
68 | }, | 68 | }, |
69 | }; | 69 | }; |
70 | 70 | ||
71 | static const struct routing_scheme routing_def0 = { | ||
72 | .def = routing_scheme0, | ||
73 | .cnt = ARRAY_SIZE(routing_scheme0), | ||
74 | }; | ||
75 | |||
71 | /* Specific to gotview device */ | 76 | /* Specific to gotview device */ |
72 | static const struct routing_scheme_item routing_schemegv[] = { | 77 | static const struct routing_scheme_item routing_schemegv[] = { |
73 | [PVR2_CVAL_INPUT_TV] = { | 78 | [PVR2_CVAL_INPUT_TV] = { |
@@ -90,15 +95,14 @@ static const struct routing_scheme_item routing_schemegv[] = { | |||
90 | }, | 95 | }, |
91 | }; | 96 | }; |
92 | 97 | ||
93 | static const struct routing_scheme routing_schemes[] = { | 98 | static const struct routing_scheme routing_defgv = { |
94 | [PVR2_ROUTING_SCHEME_HAUPPAUGE] = { | 99 | .def = routing_schemegv, |
95 | .def = routing_scheme0, | 100 | .cnt = ARRAY_SIZE(routing_schemegv), |
96 | .cnt = ARRAY_SIZE(routing_scheme0), | 101 | }; |
97 | }, | 102 | |
98 | [PVR2_ROUTING_SCHEME_GOTVIEW] = { | 103 | static const struct routing_scheme *routing_schemes[] = { |
99 | .def = routing_schemegv, | 104 | [PVR2_ROUTING_SCHEME_HAUPPAUGE] = &routing_def0, |
100 | .cnt = ARRAY_SIZE(routing_schemegv), | 105 | [PVR2_ROUTING_SCHEME_GOTVIEW] = &routing_defgv, |
101 | }, | ||
102 | }; | 106 | }; |
103 | 107 | ||
104 | void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | 108 | 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) | |||
110 | const struct routing_scheme *sp; | 114 | const struct routing_scheme *sp; |
111 | unsigned int sid = hdw->hdw_desc->signal_routing_scheme; | 115 | unsigned int sid = hdw->hdw_desc->signal_routing_scheme; |
112 | 116 | ||
113 | if ((sid < ARRAY_SIZE(routing_schemes)) && | 117 | sp = (sid < ARRAY_SIZE(routing_schemes)) ? |
114 | ((sp = routing_schemes + sid) != NULL) && | 118 | routing_schemes[sid] : NULL; |
115 | (hdw->input_val >= 0) && | 119 | if ((sp == NULL) || |
116 | (hdw->input_val < sp->cnt)) { | 120 | (hdw->input_val < 0) || |
117 | vid_input = sp->def[hdw->input_val].vid; | 121 | (hdw->input_val >= sp->cnt)) { |
118 | aud_input = sp->def[hdw->input_val].aud; | ||
119 | } else { | ||
120 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | 122 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
121 | "*** WARNING *** subdev cx2584x set_input:" | 123 | "*** WARNING *** subdev cx2584x set_input:" |
122 | " Invalid routing scheme (%u)" | 124 | " Invalid routing scheme (%u)" |
@@ -124,7 +126,8 @@ void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | |||
124 | sid, hdw->input_val); | 126 | sid, hdw->input_val); |
125 | return; | 127 | return; |
126 | } | 128 | } |
127 | 129 | vid_input = sp->def[hdw->input_val].vid; | |
130 | aud_input = sp->def[hdw->input_val].aud; | ||
128 | pvr2_trace(PVR2_TRACE_CHIPS, | 131 | pvr2_trace(PVR2_TRACE_CHIPS, |
129 | "subdev cx2584x set_input vid=0x%x aud=0x%x", | 132 | "subdev cx2584x set_input vid=0x%x aud=0x%x", |
130 | vid_input, aud_input); | 133 | vid_input, aud_input); |