summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@bitmath.se>2012-08-21 20:22:44 +0200
committerJiri Kosina <jkosina@suse.cz>2012-08-27 08:01:21 -0700
commit8db089d1b08209c04cd130e49fa4796b5513ce7f (patch)
tree6223490bd6bbbd60dde6cbe3ac25c17e39a6dce0 /drivers/hid
parentb0be5b3bac6376ea55bfcbac04cc521428043742 (diff)
downloadop-kernel-dev-8db089d1b08209c04cd130e49fa4796b5513ce7f.zip
op-kernel-dev-8db089d1b08209c04cd130e49fa4796b5513ce7f.tar.gz
HID: hid-debug: Show rdesc for unclaimed devices
Since commit a7197c2e, the raw report descriptor is available also for unclaimed devices. This patchs make it show in the rdesc debugfs node. Signed-off-by: Henrik Rydberg <rydberg@euromail.se> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-debug.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 01dd9a7..933fff0 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -911,15 +911,21 @@ static void hid_dump_input_mapping(struct hid_device *hid, struct seq_file *f)
}
-
static int hid_debug_rdesc_show(struct seq_file *f, void *p)
{
struct hid_device *hdev = f->private;
+ const __u8 *rdesc = hdev->rdesc;
+ unsigned rsize = hdev->rsize;
int i;
+ if (!rdesc) {
+ rdesc = hdev->dev_rdesc;
+ rsize = hdev->dev_rsize;
+ }
+
/* dump HID report descriptor */
- for (i = 0; i < hdev->rsize; i++)
- seq_printf(f, "%02x ", hdev->rdesc[i]);
+ for (i = 0; i < rsize; i++)
+ seq_printf(f, "%02x ", rdesc[i]);
seq_printf(f, "\n\n");
/* dump parsed data and input mappings */
OpenPOWER on IntegriCloud