diff options
Diffstat (limited to 'drivers/macintosh')
-rw-r--r-- | drivers/macintosh/Kconfig | 1 | ||||
-rw-r--r-- | drivers/macintosh/mac_hid.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index 3d7355ff7308..fa51af11c6f1 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig | |||
@@ -102,6 +102,7 @@ config ADB_PMU_LED | |||
102 | config ADB_PMU_LED_IDE | 102 | config ADB_PMU_LED_IDE |
103 | bool "Use front LED as IDE LED by default" | 103 | bool "Use front LED as IDE LED by default" |
104 | depends on ADB_PMU_LED | 104 | depends on ADB_PMU_LED |
105 | depends on LEDS_CLASS | ||
105 | select LEDS_TRIGGERS | 106 | select LEDS_TRIGGERS |
106 | select LEDS_TRIGGER_IDE_DISK | 107 | select LEDS_TRIGGER_IDE_DISK |
107 | help | 108 | help |
diff --git a/drivers/macintosh/mac_hid.c b/drivers/macintosh/mac_hid.c index 067f9962f499..6a82388505f0 100644 --- a/drivers/macintosh/mac_hid.c +++ b/drivers/macintosh/mac_hid.c | |||
@@ -23,6 +23,8 @@ static int mouse_button3_keycode = KEY_RIGHTALT; /* right option key */ | |||
23 | 23 | ||
24 | static struct input_dev *mac_hid_emumouse_dev; | 24 | static struct input_dev *mac_hid_emumouse_dev; |
25 | 25 | ||
26 | static DEFINE_MUTEX(mac_hid_emumouse_mutex); | ||
27 | |||
26 | static int mac_hid_create_emumouse(void) | 28 | static int mac_hid_create_emumouse(void) |
27 | { | 29 | { |
28 | static struct lock_class_key mac_hid_emumouse_dev_event_class; | 30 | static struct lock_class_key mac_hid_emumouse_dev_event_class; |
@@ -187,6 +189,10 @@ static int mac_hid_toggle_emumouse(ctl_table *table, int write, | |||
187 | int old_val = *valp; | 189 | int old_val = *valp; |
188 | int rc; | 190 | int rc; |
189 | 191 | ||
192 | rc = mutex_lock_killable(&mac_hid_emumouse_mutex); | ||
193 | if (rc) | ||
194 | return rc; | ||
195 | |||
190 | rc = proc_dointvec(table, write, buffer, lenp, ppos); | 196 | rc = proc_dointvec(table, write, buffer, lenp, ppos); |
191 | 197 | ||
192 | if (rc == 0 && write && *valp != old_val) { | 198 | if (rc == 0 && write && *valp != old_val) { |
@@ -202,6 +208,8 @@ static int mac_hid_toggle_emumouse(ctl_table *table, int write, | |||
202 | if (rc) | 208 | if (rc) |
203 | *valp = old_val; | 209 | *valp = old_val; |
204 | 210 | ||
211 | mutex_unlock(&mac_hid_emumouse_mutex); | ||
212 | |||
205 | return rc; | 213 | return rc; |
206 | } | 214 | } |
207 | 215 | ||