V4L/DVB (13226): pvrusb2: Add hardware description to debuginfo output
[safe/jmp/linux-2.6] / drivers / media / video / pvrusb2 / pvrusb2-hdw.c
index 13639b3..1bfa9b9 100644 (file)
@@ -2030,7 +2030,8 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
        fname = (mid < ARRAY_SIZE(module_names)) ? module_names[mid] : NULL;
        if (!fname) {
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
-                          "Module ID %u for device %s has no name",
+                          "Module ID %u for device %s has no name?"
+                          "  The driver might have a configuration problem.",
                           mid,
                           hdw->hdw_desc->description);
                return -EINVAL;
@@ -2058,7 +2059,8 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
        if (!i2ccnt) {
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
                           "Module ID %u (%s) for device %s:"
-                          " No i2c addresses",
+                          " No i2c addresses."
+                          "  The driver might have a configuration problem.",
                           mid, fname, hdw->hdw_desc->description);
                return -EINVAL;
        }
@@ -2090,7 +2092,9 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
 
        if (!sd) {
                pvr2_trace(PVR2_TRACE_ERROR_LEGS,
-                          "Module ID %u (%s) for device %s failed to load",
+                          "Module ID %u (%s) for device %s failed to load."
+                          "  Possible missing sub-device kernel module or"
+                          " initialization failure within module.",
                           mid, fname, hdw->hdw_desc->description);
                return -EIO;
        }
@@ -2132,7 +2136,10 @@ static void pvr2_hdw_load_modules(struct pvr2_hdw *hdw)
        for (idx = 0; idx < ct->cnt; idx++) {
                if (pvr2_hdw_load_subdev(hdw, &ct->lst[idx]) < 0) okFl = 0;
        }
-       if (!okFl) pvr2_hdw_render_useless(hdw);
+       if (!okFl) {
+               hdw->flag_modulefail = !0;
+               pvr2_hdw_render_useless(hdw);
+       }
 }
 
 
@@ -2334,6 +2341,19 @@ static void pvr2_hdw_setup(struct pvr2_hdw *hdw)
                                break;
                        }
                }
+               if (hdw->flag_modulefail) {
+                       pvr2_trace(
+                               PVR2_TRACE_ERROR_LEGS,
+                               "***WARNING*** pvrusb2 driver initialization"
+                               " failed due to the failure of one or more"
+                               " sub-device kernel modules.");
+                       pvr2_trace(
+                               PVR2_TRACE_ERROR_LEGS,
+                               "You need to resolve the failing condition"
+                               " before this driver can function.  There"
+                               " should be some earlier messages giving more"
+                               " information about the problem.");
+               }
                if (procreload) {
                        pvr2_trace(
                                PVR2_TRACE_ERROR_LEGS,
@@ -2419,6 +2439,8 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
        hdw = kzalloc(sizeof(*hdw),GFP_KERNEL);
        pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"",
                   hdw,hdw_desc->description);
+       pvr2_trace(PVR2_TRACE_INFO, "Hardware description attached: %s",
+               hdw_desc->description);
        if (!hdw) goto fail;
 
        init_timer(&hdw->quiescent_timer);