diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/hid-debug.h | 18 | ||||
-rw-r--r-- | include/linux/hid.h | 26 |
2 files changed, 20 insertions, 24 deletions
diff --git a/include/linux/hid-debug.h b/include/linux/hid-debug.h index ec08ac1ad687..516e12c33235 100644 --- a/include/linux/hid-debug.h +++ b/include/linux/hid-debug.h @@ -24,27 +24,14 @@ #ifdef CONFIG_DEBUG_FS -void hid_dump_input(struct hid_device *, struct hid_usage *, __s32); +void hid_dump_input(struct hid_usage *, __s32); void hid_dump_device(struct hid_device *, struct seq_file *); void hid_dump_field(struct hid_field *, int, struct seq_file *); -char *hid_resolv_usage(unsigned, struct seq_file *); +void hid_resolv_usage(unsigned, struct seq_file *); void hid_debug_register(struct hid_device *, const char *); void hid_debug_unregister(struct hid_device *); void hid_debug_init(void); void hid_debug_exit(void); -void hid_debug_event(struct hid_device *, char *); - -#define HID_DEBUG_BUFSIZE 512 - -struct hid_debug_list { - char *hid_debug_buf; - int head; - int tail; - struct fasync_struct *fasync; - struct hid_device *hdev; - struct list_head node; - struct mutex read_mutex; -}; #else @@ -57,7 +44,6 @@ struct hid_debug_list { #define hid_debug_unregister(a) do { } while (0) #define hid_debug_init() do { } while (0) #define hid_debug_exit() do { } while (0) -#define hid_debug_event(a,b) do { } while (0) #endif diff --git a/include/linux/hid.h b/include/linux/hid.h index a0ebdace7baa..ca5935df9fa6 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -487,6 +487,10 @@ struct hid_device { /* device report descriptor */ char phys[64]; /* Device physical location */ char uniq[64]; /* Device unique identifier (serial #) */ + /* debugfs */ + struct dentry *debug_dir; + struct dentry *debug_rdesc; + void *driver_data; /* temporary hid_ff handling (until moved to the drivers) */ @@ -500,14 +504,6 @@ struct hid_device { /* device report descriptor */ /* handler for raw output data, used by hidraw */ int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); - - /* debugging support via debugfs */ - unsigned short debug; - struct dentry *debug_dir; - struct dentry *debug_rdesc; - struct dentry *debug_events; - struct list_head debug_list; - wait_queue_head_t debug_wait; }; static inline void *hid_get_drvdata(struct hid_device *hdev) @@ -665,7 +661,9 @@ struct hid_ll_driver { /* HID core API */ +#ifdef CONFIG_HID_DEBUG extern int hid_debug; +#endif extern int hid_add_device(struct hid_device *); extern void hid_destroy_device(struct hid_device *); @@ -821,9 +819,21 @@ int hid_pidff_init(struct hid_device *hid); #define hid_pidff_init NULL #endif +#ifdef CONFIG_HID_DEBUG #define dbg_hid(format, arg...) if (hid_debug) \ printk(KERN_DEBUG "%s: " format ,\ __FILE__ , ## arg) +#define dbg_hid_line(format, arg...) if (hid_debug) \ + printk(format, ## arg) +#else +static inline int __attribute__((format(printf, 1, 2))) +dbg_hid(const char *fmt, ...) +{ + return 0; +} +#define dbg_hid_line dbg_hid +#endif /* HID_DEBUG */ + #define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ __FILE__ , ## arg) #endif /* HID_FF */ |