]> err.no Git - linux-2.6/blobdiff - drivers/media/video/pvrusb2/pvrusb2-ioread.c
V4L/DVB (7779): pvrusb2-dvb: quiet down noise in kernel log for feed debug
[linux-2.6] / drivers / media / video / pvrusb2 / pvrusb2-ioread.c
index f7a2e225a002543287f171d00a91589b0877bcb6..c572212c9f158feddba21f5757ad8018016a73a5 100644 (file)
@@ -87,10 +87,9 @@ static void pvr2_ioread_done(struct pvr2_ioread *cp)
 struct pvr2_ioread *pvr2_ioread_create(void)
 {
        struct pvr2_ioread *cp;
-       cp = kmalloc(sizeof(*cp),GFP_KERNEL);
+       cp = kzalloc(sizeof(*cp),GFP_KERNEL);
        if (!cp) return NULL;
        pvr2_trace(PVR2_TRACE_STRUCT,"pvr2_ioread_create id=%p",cp);
-       memset(cp,0,sizeof(*cp));
        if (pvr2_ioread_init(cp) < 0) {
                kfree(cp);
                return NULL;
@@ -166,7 +165,7 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp)
        if (!(cp->stream)) return 0;
        pvr2_trace(PVR2_TRACE_START_STOP,
                   "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp);
-       while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != 0) {
+       while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) {
                stat = pvr2_buffer_queue(bp);
                if (stat < 0) {
                        pvr2_trace(PVR2_TRACE_DATA_FLOW,
@@ -213,7 +212,9 @@ int pvr2_ioread_setup(struct pvr2_ioread *cp,struct pvr2_stream *sp)
                                   " pvr2_ioread_setup (tear-down) id=%p",cp);
                        pvr2_ioread_stop(cp);
                        pvr2_stream_kill(cp->stream);
-                       pvr2_stream_set_buffer_count(cp->stream,0);
+                       if (pvr2_stream_get_buffer_count(cp->stream)) {
+                               pvr2_stream_set_buffer_count(cp->stream,0);
+                       }
                        cp->stream = NULL;
                }
                if (sp) {
@@ -251,7 +252,6 @@ int pvr2_ioread_set_enabled(struct pvr2_ioread *cp,int fl)
        return ret;
 }
 
-
 static int pvr2_ioread_get_buffer(struct pvr2_ioread *cp)
 {
        int stat;