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

staging/olpc_dcon: fix checkpatch warnings

The below checkpatch warnings was fixed,

- WARNING: Prefer pr_debug(... to printk(KERN_DEBUG, ...
- WARNING: Prefer pr_warn(... to printk(KERN_WARNING, ...
- WARNING: Prefer pr_info(... to printk(KERN_INFO, ...
- WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

And added pr_fmt.

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
Acked-by: Andres Salomon <dilinger@queued.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Toshiaki Yamane and committed by
Greg Kroah-Hartman
ac9bbd08 4faf3a8d

+37 -37
+24 -29
drivers/staging/olpc_dcon/olpc_dcon.c
··· 11 11 * License as published by the Free Software Foundation. 12 12 */ 13 13 14 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 14 15 15 16 #include <linux/kernel.h> 16 17 #include <linux/fb.h> ··· 73 72 74 73 ver = dcon_read(dcon, DCON_REG_ID); 75 74 if ((ver >> 8) != 0xDC) { 76 - printk(KERN_ERR "olpc-dcon: DCON ID not 0xDCxx: 0x%04x instead.\n", 77 - ver); 75 + pr_err("DCON ID not 0xDCxx: 0x%04x instead.\n", ver); 78 76 rc = -ENXIO; 79 77 goto err; 80 78 } 81 79 82 80 if (is_init) { 83 - printk(KERN_INFO "olpc-dcon: Discovered DCON version %x\n", 84 - ver & 0xFF); 81 + pr_info("Discovered DCON version %x\n", ver & 0xFF); 85 82 rc = pdata->init(dcon); 86 83 if (rc != 0) { 87 - printk(KERN_ERR "olpc-dcon: Unable to init.\n"); 84 + pr_err("Unable to init.\n"); 88 85 goto err; 89 86 } 90 87 } ··· 136 137 x = 1; 137 138 x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0); 138 139 if (x) { 139 - printk(KERN_WARNING "olpc-dcon: unable to force dcon to power up: %d!\n", 140 - x); 140 + pr_warn("unable to force dcon to power up: %d!\n", x); 141 141 return x; 142 142 } 143 143 msleep(10); /* we'll be conservative */ ··· 149 151 x = dcon_read(dcon, DCON_REG_ID); 150 152 } 151 153 if (x < 0) { 152 - printk(KERN_ERR "olpc-dcon: unable to stabilize dcon's smbus, reasserting power and praying.\n"); 154 + pr_err("unable to stabilize dcon's smbus, reasserting power and praying.\n"); 153 155 BUG_ON(olpc_board_at_least(olpc_board(0xc2))); 154 156 x = 0; 155 157 olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0); ··· 220 222 x = 0; 221 223 x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0); 222 224 if (x) 223 - printk(KERN_WARNING "olpc-dcon: unable to force dcon to power down: %d!\n", 224 - x); 225 + pr_warn("unable to force dcon to power down: %d!\n", x); 225 226 else 226 227 dcon->asleep = sleep; 227 228 } else { ··· 229 232 dcon->disp_mode |= MODE_BL_ENABLE; 230 233 x = dcon_bus_stabilize(dcon, 1); 231 234 if (x) 232 - printk(KERN_WARNING "olpc-dcon: unable to reinit dcon hardware: %d!\n", 233 - x); 235 + pr_warn("unable to reinit dcon hardware: %d!\n", x); 234 236 else 235 237 dcon->asleep = sleep; 236 238 ··· 300 304 301 305 switch (source) { 302 306 case DCON_SOURCE_CPU: 303 - printk(KERN_INFO "dcon_source_switch to CPU\n"); 307 + pr_info("dcon_source_switch to CPU\n"); 304 308 /* Enable the scanline interrupt bit */ 305 309 if (dcon_write(dcon, DCON_REG_MODE, 306 310 dcon->disp_mode | MODE_SCAN_INT)) 307 - printk(KERN_ERR 308 - "olpc-dcon: couldn't enable scanline interrupt!\n"); 311 + pr_err("couldn't enable scanline interrupt!\n"); 309 312 else { 310 313 /* Wait up to one second for the scanline interrupt */ 311 314 wait_event_timeout(dcon_wait_queue, ··· 312 317 } 313 318 314 319 if (!dcon->switched) 315 - printk(KERN_ERR "olpc-dcon: Timeout entering CPU mode; expect a screen glitch.\n"); 320 + pr_err("Timeout entering CPU mode; expect a screen glitch.\n"); 316 321 317 322 /* Turn off the scanline interrupt */ 318 323 if (dcon_write(dcon, DCON_REG_MODE, dcon->disp_mode)) 319 - printk(KERN_ERR "olpc-dcon: couldn't disable scanline interrupt!\n"); 324 + pr_err("couldn't disable scanline interrupt!\n"); 320 325 321 326 /* 322 327 * Ideally we'd like to disable interrupts here so that the ··· 327 332 * For now, we just hope.. 328 333 */ 329 334 if (!dcon_blank_fb(dcon, false)) { 330 - printk(KERN_ERR "olpc-dcon: Failed to enter CPU mode\n"); 335 + pr_err("Failed to enter CPU mode\n"); 331 336 dcon->pending_src = DCON_SOURCE_DCON; 332 337 return; 333 338 } ··· 336 341 pdata->set_dconload(1); 337 342 getnstimeofday(&dcon->load_time); 338 343 339 - printk(KERN_INFO "olpc-dcon: The CPU has control\n"); 344 + pr_info("The CPU has control\n"); 340 345 break; 341 346 case DCON_SOURCE_DCON: 342 347 { 343 348 int t; 344 349 struct timespec delta_t; 345 350 346 - printk(KERN_INFO "dcon_source_switch to DCON\n"); 351 + pr_info("dcon_source_switch to DCON\n"); 347 352 348 353 add_wait_queue(&dcon_wait_queue, &wait); 349 354 set_current_state(TASK_UNINTERRUPTIBLE); ··· 357 362 set_current_state(TASK_RUNNING); 358 363 359 364 if (!dcon->switched) { 360 - printk(KERN_ERR "olpc-dcon: Timeout entering DCON mode; expect a screen glitch.\n"); 365 + pr_err("Timeout entering DCON mode; expect a screen glitch.\n"); 361 366 } else { 362 367 /* sometimes the DCON doesn't follow its own rules, 363 368 * and doesn't wait for two vsync pulses before ··· 373 378 delta_t = timespec_sub(dcon->irq_time, dcon->load_time); 374 379 if (dcon->switched && delta_t.tv_sec == 0 && 375 380 delta_t.tv_nsec < NSEC_PER_MSEC * 20) { 376 - printk(KERN_ERR "olpc-dcon: missed loading, retrying\n"); 381 + pr_err("missed loading, retrying\n"); 377 382 pdata->set_dconload(1); 378 383 mdelay(41); 379 384 pdata->set_dconload(0); ··· 383 388 } 384 389 385 390 dcon_blank_fb(dcon, true); 386 - printk(KERN_INFO "olpc-dcon: The DCON has control\n"); 391 + pr_info("The DCON has control\n"); 387 392 break; 388 393 } 389 394 default: ··· 471 476 if (ret) 472 477 return ret; 473 478 474 - printk(KERN_INFO "dcon_freeze_store: %lu\n", output); 479 + pr_info("dcon_freeze_store: %lu\n", output); 475 480 476 481 switch (output) { 477 482 case 0: ··· 645 650 dcon_device = platform_device_alloc("dcon", -1); 646 651 647 652 if (dcon_device == NULL) { 648 - printk(KERN_ERR "dcon: Unable to create the DCON device\n"); 653 + pr_err("Unable to create the DCON device\n"); 649 654 rc = -ENOMEM; 650 655 goto eirq; 651 656 } ··· 653 658 platform_set_drvdata(dcon_device, dcon); 654 659 655 660 if (rc) { 656 - printk(KERN_ERR "dcon: Unable to add the DCON device\n"); 661 + pr_err("Unable to add the DCON device\n"); 657 662 goto edev; 658 663 } 659 664 ··· 757 762 758 763 switch (status & 3) { 759 764 case 3: 760 - printk(KERN_DEBUG "olpc-dcon: DCONLOAD_MISSED interrupt\n"); 765 + pr_debug("DCONLOAD_MISSED interrupt\n"); 761 766 break; 762 767 763 768 case 2: /* switch to DCON mode */ ··· 779 784 dcon->switched = true; 780 785 getnstimeofday(&dcon->irq_time); 781 786 wake_up(&dcon_wait_queue); 782 - printk(KERN_DEBUG "olpc-dcon: switching w/ status 0/0\n"); 787 + pr_debug("switching w/ status 0/0\n"); 783 788 } else { 784 - printk(KERN_DEBUG "olpc-dcon: scanline interrupt w/CPU\n"); 789 + pr_debug("scanline interrupt w/CPU\n"); 785 790 } 786 791 } 787 792
+9 -6
drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
··· 10 10 * modify it under the terms of version 2 of the GNU General Public 11 11 * License as published by the Free Software Foundation. 12 12 */ 13 + 14 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 15 + 13 16 #include <linux/cs5535.h> 14 17 #include <linux/gpio.h> 15 18 #include <linux/delay.h> ··· 25 22 unsigned char lob; 26 23 27 24 if (gpio_request(OLPC_GPIO_DCON_STAT0, "OLPC-DCON")) { 28 - printk(KERN_ERR "olpc-dcon: failed to request STAT0 GPIO\n"); 25 + pr_err("failed to request STAT0 GPIO\n"); 29 26 return -EIO; 30 27 } 31 28 if (gpio_request(OLPC_GPIO_DCON_STAT1, "OLPC-DCON")) { 32 - printk(KERN_ERR "olpc-dcon: failed to request STAT1 GPIO\n"); 29 + pr_err("failed to request STAT1 GPIO\n"); 33 30 goto err_gp_stat1; 34 31 } 35 32 if (gpio_request(OLPC_GPIO_DCON_IRQ, "OLPC-DCON")) { 36 - printk(KERN_ERR "olpc-dcon: failed to request IRQ GPIO\n"); 33 + pr_err("failed to request IRQ GPIO\n"); 37 34 goto err_gp_irq; 38 35 } 39 36 if (gpio_request(OLPC_GPIO_DCON_LOAD, "OLPC-DCON")) { 40 - printk(KERN_ERR "olpc-dcon: failed to request LOAD GPIO\n"); 37 + pr_err("failed to request LOAD GPIO\n"); 41 38 goto err_gp_load; 42 39 } 43 40 if (gpio_request(OLPC_GPIO_DCON_BLANK, "OLPC-DCON")) { 44 - printk(KERN_ERR "olpc-dcon: failed to request BLANK GPIO\n"); 41 + pr_err("failed to request BLANK GPIO\n"); 45 42 goto err_gp_blank; 46 43 } 47 44 ··· 86 83 87 84 /* Register the interrupt handler */ 88 85 if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", dcon)) { 89 - printk(KERN_ERR "olpc-dcon: failed to request DCON's irq\n"); 86 + pr_err("failed to request DCON's irq\n"); 90 87 goto err_req_irq; 91 88 } 92 89
+4 -2
drivers/staging/olpc_dcon/olpc_dcon_xo_1_5.c
··· 6 6 * License as published by the Free Software Foundation. 7 7 */ 8 8 9 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 10 + 9 11 #include <linux/acpi.h> 10 12 #include <linux/delay.h> 11 13 #include <linux/pci.h> ··· 68 66 pdev = pci_get_device(PCI_VENDOR_ID_VIA, 69 67 PCI_DEVICE_ID_VIA_VX855, NULL); 70 68 if (!pdev) { 71 - printk(KERN_ERR "cannot find VX855 PCI ID\n"); 69 + pr_err("cannot find VX855 PCI ID\n"); 72 70 return 1; 73 71 } 74 72 ··· 106 104 /* we're sharing the IRQ with ACPI */ 107 105 irq = acpi_gbl_FADT.sci_interrupt; 108 106 if (request_irq(irq, &dcon_interrupt, IRQF_SHARED, "DCON", dcon)) { 109 - printk(KERN_ERR PREFIX "DCON (IRQ%d) allocation failed\n", irq); 107 + pr_err("DCON (IRQ%d) allocation failed\n", irq); 110 108 return 1; 111 109 } 112 110