Merge branch 'core/xen' into x86/xen
[safe/jmp/linux-2.6] / drivers / media / video / ks0127.c
index 3bf7ac4..2fd4b4a 100644 (file)
@@ -679,26 +679,27 @@ static int ks0127_command(struct i2c_client *client,
 
        case DECODER_ENABLE_OUTPUT:
        {
+               int enable;
 
-               int *iarg = arg;
-               int enable = (*iarg != 0);
-                       if (enable) {
-                               dprintk("ks0127: command "
+               iarg = arg;
+               enable = (*iarg != 0);
+               if (enable) {
+                       dprintk("ks0127: command "
                                        "DECODER_ENABLE_OUTPUT on "
                                        "(%d)\n", enable);
-                               /* All output pins on */
-                               ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30);
-                               /* Obey the OEN pin */
-                               ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00);
-                       } else {
-                               dprintk("ks0127: command "
+                       /* All output pins on */
+                       ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x30);
+                       /* Obey the OEN pin */
+                       ks0127_and_or(ks, KS_CDEM, 0x7f, 0x00);
+               } else {
+                       dprintk("ks0127: command "
                                        "DECODER_ENABLE_OUTPUT off "
                                        "(%d)\n", enable);
-                               /* Video output pins off */
-                               ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00);
-                               /* Ignore the OEN pin */
-                               ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80);
-                       }
+                       /* Video output pins off */
+                       ks0127_and_or(ks, KS_OFMTA, 0xcf, 0x00);
+                       /* Ignore the OEN pin */
+                       ks0127_and_or(ks, KS_CDEM, 0x7f, 0x80);
+               }
        }
                break;
 
@@ -712,13 +713,13 @@ static int ks0127_command(struct i2c_client *client,
                *iarg = 0;
                status = ks0127_read(ks, KS_STAT);
                if (!(status & 0x20))            /* NOVID not set */
-                       *iarg = (*iarg & DECODER_STATUS_GOOD);
+                       *iarg = (*iarg | DECODER_STATUS_GOOD);
                if ((status & 0x01))                  /* CLOCK set */
-                       *iarg = (*iarg & DECODER_STATUS_COLOR);
+                       *iarg = (*iarg | DECODER_STATUS_COLOR);
                if ((status & 0x08))               /* PALDET set */
-                       *iarg = (*iarg & DECODER_STATUS_PAL);
+                       *iarg = (*iarg | DECODER_STATUS_PAL);
                else
-                       *iarg = (*iarg & DECODER_STATUS_NTSC);
+                       *iarg = (*iarg | DECODER_STATUS_NTSC);
                break;
 
        //Catch any unknown command
@@ -764,7 +765,6 @@ static struct i2c_client ks0127_client_tmpl =
        .addr = 0,
        .adapter = NULL,
        .driver = &i2c_driver_ks0127,
-       .usage_count = 0
 };
 
 static int ks0127_found_proc(struct i2c_adapter *adapter, int addr, int kind)
@@ -832,8 +832,7 @@ static int ks0127_detach(struct i2c_client *client)
 static int __devinit ks0127_init_module(void)
 {
        init_reg_defaults();
-       i2c_add_driver(&i2c_driver_ks0127);
-       return 0;
+       return i2c_add_driver(&i2c_driver_ks0127);
 }
 
 static void __devexit ks0127_cleanup_module(void)