From patchwork Thu Apr 27 20:33:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?RGF2aWQgSMODwqRyZGVtYW4=?= X-Patchwork-Id: 9703427 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 39C7D60225 for ; Thu, 27 Apr 2017 20:34:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2D1BC2860B for ; Thu, 27 Apr 2017 20:34:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21D0E28639; Thu, 27 Apr 2017 20:34:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 212CA28627 for ; Thu, 27 Apr 2017 20:34:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934547AbdD0UeB (ORCPT ); Thu, 27 Apr 2017 16:34:01 -0400 Received: from vader.hardeman.nu ([95.142.160.32]:55214 "EHLO hardeman.nu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755330AbdD0UeA (ORCPT ); Thu, 27 Apr 2017 16:34:00 -0400 Received: from hardeman.nu (zeus.hardeman.nu [IPv6:fd27:2a41:8fcb:2::a]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by vader.hardeman.nu (Postfix) with ESMTPSA id 77010402F; Thu, 27 Apr 2017 22:33:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hardeman.nu; s=hardeman-201703; t=1493325238; bh=YtGhf1gs8klbFAW//N1rVXzGPpntK0bKnBnBfgGnkVU=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=6lGKgoMdcULzgmZHww/nCy0xGXAZ/KCnRy0ZuxEi0B1QSRb90eBT/Swx5Td6LRkXL l4Ev0ngo1DREhWIuRPgYjwECSeiN3PTGu6LknA7pSVcVbjytAN1O2JF1FnBEpW6uKn HPGyIsC5kz9+b5iS+0k0sHjC5dfnhbC7q9EHlsgpwgRrI/EAXxCR8xZLQR7h+T63ne he0KEasIaGFyyoPREt9cNbPf5zImnNBpmCHU1GBaojCSxmQEHY2FUROxHdT0pu7oA4 nMulUHshu5i9CUvKrc60Pxv4Nx7mtjFZeWltYIKnqE22GN8ZRFwf+EVEC3qgPrawAy 6PZ90uLl2Q81w== Received: (nullmailer pid 32583 invoked by uid 1000); Thu, 27 Apr 2017 20:33:58 -0000 Subject: [PATCH 1/6] rc-core: fix input repeat handling From: David =?utf-8?b?SMOkcmRlbWFu?= To: linux-media@vger.kernel.org Cc: mchehab@s-opensource.com, sean@mess.org Date: Thu, 27 Apr 2017 22:33:58 +0200 Message-ID: <149332523796.32431.14044805351907177736.stgit@zeus.hardeman.nu> In-Reply-To: <149332488240.32431.6597996407440701793.stgit@zeus.hardeman.nu> References: <149332488240.32431.6597996407440701793.stgit@zeus.hardeman.nu> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The call to input_register_device() needs to take place before the repeat parameters are set or the input subsystem repeat handling will be disabled (as was already noted in the comments in that function). Signed-off-by: David Härdeman --- drivers/media/rc/rc-main.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c index 6ec73357fa47..802e559cc30e 100644 --- a/drivers/media/rc/rc-main.c +++ b/drivers/media/rc/rc-main.c @@ -1703,6 +1703,16 @@ static int rc_setup_rx_device(struct rc_dev *dev) if (dev->close) dev->input_dev->close = ir_close; + dev->input_dev->dev.parent = &dev->dev; + memcpy(&dev->input_dev->id, &dev->input_id, sizeof(dev->input_id)); + dev->input_dev->phys = dev->input_phys; + dev->input_dev->name = dev->input_name; + + /* rc_open will be called here */ + rc = input_register_device(dev->input_dev); + if (rc) + goto out_table; + /* * Default delay of 250ms is too short for some protocols, especially * since the timeout is currently set to 250ms. Increase it to 500ms, @@ -1718,16 +1728,6 @@ static int rc_setup_rx_device(struct rc_dev *dev) */ dev->input_dev->rep[REP_PERIOD] = 125; - dev->input_dev->dev.parent = &dev->dev; - memcpy(&dev->input_dev->id, &dev->input_id, sizeof(dev->input_id)); - dev->input_dev->phys = dev->input_phys; - dev->input_dev->name = dev->input_name; - - /* rc_open will be called here */ - rc = input_register_device(dev->input_dev); - if (rc) - goto out_table; - return 0; out_table: