include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / media / video / pvrusb2 / pvrusb2-cx2584x-v4l.c
index 05e5235..2222da8 100644 (file)
@@ -36,7 +36,6 @@
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
 #include <linux/errno.h>
-#include <linux/slab.h>
 
 
 struct routing_scheme_item {
@@ -68,6 +67,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 +94,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 +113,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 +125,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);