Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fd76c45 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Dmitry Torokhov
Browse files

Input: mac_hid - add lockdep annotation to emumousebtn



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: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 8c6deb9c
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -103,6 +103,9 @@ int mac_hid_mouse_emulate_buttons(int caller, unsigned int keycode, int down)
	return 0;
	return 0;
}
}


static struct lock_class_key emumousebtn_event_class;
static struct lock_class_key emumousebtn_mutex_class;

static int emumousebtn_input_register(void)
static int emumousebtn_input_register(void)
{
{
	int ret;
	int ret;
@@ -111,6 +114,9 @@ static int emumousebtn_input_register(void)
	if (!emumousebtn)
	if (!emumousebtn)
		return -ENOMEM;
		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->name = "Macintosh mouse button emulation";
	emumousebtn->id.bustype = BUS_ADB;
	emumousebtn->id.bustype = BUS_ADB;
	emumousebtn->id.vendor = 0x0001;
	emumousebtn->id.vendor = 0x0001;