]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/stradis.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / video / stradis.c
index 54fc33011ffb4b1b1b03cea41bea8b04eaa77c46..c18b31d9928c8d59f1e60906db240352dc105a65 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
  * stradis.c - stradis 4:2:2 mpeg decoder driver
  *
  * Stradis 4:2:2 MPEG-2 Decoder Driver
@@ -42,6 +42,7 @@
 #include <asm/uaccess.h>
 #include <linux/vmalloc.h>
 #include <linux/videodev.h>
+#include <media/v4l2-common.h>
 
 #include "saa7146.h"
 #include "saa7146reg.h"
@@ -1191,9 +1192,9 @@ static void saa7146_set_winsize(struct saa7146 *saa)
 }
 
 /* clip_draw_rectangle(cm,x,y,w,h) -- handle clipping an area
- * bitmap is fixed width, 128 bytes (1024 pixels represented) 
- * arranged most-sigificant-bit-left in 32-bit words 
- * based on saa7146 clipping hardware, it swaps bytes if LE 
+ * bitmap is fixed width, 128 bytes (1024 pixels represented)
+ * arranged most-sigificant-bit-left in 32-bit words
+ * based on saa7146 clipping hardware, it swaps bytes if LE
  * much of this makes up for egcs brain damage -- so if you
  * are wondering "why did he do this?" it is because the C
  * was adjusted to generate the optimal asm output without
@@ -1259,7 +1260,7 @@ static void make_clip_tab(struct saa7146 *saa, struct video_clip *cr, int ncr)
                        clip_draw_rectangle(clipmap, cr[i].x, cr[i].y,
                                cr[i].width, cr[i].height);
        }
-       /* clip against viewing window AND screen 
+       /* clip against viewing window AND screen
           so we do not have to rely on the user program
         */
        clip_draw_rectangle(clipmap, (saa->win.x + width > saa->win.swidth) ?
@@ -2012,7 +2013,6 @@ static int __devinit init_saa7146(struct pci_dev *pdev)
 {
        struct saa7146 *saa = pci_get_drvdata(pdev);
 
-       memset(saa, 0, sizeof(*saa));
        saa->user = 0;
        /* reset the saa7146 */
        saawrite(0xffff0000, SAA7146_MC1);
@@ -2062,16 +2062,16 @@ static int __devinit init_saa7146(struct pci_dev *pdev)
        }
        if (saa->audbuf == NULL && (saa->audbuf = vmalloc(65536)) == NULL) {
                dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr);
-               goto errvid;
+               goto errfree;
        }
        if (saa->osdbuf == NULL && (saa->osdbuf = vmalloc(131072)) == NULL) {
                dev_err(&pdev->dev, "%d: malloc failed\n", saa->nr);
-               goto erraud;
+               goto errfree;
        }
        /* allocate 81920 byte buffer for clipping */
        if ((saa->dmavid2 = kzalloc(VIDEO_CLIPMAP_SIZE, GFP_KERNEL)) == NULL) {
                dev_err(&pdev->dev, "%d: clip kmalloc failed\n", saa->nr);
-               goto errosd;
+               goto errfree;
        }
        /* setup clipping registers */
        saawrite(virt_to_bus(saa->dmavid2), SAA7146_BASE_EVEN2);
@@ -2085,15 +2085,11 @@ static int __devinit init_saa7146(struct pci_dev *pdev)
        I2CBusScan(saa);
 
        return 0;
-errosd:
+errfree:
        vfree(saa->osdbuf);
-       saa->osdbuf = NULL;
-erraud:
        vfree(saa->audbuf);
-       saa->audbuf = NULL;
-errvid:
        vfree(saa->vidbuf);
-       saa->vidbuf = NULL;
+       saa->audbuf = saa->osdbuf = saa->vidbuf = NULL;
 err:
        return -ENOMEM;
 }
@@ -2194,7 +2190,7 @@ static struct pci_driver stradis_driver = {
        .remove = __devexit_p(stradis_remove)
 };
 
-int __init stradis_init(void)
+static int __init stradis_init(void)
 {
        int retval;
 
@@ -2207,7 +2203,7 @@ int __init stradis_init(void)
        return retval;
 }
 
-void __exit stradis_exit(void)
+static void __exit stradis_exit(void)
 {
        pci_unregister_driver(&stradis_driver);
        printk(KERN_INFO "stradis: module cleanup complete\n");