Input: switch completely over to the new versions of get/setkeycode
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 1 Feb 2011 05:06:39 +0000 (21:06 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 1 Feb 2011 05:16:59 +0000 (21:16 -0800)
All users of old style get/setkeycode methids have been converted so
it is time to retire them.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/hid/hid-input.c
drivers/input/input.c
drivers/input/misc/ati_remote2.c
drivers/input/sparse-keymap.c
drivers/media/dvb/dvb-usb/dvb-usb-remote.c
drivers/media/rc/rc-main.c
include/linux/input.h

index 7f552bfad32c01a26bb52a239175a801754103bd..ba2aeea2cbf99727bdae85acf2516e0b2fadf34e 100644 (file)
@@ -888,8 +888,8 @@ int hidinput_connect(struct hid_device *hid, unsigned int force)
                                        hid->ll_driver->hidinput_input_event;
                                input_dev->open = hidinput_open;
                                input_dev->close = hidinput_close;
-                               input_dev->setkeycode_new = hidinput_setkeycode;
-                               input_dev->getkeycode_new = hidinput_getkeycode;
+                               input_dev->setkeycode = hidinput_setkeycode;
+                               input_dev->getkeycode = hidinput_getkeycode;
 
                                input_dev->name = hid->name;
                                input_dev->phys = hid->phys;
index 7985114beac72a7fe07ab58dc5f34e3489903fa8..ee2959bd322c5e64335a02d8a3bd4ea47cf342a0 100644 (file)
@@ -806,22 +806,9 @@ int input_get_keycode(struct input_dev *dev, struct input_keymap_entry *ke)
        int retval;
 
        spin_lock_irqsave(&dev->event_lock, flags);
-
-       if (dev->getkeycode) {
-               /*
-                * Support for legacy drivers, that don't implement the new
-                * ioctls
-                */
-               u32 scancode = ke->index;
-
-               memcpy(ke->scancode, &scancode, sizeof(scancode));
-               ke->len = sizeof(scancode);
-               retval = dev->getkeycode(dev, scancode, &ke->keycode);
-       } else {
-               retval = dev->getkeycode_new(dev, ke);
-       }
-
+       retval = dev->getkeycode(dev, ke);
        spin_unlock_irqrestore(&dev->event_lock, flags);
+
        return retval;
 }
 EXPORT_SYMBOL(input_get_keycode);
@@ -846,35 +833,7 @@ int input_set_keycode(struct input_dev *dev,
 
        spin_lock_irqsave(&dev->event_lock, flags);
 
-       if (dev->setkeycode) {
-               /*
-                * Support for legacy drivers, that don't implement the new
-                * ioctls
-                */
-               unsigned int scancode;
-
-               retval = input_scancode_to_scalar(ke, &scancode);
-               if (retval)
-                       goto out;
-
-               /*
-                * We need to know the old scancode, in order to generate a
-                * keyup effect, if the set operation happens successfully
-                */
-               if (!dev->getkeycode) {
-                       retval = -EINVAL;
-                       goto out;
-               }
-
-               retval = dev->getkeycode(dev, scancode, &old_keycode);
-               if (retval)
-                       goto out;
-
-               retval = dev->setkeycode(dev, scancode, ke->keycode);
-       } else {
-               retval = dev->setkeycode_new(dev, ke, &old_keycode);
-       }
-
+       retval = dev->setkeycode(dev, ke, &old_keycode);
        if (retval)
                goto out;
 
@@ -1861,11 +1820,11 @@ int input_register_device(struct input_dev *dev)
                dev->rep[REP_PERIOD] = 33;
        }
 
-       if (!dev->getkeycode && !dev->getkeycode_new)
-               dev->getkeycode_new = input_default_getkeycode;
+       if (!dev->getkeycode)
+               dev->getkeycode = input_default_getkeycode;
 
-       if (!dev->setkeycode && !dev->setkeycode_new)
-               dev->setkeycode_new = input_default_setkeycode;
+       if (!dev->setkeycode)
+               dev->setkeycode = input_default_setkeycode;
 
        dev_set_name(&dev->dev, "input%ld",
                     (unsigned long) atomic_inc_return(&input_no) - 1);
