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

Commit 29a9d61c authored by qctecmdr Service's avatar qctecmdr Service Committed by Gerrit - the friendly Code Review server
Browse files

Merge "HID: uhid: Remove the redundant reference counting for open/close"

parents 04d3da68 e662eead
Loading
Loading
Loading
Loading
+2 −9
Original line number Diff line number Diff line
@@ -142,21 +142,14 @@ static void uhid_hid_stop(struct hid_device *hid)
static int uhid_hid_open(struct hid_device *hid)
{
	struct uhid_device *uhid = hid->driver_data;
	int retval = 0;

	if (!hid->ll_open_count++) {
		retval = uhid_queue_event(uhid, UHID_OPEN);
		if (retval)
			hid->ll_open_count--;
	}
	return retval;
	return uhid_queue_event(uhid, UHID_OPEN);
}

static void uhid_hid_close(struct hid_device *hid)
{
	struct uhid_device *uhid = hid->driver_data;

	if (!--hid->ll_open_count)
	uhid_queue_event(uhid, UHID_CLOSE);
}