diff options
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c index 9023adf3fdcc..68980e19409f 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c +++ b/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c | |||
@@ -49,11 +49,13 @@ static const int routing_scheme1[] = { | |||
49 | [PVR2_CVAL_INPUT_SVIDEO] = 0, | 49 | [PVR2_CVAL_INPUT_SVIDEO] = 0, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | static const struct routing_scheme routing_schemes[] = { | 52 | static const struct routing_scheme routing_def1 = { |
53 | [PVR2_ROUTING_SCHEME_ONAIR] = { | 53 | .def = routing_scheme1, |
54 | .def = routing_scheme1, | 54 | .cnt = ARRAY_SIZE(routing_scheme1), |
55 | .cnt = ARRAY_SIZE(routing_scheme1), | 55 | }; |
56 | }, | 56 | |
57 | static const struct routing_scheme *routing_schemes[] = { | ||
58 | [PVR2_ROUTING_SCHEME_ONAIR] = &routing_def1, | ||
57 | }; | 59 | }; |
58 | 60 | ||
59 | 61 | ||
@@ -65,12 +67,11 @@ void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | |||
65 | u32 input; | 67 | u32 input; |
66 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", | 68 | pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", |
67 | hdw->input_val); | 69 | hdw->input_val); |
68 | if ((sid < ARRAY_SIZE(routing_schemes)) && | 70 | sp = (sid < ARRAY_SIZE(routing_schemes)) ? |
69 | ((sp = routing_schemes + sid) != NULL) && | 71 | routing_schemes[sid] : NULL; |
70 | (hdw->input_val >= 0) && | 72 | if ((sp == NULL) || |
71 | (hdw->input_val < sp->cnt)) { | 73 | (hdw->input_val < 0) || |
72 | input = sp->def[hdw->input_val]; | 74 | (hdw->input_val >= sp->cnt)) { |
73 | } else { | ||
74 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, | 75 | pvr2_trace(PVR2_TRACE_ERROR_LEGS, |
75 | "*** WARNING *** subdev v4l2 set_input:" | 76 | "*** WARNING *** subdev v4l2 set_input:" |
76 | " Invalid routing scheme (%u)" | 77 | " Invalid routing scheme (%u)" |
@@ -78,6 +79,7 @@ void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) | |||
78 | sid, hdw->input_val); | 79 | sid, hdw->input_val); |
79 | return; | 80 | return; |
80 | } | 81 | } |
82 | input = sp->def[hdw->input_val]; | ||
81 | sd->ops->audio->s_routing(sd, input, 0, 0); | 83 | sd->ops->audio->s_routing(sd, input, 0, 0); |
82 | } | 84 | } |
83 | } | 85 | } |