HID: Add and use hid_<level>: dev_<level> equivalents

Neaten current uses of dev_<level> by adding and using
hid specific hid_<level> macros.

Convert existing uses of dev_<level> uses to hid_<level>.
Convert hid-pidff printk uses to hid_<level>.

Remove err_hid and use hid_err instead.

Add missing newlines to logging messages where necessary.
Coalesce format strings.

Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Other miscellaneous changes:

Add const struct hid_device * argument to hid-core functions
extract() and implement() so hid_<level> can be used by them.
Fix bad indentation in hid-core hid_input_field function
that calls extract() function above.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
Joe Perches
2010-12-09 19:29:03 -08:00
committed by Jiri Kosina
parent 5bea7660bb
commit 4291ee305e
51 changed files with 398 additions and 399 deletions

View File

@ -881,12 +881,32 @@ int hid_pidff_init(struct hid_device *hid);
#define hid_pidff_init NULL
#endif
#define dbg_hid(format, arg...) if (hid_debug) \
printk(KERN_DEBUG "%s: " format ,\
__FILE__ , ## arg)
#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
__FILE__ , ## arg)
#endif /* HID_FF */
#define dbg_hid(format, arg...) \
do { \
if (hid_debug) \
printk(KERN_DEBUG "%s: " format, __FILE__, ##arg); \
} while (0)
#define hid_printk(level, hid, fmt, arg...) \
dev_printk(level, &(hid)->dev, fmt, ##arg)
#define hid_emerg(hid, fmt, arg...) \
dev_emerg(&(hid)->dev, fmt, ##arg)
#define hid_crit(hid, fmt, arg...) \
dev_crit(&(hid)->dev, fmt, ##arg)
#define hid_alert(hid, fmt, arg...) \
dev_alert(&(hid)->dev, fmt, ##arg)
#define hid_err(hid, fmt, arg...) \
dev_err(&(hid)->dev, fmt, ##arg)
#define hid_notice(hid, fmt, arg...) \
dev_notice(&(hid)->dev, fmt, ##arg)
#define hid_warn(hid, fmt, arg...) \
dev_warn(&(hid)->dev, fmt, ##arg)
#define hid_info(hid, fmt, arg...) \
dev_info(&(hid)->dev, fmt, ##arg)
#define hid_dbg(hid, fmt, arg...) \
dev_dbg(&(hid)->dev, fmt, ##arg)
#endif /* __KERNEL__ */
#endif