From patchwork Fri Jul 16 17:23:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 3813 Return-path: Envelope-to: mchehab@infradead.org Delivery-date: Fri, 16 Jul 2010 17:23:57 +0000 Received: from bombadil.infradead.org [18.85.46.34] by localhost with IMAP (fetchmail-6.3.17) for (single-drop); Fri, 16 Jul 2010 14:27:39 -0300 (BRT) Received: from vger.kernel.org ([209.132.180.67]) by bombadil.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1OZodh-0007Dr-Lh; Fri, 16 Jul 2010 17:23:57 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754992Ab0GPRXy (ORCPT + 1 other); Fri, 16 Jul 2010 13:23:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54361 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754116Ab0GPRXx (ORCPT ); Fri, 16 Jul 2010 13:23:53 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6GHNr9G026907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Jul 2010 13:23:53 -0400 Received: from ihatethathostname.lab.bos.redhat.com (ihatethathostname.lab.bos.redhat.com [10.16.43.238]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6GHNqrf017375 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 16 Jul 2010 13:23:52 -0400 Received: from ihatethathostname.lab.bos.redhat.com (ihatethathostname.lab.bos.redhat.com [127.0.0.1]) by ihatethathostname.lab.bos.redhat.com (8.14.4/8.14.3) with ESMTP id o6GHNpc2004430; Fri, 16 Jul 2010 13:23:52 -0400 Received: (from jarod@localhost) by ihatethathostname.lab.bos.redhat.com (8.14.4/8.14.4/Submit) id o6GHNpxw004428; Fri, 16 Jul 2010 13:23:51 -0400 X-Authentication-Warning: ihatethathostname.lab.bos.redhat.com: jarod set sender to jarod@redhat.com using -f Date: Fri, 16 Jul 2010 13:23:51 -0400 From: Jarod Wilson To: linux-media@vger.kernel.org Cc: linux-input@vger.kernel.org Subject: [PATCH] input: fix wiring up default setkeycode/setkeycodebig Message-ID: <20100716172351.GA4364@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org I believe there's a mistake in 94977ff15f4214ee4630cf4a67195a1d48da771c, where the conditions on which to set a setkeycodebig function are incorrect. Previously, we had the case where if the dev didn't provide its own setkeycode, we'd set the default input layer one. Now, we set setkeycode big if the dev provides its own setkeycode but doesn't provide setkeycodebig. Devices that provide neither setkeycode nor setkeycodebig wind up with neither, which blows up horribly later on down the road when a setkeycode{,big} operation is attempted. Such is the case with the thinkpad_acpi driver's input device registered for the extra hotkey buttons on my own t61. This makes it happy again, and seems to be an obvious fix for a thinko. Oh yeah, patch is against the linuxtv staging/other tree, not sure where else the previously referenced hash can be found just yet. Signed-off-by: Jarod Wilson --- drivers/input/input.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 43aeb71..ce5d90d 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1850,7 +1850,7 @@ int input_register_device(struct input_dev *dev) dev->getkeycodebig_from_scancode = input_default_getkeycode_from_scancode; } - if (dev->setkeycode) { + if (!dev->setkeycode) { if (!dev->setkeycodebig) dev->setkeycodebig = input_default_setkeycode; }