From patchwork Fri Oct 2 13:27:42 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean Delvare X-Patchwork-Id: 51364 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n92DRlgv021217 for ; Fri, 2 Oct 2009 13:27:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755451AbZJBN1m (ORCPT ); Fri, 2 Oct 2009 09:27:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755366AbZJBN1m (ORCPT ); Fri, 2 Oct 2009 09:27:42 -0400 Received: from poutre.nerim.net ([62.4.16.124]:65338 "EHLO poutre.nerim.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075AbZJBN1l (ORCPT ); Fri, 2 Oct 2009 09:27:41 -0400 Received: from localhost (localhost [127.0.0.1]) by poutre.nerim.net (Postfix) with ESMTP id 9753439DE65 for ; Fri, 2 Oct 2009 15:27:42 +0200 (CEST) X-Virus-Scanned: amavisd-new at nerim.net Received: from poutre.nerim.net ([127.0.0.1]) by localhost (poutre.nerim.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B6dxEEteKh5J for ; Fri, 2 Oct 2009 15:27:41 +0200 (CEST) Received: from hyperion.delvare (jdelvare.pck.nerim.net [62.212.121.182]) by poutre.nerim.net (Postfix) with ESMTP id 74B0439DE6C for ; Fri, 2 Oct 2009 15:27:41 +0200 (CEST) Date: Fri, 2 Oct 2009 15:27:42 +0200 From: Jean Delvare To: LMML Subject: [PATCH] ir-kbd-i2c: Don't reject unknown I2C addresses Message-ID: <20091002152742.7c3416bd@hyperion.delvare> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.14.4; i586-suse-linux-gnu) Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org --- v4l-dvb.orig/linux/drivers/media/video/ir-kbd-i2c.c 2009-10-02 14:52:33.000000000 +0200 +++ v4l-dvb/linux/drivers/media/video/ir-kbd-i2c.c 2009-10-02 14:58:33.000000000 +0200 @@ -373,7 +373,7 @@ static int ir_probe(struct i2c_client *c { struct ir_scancode_table *ir_codes = NULL; const char *name = NULL; - int ir_type; + int ir_type = 0; struct IR_i2c *ir; struct input_dev *input_dev; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) @@ -438,10 +438,8 @@ static int ir_probe(struct i2c_client *c ir_type = IR_TYPE_RC5; ir_codes = &ir_codes_fusionhdtv_mce_table; break; - case 0x7a: case 0x47: case 0x71: - case 0x2d: if (adap->id == I2C_HW_B_CX2388x || adap->id == I2C_HW_B_CX2341X) { /* Handled by cx88-input */ @@ -466,10 +464,6 @@ static int ir_probe(struct i2c_client *c ir_type = IR_TYPE_OTHER; ir_codes = &ir_codes_avermedia_cardbus_table; break; - default: - dprintk(1, DEVNAME ": Unsupported i2c address 0x%02x\n", addr); - err = -ENODEV; - goto err_out_free; } #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) @@ -513,7 +507,7 @@ static int ir_probe(struct i2c_client *c } /* Make sure we are all setup before going on */ - if (!name || !ir->get_key || !ir_codes) { + if (!name || !ir->get_key || !ir_type || !ir_codes) { dprintk(1, DEVNAME ": Unsupported device at address 0x%02x\n", addr); err = -ENODEV;