Skip to content

Commit

Permalink
Input: mac_hid - add lockdep annotation to emumousebtn
Browse files Browse the repository at this point in the history
The mouse button emulation calls input device methods from an input
device. This causes funny lock nesting which is harmless as each
device has its own locks.

Give the nesting device its own lock classes so that lockdep will not
consider them the same.

Signed-off-by: Peter Zijlstra <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
Peter Zijlstra authored and dtor committed Apr 24, 2008
1 parent 8c6deb9 commit 8fd76c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/macintosh/mac_hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,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;
Expand All @@ -111,6 +114,9 @@ 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;
Expand Down

0 comments on commit 8fd76c4

Please sign in to comment.