From patchwork Thu Jan 6 19:57:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 460291 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p06Jw89t021659 for ; Thu, 6 Jan 2011 19:58:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752092Ab1AFT5t (ORCPT ); Thu, 6 Jan 2011 14:57:49 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52697 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952Ab1AFT5r (ORCPT ); Thu, 6 Jan 2011 14:57:47 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p06Jvl6g023684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Jan 2011 14:57:47 -0500 Received: from xeratul.lab.bos.redhat.com (amd-tyan2915-01.lab.eng.bos.redhat.com [10.16.42.12]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p06JvUFe019727; Thu, 6 Jan 2011 14:57:47 -0500 From: Jarod Wilson To: linux-media@vger.kernel.org Cc: Jarod Wilson Subject: [PATCH 1/6] rc/imon: fix ffdc device detection oops Date: Thu, 6 Jan 2011 14:57:14 -0500 Message-Id: <1294343839-31784-2-git-send-email-jarod@redhat.com> In-Reply-To: <1294343839-31784-1-git-send-email-jarod@redhat.com> References: <1294343839-31784-1-git-send-email-jarod@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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.6 (demeter1.kernel.org [140.211.167.41]); Thu, 06 Jan 2011 19:58:09 +0000 (UTC) diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c index 6811512..a30bd99 100644 --- a/drivers/media/rc/imon.c +++ b/drivers/media/rc/imon.c @@ -1756,7 +1756,6 @@ static void imon_get_ffdc_type(struct imon_context *ictx) printk(KERN_CONT " (id 0x%02x)\n", ffdc_cfg_byte); ictx->display_type = detected_display_type; - ictx->rdev->allowed_protos = allowed_protos; ictx->rc_type = allowed_protos; } @@ -1839,10 +1838,6 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) rdev->allowed_protos = RC_TYPE_OTHER | RC_TYPE_RC6; /* iMON PAD or MCE */ rdev->change_protocol = imon_ir_change_protocol; rdev->driver_name = MOD_NAME; - if (ictx->rc_type == RC_TYPE_RC6) - rdev->map_name = RC_MAP_IMON_MCE; - else - rdev->map_name = RC_MAP_IMON_PAD; /* Enable front-panel buttons and/or knobs */ memcpy(ictx->usb_tx_buf, &fp_packet, sizeof(fp_packet)); @@ -1851,11 +1846,18 @@ static struct rc_dev *imon_init_rdev(struct imon_context *ictx) if (ret) dev_info(ictx->dev, "panel buttons/knobs setup failed\n"); - if (ictx->product == 0xffdc) + if (ictx->product == 0xffdc) { imon_get_ffdc_type(ictx); + rdev->allowed_protos = ictx->rc_type; + } imon_set_display_type(ictx); + if (ictx->rc_type == RC_TYPE_RC6) + rdev->map_name = RC_MAP_IMON_MCE; + else + rdev->map_name = RC_MAP_IMON_PAD; + ret = rc_register_device(rdev); if (ret < 0) { dev_err(ictx->dev, "remote input dev register failed\n");