vserver 2.0 rc7
[linux-2.6.git] / drivers / media / video / tda9840.c
index c043898..b5177c6 100644 (file)
@@ -51,9 +51,6 @@ I2C_CLIENT_INSMOD;
 static struct i2c_driver driver;
 static struct i2c_client client_template;
 
-/* unique ID allocation */
-static int tda9840_id = 0;
-
 static int command(struct i2c_client *client, unsigned int cmd, void *arg)
 {
        int result;
@@ -120,7 +117,8 @@ static int command(struct i2c_client *client, unsigned int cmd, void *arg)
                        dprintk("i2c_smbus_write_byte() failed, ret:%d\n", result);
                break;
 
-       case TDA9840_DETECT:
+       case TDA9840_DETECT: {
+               int *ret = (int *)arg;
 
                byte = i2c_smbus_read_byte_data(client, STEREO_ADJUST);
                if (byte == -1) {
@@ -134,8 +132,10 @@ static int command(struct i2c_client *client, unsigned int cmd, void *arg)
                }
 
                dprintk("TDA9840_DETECT: byte: 0x%02x\n", byte);
-               return ((byte & 0x60) >> 5);
-
+               *ret = ((byte & 0x60) >> 5);
+               result = 0;
+               break;
+       }
        case TDA9840_TEST:
                dprintk("TDA9840_TEST: 0x%02x\n", byte);
 
@@ -179,7 +179,6 @@ static int detect(struct i2c_adapter *adapter, int address, int kind)
 
        /* fill client structure */
        memcpy(client, &client_template, sizeof(struct i2c_client));
-       client->id = tda9840_id++;
        client->addr = address;
        client->adapter = adapter;