]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
[media] Partly revert "[media] rc-core: allow calling rc_open with device not initial...
authorOle Ernst <olebowle@gmx.com>
Sat, 30 Jul 2016 13:19:27 +0000 (10:19 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 22 Sep 2016 14:21:15 +0000 (11:21 -0300)
This partly reverts commit 078600f514a12fd763ac84c86af68ef5b5267563.

Due to the relocation of input_register_device() call, holding down a
button on an IR remote no longer resulted in repeated key down events.

Signed-off-by: Ole Ernst <olebowle@gmx.com>
Tested-by: Matthias Reichl <hias@horus.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/rc/rc-main.c

index 8e7f2929fa6f8ac71497d20a2dd567ce4f9077e7..26fd63bdf8e8b7210af2db81ad763cdf4100b917 100644 (file)
@@ -1460,6 +1460,10 @@ int rc_register_device(struct rc_dev *dev)
        dev->input_dev->phys = dev->input_phys;
        dev->input_dev->name = dev->input_name;
 
+       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,
@@ -1475,11 +1479,6 @@ int rc_register_device(struct rc_dev *dev)
         */
        dev->input_dev->rep[REP_PERIOD] = 125;
 
-       /* rc_open will be called here */
-       rc = input_register_device(dev->input_dev);
-       if (rc)
-               goto out_table;
-
        path = kobject_get_path(&dev->dev.kobj, GFP_KERNEL);
        dev_info(&dev->dev, "%s as %s\n",
                dev->input_name ?: "Unspecified device", path ?: "N/A");