Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fbdev: au1100fb: Replace custom printk wrappers by pr_*

The global wrappers also have the advantage to do stricter format
checking, so the pr_devel formats are also checked if DEBUG is not
defined. The global variants only check for DEBUG being defined and not
its actual value, so the #define to zero is dropped, too.

There is only a slight semantic change as the (by default disabled)
debug output doesn't contain __FILE__ any more.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Signed-off-by: Helge Deller <deller@gmx.de>

authored by

Uwe Kleine-König and committed by
Helge Deller
bcf4373e 6f366e86

+21 -30
+21 -20
drivers/video/fbdev/au1100fb.c
··· 41 41 * with this program; if not, write to the Free Software Foundation, Inc., 42 42 * 675 Mass Ave, Cambridge, MA 02139, USA. 43 43 */ 44 + 45 + #define pr_fmt(fmt) "au1100fb:" fmt "\n" 46 + 44 47 #include <linux/clk.h> 45 48 #include <linux/delay.h> 46 49 #include <linux/io.h> ··· 59 56 #include <linux/dma-mapping.h> 60 57 #include <linux/platform_device.h> 61 58 #include <linux/slab.h> 62 - 63 - #define DEBUG 0 64 59 65 60 #include "au1100fb.h" 66 61 ··· 98 97 { 99 98 struct au1100fb_device *fbdev = to_au1100fb_device(fbi); 100 99 101 - print_dbg("fb_blank %d %p", blank_mode, fbi); 100 + pr_devel("fb_blank %d %p", blank_mode, fbi); 102 101 103 102 switch (blank_mode) { 104 103 ··· 292 291 293 292 fbdev = to_au1100fb_device(fbi); 294 293 295 - print_dbg("fb_pan_display %p %p", var, fbi); 294 + pr_devel("fb_pan_display %p %p", var, fbi); 296 295 297 296 if (!var || !fbdev) { 298 297 return -EINVAL; ··· 303 302 return -EINVAL; 304 303 } 305 304 306 - print_dbg("fb_pan_display 2 %p %p", var, fbi); 305 + pr_devel("fb_pan_display 2 %p %p", var, fbi); 307 306 dy = var->yoffset - fbi->var.yoffset; 308 307 if (dy) { 309 308 310 309 u32 dmaaddr; 311 310 312 - print_dbg("Panning screen of %d lines", dy); 311 + pr_devel("Panning screen of %d lines", dy); 313 312 314 313 dmaaddr = fbdev->regs->lcd_dmaaddr0; 315 314 dmaaddr += (fbi->fix.line_length * dy); ··· 323 322 fbdev->regs->lcd_dmaaddr0 = LCD_DMA_SA_N(dmaaddr); 324 323 } 325 324 } 326 - print_dbg("fb_pan_display 3 %p %p", var, fbi); 325 + pr_devel("fb_pan_display 3 %p %p", var, fbi); 327 326 328 327 return 0; 329 328 } ··· 366 365 int num_panels = ARRAY_SIZE(known_lcd_panels); 367 366 368 367 if (num_panels <= 0) { 369 - print_err("No LCD panels supported by driver!"); 368 + pr_err("No LCD panels supported by driver!"); 370 369 return -ENODEV; 371 370 } 372 371 ··· 389 388 } 390 389 } 391 390 if (i >= num_panels) { 392 - print_warn("Panel '%s' not supported!", this_opt); 391 + pr_warn("Panel '%s' not supported!", this_opt); 393 392 return -ENODEV; 394 393 } 395 394 } 396 395 /* Unsupported option */ 397 396 else 398 - print_warn("Unsupported option \"%s\"", this_opt); 397 + pr_warn("Unsupported option \"%s\"", this_opt); 399 398 } 400 399 401 - print_info("Panel=%s", fbdev->panel->name); 400 + pr_info("Panel=%s", fbdev->panel->name); 402 401 403 402 return 0; 404 403 } ··· 423 422 /* Allocate region for our registers and map them */ 424 423 regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0); 425 424 if (!regs_res) { 426 - print_err("fail to retrieve registers resource"); 425 + pr_err("fail to retrieve registers resource"); 427 426 return -EFAULT; 428 427 } 429 428 ··· 441 440 fbdev->info.fix.mmio_start, 442 441 fbdev->info.fix.mmio_len, 443 442 DRIVER_NAME)) { 444 - print_err("fail to lock memory region at 0x%08lx", 443 + pr_err("fail to lock memory region at 0x%08lx", 445 444 fbdev->info.fix.mmio_start); 446 445 return -EBUSY; 447 446 } 448 447 449 448 fbdev->regs = (struct au1100fb_regs*)KSEG1ADDR(fbdev->info.fix.mmio_start); 450 449 451 - print_dbg("Register memory map at %p", fbdev->regs); 452 - print_dbg("phys=0x%08x, size=%zu", fbdev->regs_phys, fbdev->regs_len); 450 + pr_devel("Register memory map at %p", fbdev->regs); 451 + pr_devel("phys=0x%08x, size=%zu", fbdev->regs_phys, fbdev->regs_len); 453 452 454 453 c = clk_get(NULL, "lcd_intclk"); 455 454 if (!IS_ERR(c)) { ··· 466 465 PAGE_ALIGN(fbdev->fb_len), 467 466 &fbdev->fb_phys, GFP_KERNEL); 468 467 if (!fbdev->fb_mem) { 469 - print_err("fail to allocate framebuffer (size: %zuK))", 468 + pr_err("fail to allocate framebuffer (size: %zuK))", 470 469 fbdev->fb_len / 1024); 471 470 return -ENOMEM; 472 471 } ··· 474 473 fbdev->info.fix.smem_start = fbdev->fb_phys; 475 474 fbdev->info.fix.smem_len = fbdev->fb_len; 476 475 477 - print_dbg("Framebuffer memory map at %p", fbdev->fb_mem); 478 - print_dbg("phys=0x%pad, size=%zuK", &fbdev->fb_phys, fbdev->fb_len / 1024); 476 + pr_devel("Framebuffer memory map at %p", fbdev->fb_mem); 477 + pr_devel("phys=0x%pad, size=%zuK", &fbdev->fb_phys, fbdev->fb_len / 1024); 479 478 480 479 /* load the panel info into the var struct */ 481 480 fbdev->info.var = (struct fb_var_screeninfo) { ··· 499 498 return -ENOMEM; 500 499 501 500 if (fb_alloc_cmap(&fbdev->info.cmap, AU1100_LCD_NBR_PALETTE_ENTRIES, 0) < 0) { 502 - print_err("Fail to allocate colormap (%d entries)", 501 + pr_err("Fail to allocate colormap (%d entries)", 503 502 AU1100_LCD_NBR_PALETTE_ENTRIES); 504 503 return -EFAULT; 505 504 } ··· 509 508 510 509 /* Register new framebuffer */ 511 510 if (register_framebuffer(&fbdev->info) < 0) { 512 - print_err("cannot register new framebuffer"); 511 + pr_err("cannot register new framebuffer"); 513 512 goto failed; 514 513 } 515 514
-10
drivers/video/fbdev/au1100fb.h
··· 30 30 #ifndef _AU1100LCD_H 31 31 #define _AU1100LCD_H 32 32 33 - #define print_err(f, arg...) printk(KERN_ERR DRIVER_NAME ": " f "\n", ## arg) 34 - #define print_warn(f, arg...) printk(KERN_WARNING DRIVER_NAME ": " f "\n", ## arg) 35 - #define print_info(f, arg...) printk(KERN_INFO DRIVER_NAME ": " f "\n", ## arg) 36 - 37 - #if DEBUG 38 - #define print_dbg(f, arg...) printk(__FILE__ ": " f "\n", ## arg) 39 - #else 40 - #define print_dbg(f, arg...) do {} while (0) 41 - #endif 42 - 43 33 #if defined(__BIG_ENDIAN) 44 34 #define LCD_CONTROL_DEFAULT_PO LCD_CONTROL_PO_11 45 35 #else