]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/ir-kbd-i2c.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / drivers / media / video / ir-kbd-i2c.c
index 11c5fdedc23bc341fb82ab4459d42b53bcab9a5f..7b65f5e537f803355593a85cf73b984843d851c3 100644 (file)
@@ -509,8 +509,11 @@ static int ir_probe(struct i2c_adapter *adap)
        static const int probe_cx88[] = { 0x18, 0x6b, 0x71, -1 };
        static const int probe_cx23885[] = { 0x6b, -1 };
        const int *probe;
-       struct i2c_client *c;
-       unsigned char buf;
+       struct i2c_msg msg = {
+               .flags = I2C_M_RD,
+               .len = 0,
+               .buf = NULL,
+       };
        int i, rc;
 
        switch (adap->id) {
@@ -536,23 +539,17 @@ static int ir_probe(struct i2c_adapter *adap)
                return 0;
        }
 
-       c = kzalloc(sizeof(*c), GFP_KERNEL);
-       if (!c)
-               return -ENOMEM;
-
-       c->adapter = adap;
        for (i = 0; -1 != probe[i]; i++) {
-               c->addr = probe[i];
-               rc = i2c_master_recv(c, &buf, 0);
+               msg.addr = probe[i];
+               rc = i2c_transfer(adap, &msg, 1);
                dprintk(1,"probe 0x%02x @ %s: %s\n",
                        probe[i], adap->name,
-                       (0 == rc) ? "yes" : "no");
-               if (0 == rc) {
+                       (1 == rc) ? "yes" : "no");
+               if (1 == rc) {
                        ir_attach(adap, probe[i], 0, 0);
                        break;
                }
        }
-       kfree(c);
        return 0;
 }