diff mbox series

i2c_hid: print the full HID report descriptor when debug is on

Message ID 87im2ofcf8.fsf@autistici.org (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series i2c_hid: print the full HID report descriptor when debug is on | expand

Commit Message

Andrea G. Monaco June 8, 2021, 6:18 p.m. UTC
Hello,


right now i2c_hid uses printk to dump the HID report descriptor when
debug is on. This means that only the first 64 bytes get printed, but a
typical descriptor is bigger (mine is 665 bytes).

This patch prints the whole thing.
diff mbox series

Patch

diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c
index 46474612e73c..4512bf1bad41 100644
--- a/drivers/hid/i2c-hid/i2c-hid-core.c
+++ b/drivers/hid/i2c-hid/i2c-hid-core.c
@@ -746,7 +746,11 @@  static int i2c_hid_parse(struct hid_device *hid)
                }
        }
 
-       i2c_hid_dbg(ihid, "Report Descriptor: %*ph\n", rsize, rdesc);
+       i2c_hid_dbg(ihid, "Report Descriptor:");
+
+       if (debug)
+               print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_NONE, 32, 1, rdesc, rsize, false);
+
 
        ret = hid_parse_report(hid, rdesc, rsize);
        if (!use_override)