Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
[sfrench/cifs-2.6.git] / drivers / macintosh / mac_hid.c
index 33dee3a773ed29ae4cad14fe9fa37203ba7cbfef..7b4ef5bb556b9607c78c9d812f2dba8e888de6b4 100644 (file)
@@ -27,54 +27,49 @@ static int mouse_last_keycode;
 /* file(s) in /proc/sys/dev/mac_hid */
 static ctl_table mac_hid_files[] = {
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON_EMULATION,
                .procname       = "mouse_button_emulation",
                .data           = &mouse_emulate_buttons,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE,
                .procname       = "mouse_button2_keycode",
                .data           = &mouse_button2_keycode,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
-               .ctl_name       = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE,
                .procname       = "mouse_button3_keycode",
                .data           = &mouse_button3_keycode,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* dir in /proc/sys/dev */
 static ctl_table mac_hid_dir[] = {
        {
-               .ctl_name       = DEV_MAC_HID,
                .procname       = "mac_hid",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = mac_hid_files,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 /* /proc/sys/dev itself, in case that is not there yet */
 static ctl_table mac_hid_root_dir[] = {
        {
-               .ctl_name       = CTL_DEV,
                .procname       = "dev",
                .maxlen         = 0,
                .mode           = 0555,
                .child          = mac_hid_dir,
        },
-       { .ctl_name = 0 }
+       { }
 };
 
 static struct ctl_table_header *mac_hid_sysctl_header;
@@ -103,6 +98,9 @@ int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down)
        return 0;
 }
 
+static struct lock_class_key emumousebtn_event_class;
+static struct lock_class_key emumousebtn_mutex_class;
+
 static int emumousebtn_input_register(void)
 {
        int ret;
@@ -111,15 +109,19 @@ static int emumousebtn_input_register(void)
        if (!emumousebtn)
                return -ENOMEM;
 
+       lockdep_set_class(&emumousebtn->event_lock, &emumousebtn_event_class);
+       lockdep_set_class(&emumousebtn->mutex, &emumousebtn_mutex_class);
+
        emumousebtn->name = "Macintosh mouse button emulation";
        emumousebtn->id.bustype = BUS_ADB;
        emumousebtn->id.vendor = 0x0001;
        emumousebtn->id.product = 0x0001;
        emumousebtn->id.version = 0x0100;
 
-       emumousebtn->evbit[0] = BIT(EV_KEY) | BIT(EV_REL);
-       emumousebtn->keybit[LONG(BTN_MOUSE)] = BIT(BTN_LEFT) | BIT(BTN_MIDDLE) | BIT(BTN_RIGHT);
-       emumousebtn->relbit[0] = BIT(REL_X) | BIT(REL_Y);
+       emumousebtn->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
+       emumousebtn->keybit[BIT_WORD(BTN_MOUSE)] = BIT_MASK(BTN_LEFT) |
+               BIT_MASK(BTN_MIDDLE) | BIT_MASK(BTN_RIGHT);
+       emumousebtn->relbit[0] = BIT_MASK(REL_X) | BIT_MASK(REL_Y);
 
        ret = input_register_device(emumousebtn);
        if (ret)