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

Commit c2b27ef6 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

Input: iforce - wait for command completion when closing the device



We need to wait for the command to disable FF effects to complete before
continuing with closing the device.

Tested-by: default avatarJohannes Ebke <johannes.ebke@physik.uni-muenchen.de>
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 70f94413
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -228,6 +228,9 @@ static void iforce_close(struct input_dev *dev)

		/* Disable force feedback playback */
		iforce_send_packet(iforce, FF_CMD_ENABLE, "\001");
		/* Wait for the command to complete */
		wait_event_interruptible(iforce->wait,
			!test_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags));
	}

	switch (iforce->bus) {
+1 −0
Original line number Diff line number Diff line
@@ -109,6 +109,7 @@ static void iforce_usb_out(struct urb *urb)
	struct iforce *iforce = urb->context;

	if (urb->status) {
		clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags);
		dbg("urb->status %d, exiting", urb->status);
		return;
	}