Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751529AbdITBhw (ORCPT ); Tue, 19 Sep 2017 21:37:52 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34342 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750884AbdITBhu (ORCPT ); Tue, 19 Sep 2017 21:37:50 -0400 X-Google-Smtp-Source: AOwi7QDZlIeNsek3MIWYPSYgU4VLwXHxrZITPkkZHzCLngXujFGg4TIztsTmRx8iUdpPBUjXFRXSWg== Date: Tue, 19 Sep 2017 18:37:46 -0700 From: Dmitry Torokhov To: Jiri Kosina Cc: Benjamin Tissoires , Benson Leung , Oliver Neukum , Guenter Roeck , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: hidraw: fix power sequence when closing device Message-ID: <20170920013746.GA33367@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 819 Lines: 29 We should not try to bring HID device out of full power state before calling hid_hw_close(), so that transport driver operates on powered up device (making this inverse of the opening sequence). Signed-off-by: Dmitry Torokhov --- drivers/hid/hidraw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/hidraw.c b/drivers/hid/hidraw.c index ec530454e6f6..5fbe0f81ab2e 100644 --- a/drivers/hid/hidraw.c +++ b/drivers/hid/hidraw.c @@ -337,8 +337,8 @@ static void drop_ref(struct hidraw *hidraw, int exists_bit) kfree(hidraw); } else { /* close device for last reader */ - hid_hw_power(hidraw->hid, PM_HINT_NORMAL); hid_hw_close(hidraw->hid); + hid_hw_power(hidraw->hid, PM_HINT_NORMAL); } } } -- 2.14.1.821.g8fa685d3b7-goog -- Dmitry