From: Joe Perches Date: Fri, 20 Sep 2013 01:35:54 +0000 (-0700) Subject: framebuffer: Add fb_ convenience logging macros X-Git-Tag: firefly_0821_release~176^2~4980^2~12 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f51a07d05c5142e73f781d878f411d63d3548a49;p=firefly-linux-kernel-4.4.55.git framebuffer: Add fb_ convenience logging macros Add fb_ convenience macros for emitting the "fb%d: ", struct fb_info->node value. Neatens and shortens the code a bit. Signed-off-by: Joe Perches Signed-off-by: Tomi Valkeinen --- diff --git a/include/linux/fb.h b/include/linux/fb.h index ffac70aab3e9..70c4836e4a9f 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h @@ -792,4 +792,16 @@ extern int fb_find_mode(struct fb_var_screeninfo *var, const struct fb_videomode *default_mode, unsigned int default_bpp); +/* Convenience logging macros */ +#define fb_err(fb_info, fmt, ...) \ + pr_err("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) +#define fb_notice(info, fmt, ...) \ + pr_notice("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) +#define fb_warn(fb_info, fmt, ...) \ + pr_warn("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) +#define fb_info(fb_info, fmt, ...) \ + pr_info("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) +#define fb_dbg(fb_info, fmt, ...) \ + pr_debug("fb%d: " fmt, (fb_info)->node, ##__VA_ARGS__) + #endif /* _LINUX_FB_H */