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