From patchwork Sun Aug 6 08:56:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Young X-Patchwork-Id: 9883661 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 9D92C603B4 for ; Sun, 6 Aug 2017 08:56:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8BC6528632 for ; Sun, 6 Aug 2017 08:56:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7FFFB2864A; Sun, 6 Aug 2017 08:56:59 +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=-6.9 required=2.0 tests=BAYES_00,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 EEDD228632 for ; Sun, 6 Aug 2017 08:56:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbdHFI45 (ORCPT ); Sun, 6 Aug 2017 04:56:57 -0400 Received: from gofer.mess.org ([88.97.38.141]:55651 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbdHFI45 (ORCPT ); Sun, 6 Aug 2017 04:56:57 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id E2FFB60776; Sun, 6 Aug 2017 09:56:55 +0100 (BST) Date: Sun, 6 Aug 2017 09:56:55 +0100 From: Sean Young To: Matthias Reichl Cc: Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH] keytable: ensure udev rule fires on rc input device Message-ID: <20170806085655.dkaq7hqpyzrc3abj@gofer.mess.org> References: <20170717092038.3e7jbjtx7htu3lda@camel2.lan> <20170805213802.ni42iaht5rf5rye2@gofer.mess.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170805213802.ni42iaht5rf5rye2@gofer.mess.org> User-Agent: NeoMutt/20170113 (1.7.2) 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 rc device is created before the input device, so if ir-keytable runs too early the input device does not exist yet. Ensure that rule fires on creation of a rc device's input device. Note that this also prevents udev from starting ir-keytable on an transmit only device, which has no input device. Signed-off-by: Sean Young Signed-off-by: Matthias Reichl --- utils/keytable/70-infrared.rules | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) Matthias, can I have your Signed-off-by please? Thank you. diff --git a/utils/keytable/70-infrared.rules b/utils/keytable/70-infrared.rules index afffd951..b3531727 100644 --- a/utils/keytable/70-infrared.rules +++ b/utils/keytable/70-infrared.rules @@ -1,4 +1,12 @@ # Automatically load the proper keymaps after the Remote Controller device # creation. The keycode tables rules should be at /etc/rc_maps.cfg -ACTION=="add", SUBSYSTEM=="rc", RUN+="/usr/bin/ir-keytable -a /etc/rc_maps.cfg -s $name" +ACTION!="add", SUBSYSTEMS!="rc", GOTO="rc_dev_end" + +SUBSYSTEM=="rc", ENV{rc_sysdev}="$name" + +SUBSYSTEM=="input", IMPORT{parent}="rc_sysdev" + +KERNEL=="event[0-9]*", ENV{rc_sysdev}=="?*", RUN+="/usr/bin/ir-keytable -a /etc/rc_maps.cfg -s $env{rc_sysdev}" + +LABEL="rc_dev_end"