V4L/DVB (4259): Pass an explicit log prefix to cx2341x_log_status
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 26 Jun 2006 21:24:05 +0000 (18:24 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Tue, 27 Jun 2006 03:17:40 +0000 (00:17 -0300)
A card number is not unique enough. Instead, let the caller specify the
prefix of the status messages.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/cx2341x.c
drivers/media/video/cx88/cx88-blackbird.c
drivers/media/video/pvrusb2/pvrusb2-hdw.c
include/media/cx2341x.h

index c98740979b60ed79edb22bc6664ee9641a743244..65f00fc08fa961d5671ccfe5a3cf92aa38efb4ab 100644 (file)
@@ -847,22 +847,22 @@ invalid:
        return "<invalid>";
 }
 
-void cx2341x_log_status(struct cx2341x_mpeg_params *p, int card_id)
+void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix)
 {
        int is_mpeg1 = p->video_encoding == V4L2_MPEG_VIDEO_ENCODING_MPEG_1;
 
        /* Stream */
-       printk(KERN_INFO "cx2341x-%d: Stream: %s\n",
-               card_id,
+       printk(KERN_INFO "%s: Stream: %s\n",
+               prefix,
                cx2341x_menu_item(p, V4L2_CID_MPEG_STREAM_TYPE));
 
        /* Video */
-       printk(KERN_INFO "cx2341x-%d: Video:  %dx%d, %d fps\n",
-               card_id,
+       printk(KERN_INFO "%s: Video:  %dx%d, %d fps\n",
+               prefix,
                p->width / (is_mpeg1 ? 2 : 1), p->height / (is_mpeg1 ? 2 : 1),
                p->is_50hz ? 25 : 30);
-       printk(KERN_INFO "cx2341x-%d: Video:  %s, %s, %s, %d",
-               card_id,
+       printk(KERN_INFO "%s: Video:  %s, %s, %s, %d",
+               prefix,
                cx2341x_menu_item(p, V4L2_CID_MPEG_VIDEO_ENCODING),
                cx2341x_menu_item(p, V4L2_CID_MPEG_VIDEO_ASPECT),
                cx2341x_menu_item(p, V4L2_CID_MPEG_VIDEO_BITRATE_MODE),
@@ -871,19 +871,19 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, int card_id)
                printk(", Peak %d", p->video_bitrate_peak);
        }
        printk("\n");
-       printk(KERN_INFO "cx2341x-%d: Video:  GOP Size %d, %d B-Frames, %sGOP Closure, %s3:2 Pulldown\n",
-               card_id,
+       printk(KERN_INFO "%s: Video:  GOP Size %d, %d B-Frames, %sGOP Closure, %s3:2 Pulldown\n",
+               prefix,
                p->video_gop_size, p->video_b_frames,
                p->video_gop_closure ? "" : "No ",
                p->video_pulldown ? "" : "No ");
        if (p->video_temporal_decimation) {
-               printk(KERN_INFO "cx2341x-%d: Video: Temporal Decimation %d\n",
-                       card_id, p->video_temporal_decimation);
+               printk(KERN_INFO "%s: Video: Temporal Decimation %d\n",
+                       prefix, p->video_temporal_decimation);
        }
 
        /* Audio */
-       printk(KERN_INFO "cx2341x-%d: Audio:  %s, %s, %s, %s",
-               card_id,
+       printk(KERN_INFO "%s: Audio:  %s, %s, %s, %s",
+               prefix,
                cx2341x_menu_item(p, V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ),
                cx2341x_menu_item(p, V4L2_CID_MPEG_AUDIO_ENCODING),
                cx2341x_menu_item(p, V4L2_CID_MPEG_AUDIO_L2_BITRATE),
@@ -897,18 +897,18 @@ void cx2341x_log_status(struct cx2341x_mpeg_params *p, int card_id)
                cx2341x_menu_item(p, V4L2_CID_MPEG_AUDIO_CRC));
 
        /* Encoding filters */
-       printk(KERN_INFO "cx2341x-%d: Spatial Filter:  %s, Luma %s, Chroma %s, %d\n",
-               card_id,
+       printk(KERN_INFO "%s: Spatial Filter:  %s, Luma %s, Chroma %s, %d\n",
+               prefix,
                cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE),
                cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE),
                cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE),
                p->video_spatial_filter);
-       printk(KERN_INFO "cx2341x-%d: Temporal Filter: %s, %d\n",
-               card_id,
+       printk(KERN_INFO "%s: Temporal Filter: %s, %d\n",
+               prefix,
                cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE),
                p->video_temporal_filter);
-       printk(KERN_INFO "cx2341x-%d: Median Filter:   %s, Luma [%d, %d], Chroma [%d, %d]\n",
-               card_id,
+       printk(KERN_INFO "%s: Median Filter:   %s, Luma [%d, %d], Chroma [%d, %d]\n",
+               prefix,
                cx2341x_menu_item(p, V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE),
                p->video_luma_median_filter_bottom,
                p->video_luma_median_filter_top,
index a7893a6eb58e15e5f09ed4e2fd12bfe20838e907..4ff81582ec56ee5f71b17ec2e402c51730ce4698 100644 (file)
@@ -854,13 +854,18 @@ static int mpeg_do_ioctl(struct inode *inode, struct file *file,
                return 0;
        }
        case VIDIOC_LOG_STATUS:
+       {
+               char name[32 + 2];
+
+               snprintf(name, sizeof(name), "%s/2", core->name);
                printk("%s/2: ============  START LOG STATUS  ============\n",
                       core->name);
                cx88_call_i2c_clients(core, VIDIOC_LOG_STATUS, 0);
-               cx2341x_log_status(&dev->params, dev->mpeg_dev->minor);
+               cx2341x_log_status(&dev->params, name);
                printk("%s/2: =============  END LOG STATUS  =============\n",
                       core->name);
                return 0;
+       }
 
        default:
                return cx88_do_ioctl(inode, file, 0, dev->core, cmd, arg, mpeg_do_ioctl);
index 2fd40e061ccc9b643f908c5aba1b47ddc80d243c..643c471375da1233c9a427d78490664630f80a5a 100644 (file)
@@ -2407,7 +2407,7 @@ void pvr2_hdw_trigger_module_log(struct pvr2_hdw *hdw)
                hdw->log_requested = 0;
                pvr2_i2c_core_sync(hdw);
                pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:");
-               cx2341x_log_status(&hdw->enc_ctl_state,0);
+               cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2");
                printk(KERN_INFO "pvrusb2: ==================  END STATUS CARD #%d  ==================\n", nr);
        } while (0); LOCK_GIVE(hdw->big_lock);
 }
index e1cbf79741be5ba59beba80b2cad1ddb7265c78c..d91d88f93c8b3485e36f3c5bda8ed8dab31b905c 100644 (file)
@@ -91,7 +91,7 @@ const char **cx2341x_ctrl_get_menu(u32 id);
 int cx2341x_ext_ctrls(struct cx2341x_mpeg_params *params,
                struct v4l2_ext_controls *ctrls, unsigned int cmd);
 void cx2341x_fill_defaults(struct cx2341x_mpeg_params *p);
-void cx2341x_log_status(struct cx2341x_mpeg_params *p, int cardid);
+void cx2341x_log_status(struct cx2341x_mpeg_params *p, const char *prefix);
 
 /* Firmware names */
 #define CX2341X_FIRM_ENC_FILENAME "v4l-cx2341x-enc.fw"