summaryrefslogtreecommitdiff
path: root/drivers/media/video/ir-kbd-i2c.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 09:49:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 09:49:51 -0700
commitc837c93a03be711dd6e09215b74b4f23bbd1ff83 (patch)
tree4b3ffe42eea9c9b3af8eee916345c65a0334edfc /drivers/media/video/ir-kbd-i2c.c
parentd485cb9aa2e302fac7e7fb586a0cb4c0a5211be9 (diff)
parent37c45df740f79c58bb0fc0de151fd2504234032b (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: V4L/DVB (7751): ir-kbd-i2c: Save a temporary memory allocation in ir_probe V4L/DVB (7750): au0828/ cleanups and fixes V4L/DVB (7748): tuner-core: some adjustments at tuner logs, if debug enabled V4L/DVB (7746): pvrusb2: make signed one-bit bitfields unsigned V4L/DVB (7744): pvrusb2-dvb: add atsc/qam support for Hauppauge pvrusb2 model 751xx V4L/DVB (7742): cx88: Add support for the DViCO FusionHDTV_7_GOLD digital modes V4L/DVB (7741): s5h1411: Adding support for this ATSC/QAM demodulator V4L/DVB (7740): tuner-xc2028.c dubious !x & y V4L/DVB (7739): mt312.h: dubious one-bit signed bitfield V4L/DVB (7735): Fix compilation for au0828 V4L/DVB (7734): em28xx: copy and paste error in em28xx_init_isoc V4L/DVB (7733): blackbird_find_mailbox negative return ignored in blackbird_initialize_codec() V4L/DVB (7732): vivi: fix a warning
Diffstat (limited to 'drivers/media/video/ir-kbd-i2c.c')
-rw-r--r--drivers/media/video/ir-kbd-i2c.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index 11c5fdedc23b..7b65f5e537f8 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -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;
}