Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / media / video / hexium_gemini.c
index 885e504..c7fed34 100644 (file)
@@ -1,9 +1,9 @@
 /*
     hexium_gemini.c - v4l2 driver for Hexium Gemini frame grabber cards
-               
+
     Visit http://www.mihu.de/linux/saa7146/ and follow the link
     to "hexium" for further details about this card.
-    
+
     Copyright (C) 2003 Michael Hunold <michael@mihu.de>
 
     This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
 #include <media/saa7146_vv.h>
 
 static int debug = 0;
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "debug verbosity");
 
 /* global variables */
@@ -78,9 +78,10 @@ static struct v4l2_queryctrl hexium_controls[] = {
 struct hexium
 {
        int type;
-       struct video_device     video_dev;
+
+       struct video_device     *video_dev;
        struct i2c_adapter      i2c_adapter;
-               
+
        int             cur_input;      /* current input */
        v4l2_std_id     cur_std;        /* current standard */
        int             cur_bw;         /* current black/white status */
@@ -173,7 +174,7 @@ static struct saa7146_standard hexium_standards[] = {
                .h_offset       = 1,    .h_pixels       = 720,
                .v_max_out      = 576,  .h_max_out      = 768,
        }
-};             
+};
 
 /* bring hardware to a sane state. this has to be done, just in case someone
    wants to capture from this device before it has been properly initialized.
@@ -239,18 +240,21 @@ static int hexium_attach(struct saa7146_dev *dev, struct saa7146_pci_extension_d
 
        DEB_EE((".\n"));
 
-       hexium = (struct hexium *) kmalloc(sizeof(struct hexium), GFP_KERNEL);
+       hexium = kzalloc(sizeof(struct hexium), GFP_KERNEL);
        if (NULL == hexium) {
                printk("hexium_gemini: not enough kernel memory in hexium_attach().\n");
                return -ENOMEM;
        }
-       memset(hexium, 0x0, sizeof(struct hexium));
        dev->ext_priv = hexium;
 
        /* enable i2c-port pins */
        saa7146_write(dev, MC1, (MASK_08 | MASK_24 | MASK_10 | MASK_26));
 
-       saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, I2C_CLASS_TV_ANALOG, SAA7146_I2C_BUS_BIT_RATE_480);
+       hexium->i2c_adapter = (struct i2c_adapter) {
+               .class = I2C_CLASS_TV_ANALOG,
+               .name = "hexium gemini",
+       };
+       saa7146_i2c_adapter_prepare(dev, &hexium->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480);
        if (i2c_add_adapter(&hexium->i2c_adapter) < 0) {
                DEB_S(("cannot register i2c-device. skipping.\n"));
                kfree(hexium);
@@ -307,7 +311,7 @@ static int hexium_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)
        struct saa7146_dev *dev = fh->dev;
        struct hexium *hexium = (struct hexium *) dev->ext_priv;
 /*
-       struct saa7146_vv *vv = dev->vv_data; 
+       struct saa7146_vv *vv = dev->vv_data;
 */
        switch (cmd) {
        case VIDIOC_ENUMINPUT: