HID: picoLCD: optimize for inactive debugfs

Matthieu CASTET adjusted picolcd_debug_out_report() to only operate when
there is an active listener on debugfs for events.

His change got lost while splitting hid_picolcd.c, restore it.

Signed-off-by: Bruno Prémont <bonbons@linux-vserver.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Bruno Prémont 2012-09-30 22:04:19 +02:00 committed by Jiri Kosina
parent 5ed84c341c
commit 56fa94415b

View file

@ -402,7 +402,7 @@ void picolcd_debug_out_report(struct picolcd_data *data,
#define BUFF_SZ 256
/* Avoid unnecessary overhead if debugfs is disabled */
if (!hdev->debug_events)
if (list_empty(&hdev->debug_list))
return;
buff = kmalloc(BUFF_SZ, GFP_ATOMIC);