[PATCH 2/3] HID: picolcd: explicitly claim hid devices with HID_CLAIMED_OTHER

From
David Herrmann <hidden>
Date
2012-07-15 18:22:18
Reply to
David Herrmann, 2012-07-15
Instead of using an ugly workaround to make hid_hw_start() correctly
initialize the device, we now explicitely set HID_CLAIMED_OTHER before
initializing the hid device. This tells the hid-core to accept the device
even if no generic hid driver gets loaded.

Signed-off-by: David Herrmann <redacted>
---
 drivers/hid/hid-picolcd.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/hid/hid-picolcd.c b/drivers/hid/hid-picolcd.c
index 45c3433..36a11a8 100644
--- a/drivers/hid/hid-picolcd.c
+++ b/drivers/hid/hid-picolcd.c
@@ -2613,11 +2613,10 @@ static int picolcd_probe(struct hid_device *hdev,
 		goto err_cleanup_data;
 	}
 
-	/* We don't use hidinput but hid_hw_start() fails if nothing is
-	 * claimed. So spoof claimed input. */
-	hdev->claimed = HID_CLAIMED_INPUT;
+	/* Tell hid-core that we handle the device without the need of any
+	 * generic hid-driver by setting the HID_CLAIMED_OTHER flag. */
+	hdev->claimed |= HID_CLAIMED_OTHER;
 	error = hid_hw_start(hdev, 0);
-	hdev->claimed = 0;
 	if (error) {
 		hid_err(hdev, "hardware start failed\n");
 		goto err_cleanup_data;
-- 
1.7.11.2
Thread (4 messages) 4 messages, 1 author, last reply 2012-07-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help