index 0b0e9be6354215319200a8a305c9db55e8b4c3dd..9ccdb82d869a09245c80bf125a99c5fcac5cffd7 100644 (file)
@@ -612,8 +612,8 @@ static int ati_remote2_input_init(struct ati_remote2 *ar2)
        idev->open = ati_remote2_open;
        idev->close = ati_remote2_close;
 
-       idev->getkeycode_new = ati_remote2_getkeycode;
-       idev->setkeycode_new = ati_remote2_setkeycode;
+       idev->getkeycode = ati_remote2_getkeycode;
+       idev->setkeycode = ati_remote2_setkeycode;
 
        idev->name = ar2->name;
        idev->phys = ar2->phys;
index 7729e547ba65d853581e115a4ce6428883549ecd..337bf51bc984253abf9a77b558eb36c8c10deb53 100644 (file)
@@ -210,8 +210,8 @@ int sparse_keymap_setup(struct input_dev *dev,
 
        dev->keycode = map;
        dev->keycodemax = map_size;
-       dev->getkeycode_new = sparse_keymap_getkeycode;
-       dev->setkeycode_new = sparse_keymap_setkeycode;
+       dev->getkeycode = sparse_keymap_getkeycode;
+       dev->setkeycode = sparse_keymap_setkeycode;
 
        return 0;
 
index 347fbd4e2d561dfed228c88cc84c7b4ab89dee59..b2b9415d874d02142a9944c283c0f613cda1e9b6 100644 (file)
@@ -198,8 +198,8 @@ static int legacy_dvb_usb_remote_init(struct dvb_usb_device *d)
        d->input_dev = input_dev;
        d->rc_dev = NULL;
 
-       input_dev->getkeycode_new = legacy_dvb_usb_getkeycode;
-       input_dev->setkeycode_new = legacy_dvb_usb_setkeycode;
+       input_dev->getkeycode = legacy_dvb_usb_getkeycode;
+       input_dev->setkeycode = legacy_dvb_usb_setkeycode;
 
        /* set the bits for the keys */
        deb_rc("key map size: %d\n", d->props.rc.legacy.rc_map_size);
index 512a2f4ada0e113ccc213ff5a5c50d0d93eaaf90..c3769283936ff3ce0f5adc436482e5873544f0d7 100644 (file)
@@ -966,8 +966,8 @@ struct rc_dev *rc_allocate_device(void)
                return NULL;
        }
 
-       dev->input_dev->getkeycode_new = ir_getkeycode;
-       dev->input_dev->setkeycode_new = ir_setkeycode;
+       dev->input_dev->getkeycode = ir_getkeycode;
+       dev->input_dev->setkeycode = ir_setkeycode;
        input_set_drvdata(dev->input_dev, dev);
 
        spin_lock_init(&dev->rc_map.lock);
index e428382ca28a59aac1a16f1f5926f28a3c7fb24b..056ae8a5bd9b8bb3424c431ff60bcc22c155b4da 100644 (file)
@@ -1154,8 +1154,6 @@ struct ff_effect {
  *     sparse keymaps. If not supplied default mechanism will be used.
  *     The method is being called while holding event_lock and thus must
  *     not sleep
- * @getkeycode_new: transition method
- * @setkeycode_new: transition method
  * @ff: force feedback structure associated with the device if device
  *     supports force feedback effects
  * @repeat_key: stores key code of the last key pressed; used to implement
@@ -1234,14 +1232,10 @@ struct input_dev {
        void *keycode;
 
        int (*setkeycode)(struct input_dev *dev,
-                         unsigned int scancode, unsigned int keycode);
+                         const struct input_keymap_entry *ke,
+                         unsigned int *old_keycode);
        int (*getkeycode)(struct input_dev *dev,
-                         unsigned int scancode, unsigned int *keycode);
-       int (*setkeycode_new)(struct input_dev *dev,
-                             const struct input_keymap_entry *ke,
-                             unsigned int *old_keycode);
-       int (*getkeycode_new)(struct input_dev *dev,
-                             struct input_keymap_entry *ke);
+                         struct input_keymap_entry *ke);
 
        struct ff_device *ff;