From patchwork Thu May 27 02:31:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor M. Liplianin" X-Patchwork-Id: 102553 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4R2VUlG019616 for ; Thu, 27 May 2010 02:31:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754089Ab0E0CbS (ORCPT ); Wed, 26 May 2010 22:31:18 -0400 Received: from fg-out-1718.google.com ([72.14.220.155]:9590 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753101Ab0E0CbR (ORCPT ); Wed, 26 May 2010 22:31:17 -0400 Received: by fg-out-1718.google.com with SMTP id d23so3109613fga.1 for ; Wed, 26 May 2010 19:31:16 -0700 (PDT) Received: by 10.204.84.23 with SMTP id h23mr3743950bkl.141.1274927476296; Wed, 26 May 2010 19:31:16 -0700 (PDT) Received: from useri.localnet ([212.98.173.132]) by mx.google.com with ESMTPS id h21sm3195130bkh.17.2010.05.26.19.31.15 (version=SSLv3 cipher=RC4-MD5); Wed, 26 May 2010 19:31:15 -0700 (PDT) To: linux-media@vger.kernel.org Subject: [PATCH] Bug fix: make IR work again for dm1105. From: "Igor M. Liplianin" Date: Thu, 27 May 2010 05:31:21 +0300 MIME-Version: 1.0 Message-Id: <201005270531.21919.liplianin@me.by> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 27 May 2010 02:31:30 +0000 (UTC) diff --git a/linux/drivers/media/IR/ir-keytable.c b/linux/drivers/media/IR/ir-keytable.c --- a/linux/drivers/media/IR/ir-keytable.c +++ b/linux/drivers/media/IR/ir-keytable.c @@ -491,11 +491,12 @@ if (rc < 0) goto out_table; - if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) { - rc = ir_raw_event_register(input_dev); - if (rc < 0) - goto out_event; - } + if (ir_dev->props) + if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) { + rc = ir_raw_event_register(input_dev); + if (rc < 0) + goto out_event; + } IR_dprintk(1, "Registered input device on %s for %s remote.\n", driver_name, rc_tab->name); @@ -531,8 +532,10 @@ IR_dprintk(1, "Freed keycode table\n"); del_timer_sync(&ir_dev->timer_keyup); - if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) - ir_raw_event_unregister(input_dev); + if (ir_dev->props) + if (ir_dev->props->driver_type == RC_DRIVER_IR_RAW) + ir_raw_event_unregister(input_dev); + rc_tab = &ir_dev->rc_tab; rc_tab->size = 0; kfree(rc_tab->scan); diff --git a/linux/drivers/media/IR/ir-sysfs.c b/linux/drivers/media/IR/ir-sysfs.c --- a/linux/drivers/media/IR/ir-sysfs.c +++ b/linux/drivers/media/IR/ir-sysfs.c @@ -222,9 +222,10 @@ if (unlikely(devno < 0)) return devno; - if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) - ir_dev->dev.type = &rc_dev_type; - else + if (ir_dev->props) { + if (ir_dev->props->driver_type == RC_DRIVER_SCANCODE) + ir_dev->dev.type = &rc_dev_type; + } else ir_dev->dev.type = &ir_raw_dev_type; ir_dev->dev.class = &ir_input_class; diff --git a/linux/drivers/media/dvb/dm1105/dm1105.c b/linux/drivers/media/dvb/dm1105/dm1105.c --- a/linux/drivers/media/dvb/dm1105/dm1105.c +++ b/linux/drivers/media/dvb/dm1105/dm1105.c @@ -616,7 +616,7 @@ int __devinit dm1105_ir_init(struct dm1105_dev *dm1105) { struct input_dev *input_dev; - char *ir_codes = NULL; + char *ir_codes = RC_MAP_DM1105_NEC; int err = -ENOMEM; input_dev = input_allocate_device();