Commit ac9bbd08 authored by Toshiaki Yamane's avatar Toshiaki Yamane Committed by Greg Kroah-Hartman

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: default avatarToshiaki Yamane <yamanetoshi@gmail.com>
Acked-by: default avatarAndres Salomon <dilinger@queued.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4faf3a8d
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
* License as published by the Free Software Foundation. * License as published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/fb.h> #include <linux/fb.h>
...@@ -72,18 +73,16 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init) ...@@ -72,18 +73,16 @@ static int dcon_hw_init(struct dcon_priv *dcon, int is_init)
ver = dcon_read(dcon, DCON_REG_ID); ver = dcon_read(dcon, DCON_REG_ID);
if ((ver >> 8) != 0xDC) { if ((ver >> 8) != 0xDC) {
printk(KERN_ERR "olpc-dcon: DCON ID not 0xDCxx: 0x%04x instead.\n", pr_err("DCON ID not 0xDCxx: 0x%04x instead.\n", ver);
ver);
rc = -ENXIO; rc = -ENXIO;
goto err; goto err;
} }
if (is_init) { if (is_init) {
printk(KERN_INFO "olpc-dcon: Discovered DCON version %x\n", pr_info("Discovered DCON version %x\n", ver & 0xFF);
ver & 0xFF);
rc = pdata->init(dcon); rc = pdata->init(dcon);
if (rc != 0) { if (rc != 0) {
printk(KERN_ERR "olpc-dcon: Unable to init.\n"); pr_err("Unable to init.\n");
goto err; goto err;
} }
} }
...@@ -137,8 +136,7 @@ static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down) ...@@ -137,8 +136,7 @@ static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down)
x = 1; x = 1;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0); x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x) { if (x) {
printk(KERN_WARNING "olpc-dcon: unable to force dcon to power up: %d!\n", pr_warn("unable to force dcon to power up: %d!\n", x);
x);
return x; return x;
} }
msleep(10); /* we'll be conservative */ msleep(10); /* we'll be conservative */
...@@ -151,7 +149,7 @@ static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down) ...@@ -151,7 +149,7 @@ static int dcon_bus_stabilize(struct dcon_priv *dcon, int is_powered_down)
x = dcon_read(dcon, DCON_REG_ID); x = dcon_read(dcon, DCON_REG_ID);
} }
if (x < 0) { if (x < 0) {
printk(KERN_ERR "olpc-dcon: unable to stabilize dcon's smbus, reasserting power and praying.\n"); pr_err("unable to stabilize dcon's smbus, reasserting power and praying.\n");
BUG_ON(olpc_board_at_least(olpc_board(0xc2))); BUG_ON(olpc_board_at_least(olpc_board(0xc2)));
x = 0; x = 0;
olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0); 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,8 +220,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
x = 0; x = 0;
x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0); x = olpc_ec_cmd(0x26, (unsigned char *)&x, 1, NULL, 0);
if (x) if (x)
printk(KERN_WARNING "olpc-dcon: unable to force dcon to power down: %d!\n", pr_warn("unable to force dcon to power down: %d!\n", x);
x);
else else
dcon->asleep = sleep; dcon->asleep = sleep;
} else { } else {
...@@ -232,8 +229,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep) ...@@ -232,8 +229,7 @@ static void dcon_sleep(struct dcon_priv *dcon, bool sleep)
dcon->disp_mode |= MODE_BL_ENABLE; dcon->disp_mode |= MODE_BL_ENABLE;
x = dcon_bus_stabilize(dcon, 1); x = dcon_bus_stabilize(dcon, 1);
if (x) if (x)
printk(KERN_WARNING "olpc-dcon: unable to reinit dcon hardware: %d!\n", pr_warn("unable to reinit dcon hardware: %d!\n", x);
x);
else else
dcon->asleep = sleep; dcon->asleep = sleep;
...@@ -304,12 +300,11 @@ static void dcon_source_switch(struct work_struct *work) ...@@ -304,12 +300,11 @@ static void dcon_source_switch(struct work_struct *work)
switch (source) { switch (source) {
case DCON_SOURCE_CPU: case DCON_SOURCE_CPU:
printk(KERN_INFO "dcon_source_switch to CPU\n"); pr_info("dcon_source_switch to CPU\n");
/* Enable the scanline interrupt bit */ /* Enable the scanline interrupt bit */
if (dcon_write(dcon, DCON_REG_MODE, if (dcon_write(dcon, DCON_REG_MODE,
dcon->disp_mode | MODE_SCAN_INT)) dcon->disp_mode | MODE_SCAN_INT))
printk(KERN_ERR pr_err("couldn't enable scanline interrupt!\n");
"olpc-dcon: couldn't enable scanline interrupt!\n");
else { else {
/* Wait up to one second for the scanline interrupt */ /* Wait up to one second for the scanline interrupt */
wait_event_timeout(dcon_wait_queue, wait_event_timeout(dcon_wait_queue,
...@@ -317,11 +312,11 @@ static void dcon_source_switch(struct work_struct *work) ...@@ -317,11 +312,11 @@ static void dcon_source_switch(struct work_struct *work)
} }
if (!dcon->switched) if (!dcon->switched)
printk(KERN_ERR "olpc-dcon: Timeout entering CPU mode; expect a screen glitch.\n"); pr_err("Timeout entering CPU mode; expect a screen glitch.\n");
/* Turn off the scanline interrupt */ /* Turn off the scanline interrupt */
if (dcon_write(dcon, DCON_REG_MODE, dcon->disp_mode)) if (dcon_write(dcon, DCON_REG_MODE, dcon->disp_mode))
printk(KERN_ERR "olpc-dcon: couldn't disable scanline interrupt!\n"); pr_err("couldn't disable scanline interrupt!\n");
/* /*
* Ideally we'd like to disable interrupts here so that the * 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,7 +327,7 @@ static void dcon_source_switch(struct work_struct *work)
* For now, we just hope.. * For now, we just hope..
*/ */
if (!dcon_blank_fb(dcon, false)) { if (!dcon_blank_fb(dcon, false)) {
printk(KERN_ERR "olpc-dcon: Failed to enter CPU mode\n"); pr_err("Failed to enter CPU mode\n");
dcon->pending_src = DCON_SOURCE_DCON; dcon->pending_src = DCON_SOURCE_DCON;
return; return;
} }
...@@ -341,14 +336,14 @@ static void dcon_source_switch(struct work_struct *work) ...@@ -341,14 +336,14 @@ static void dcon_source_switch(struct work_struct *work)
pdata->set_dconload(1); pdata->set_dconload(1);
getnstimeofday(&dcon->load_time); getnstimeofday(&dcon->load_time);
printk(KERN_INFO "olpc-dcon: The CPU has control\n"); pr_info("The CPU has control\n");
break; break;
case DCON_SOURCE_DCON: case DCON_SOURCE_DCON:
{ {
int t; int t;
struct timespec delta_t; struct timespec delta_t;
printk(KERN_INFO "dcon_source_switch to DCON\n"); pr_info("dcon_source_switch to DCON\n");
add_wait_queue(&dcon_wait_queue, &wait); add_wait_queue(&dcon_wait_queue, &wait);
set_current_state(TASK_UNINTERRUPTIBLE); set_current_state(TASK_UNINTERRUPTIBLE);
...@@ -362,7 +357,7 @@ static void dcon_source_switch(struct work_struct *work) ...@@ -362,7 +357,7 @@ static void dcon_source_switch(struct work_struct *work)
set_current_state(TASK_RUNNING); set_current_state(TASK_RUNNING);
if (!dcon->switched) { if (!dcon->switched) {
printk(KERN_ERR "olpc-dcon: Timeout entering DCON mode; expect a screen glitch.\n"); pr_err("Timeout entering DCON mode; expect a screen glitch.\n");
} else { } else {
/* sometimes the DCON doesn't follow its own rules, /* sometimes the DCON doesn't follow its own rules,
* and doesn't wait for two vsync pulses before * and doesn't wait for two vsync pulses before
...@@ -378,7 +373,7 @@ static void dcon_source_switch(struct work_struct *work) ...@@ -378,7 +373,7 @@ static void dcon_source_switch(struct work_struct *work)
delta_t = timespec_sub(dcon->irq_time, dcon->load_time); delta_t = timespec_sub(dcon->irq_time, dcon->load_time);
if (dcon->switched && delta_t.tv_sec == 0 && if (dcon->switched && delta_t.tv_sec == 0 &&
delta_t.tv_nsec < NSEC_PER_MSEC * 20) { delta_t.tv_nsec < NSEC_PER_MSEC * 20) {
printk(KERN_ERR "olpc-dcon: missed loading, retrying\n"); pr_err("missed loading, retrying\n");
pdata->set_dconload(1); pdata->set_dconload(1);
mdelay(41); mdelay(41);
pdata->set_dconload(0); pdata->set_dconload(0);
...@@ -388,7 +383,7 @@ static void dcon_source_switch(struct work_struct *work) ...@@ -388,7 +383,7 @@ static void dcon_source_switch(struct work_struct *work)
} }
dcon_blank_fb(dcon, true); dcon_blank_fb(dcon, true);
printk(KERN_INFO "olpc-dcon: The DCON has control\n"); pr_info("The DCON has control\n");
break; break;
} }
default: default:
...@@ -476,7 +471,7 @@ static ssize_t dcon_freeze_store(struct device *dev, ...@@ -476,7 +471,7 @@ static ssize_t dcon_freeze_store(struct device *dev,
if (ret) if (ret)
return ret; return ret;
printk(KERN_INFO "dcon_freeze_store: %lu\n", output); pr_info("dcon_freeze_store: %lu\n", output);
switch (output) { switch (output) {
case 0: case 0:
...@@ -650,7 +645,7 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -650,7 +645,7 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
dcon_device = platform_device_alloc("dcon", -1); dcon_device = platform_device_alloc("dcon", -1);
if (dcon_device == NULL) { if (dcon_device == NULL) {
printk(KERN_ERR "dcon: Unable to create the DCON device\n"); pr_err("Unable to create the DCON device\n");
rc = -ENOMEM; rc = -ENOMEM;
goto eirq; goto eirq;
} }
...@@ -658,7 +653,7 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id) ...@@ -658,7 +653,7 @@ static int dcon_probe(struct i2c_client *client, const struct i2c_device_id *id)
platform_set_drvdata(dcon_device, dcon); platform_set_drvdata(dcon_device, dcon);
if (rc) { if (rc) {
printk(KERN_ERR "dcon: Unable to add the DCON device\n"); pr_err("Unable to add the DCON device\n");
goto edev; goto edev;
} }
...@@ -762,7 +757,7 @@ irqreturn_t dcon_interrupt(int irq, void *id) ...@@ -762,7 +757,7 @@ irqreturn_t dcon_interrupt(int irq, void *id)
switch (status & 3) { switch (status & 3) {
case 3: case 3:
printk(KERN_DEBUG "olpc-dcon: DCONLOAD_MISSED interrupt\n"); pr_debug("DCONLOAD_MISSED interrupt\n");
break; break;
case 2: /* switch to DCON mode */ case 2: /* switch to DCON mode */
...@@ -784,9 +779,9 @@ irqreturn_t dcon_interrupt(int irq, void *id) ...@@ -784,9 +779,9 @@ irqreturn_t dcon_interrupt(int irq, void *id)
dcon->switched = true; dcon->switched = true;
getnstimeofday(&dcon->irq_time); getnstimeofday(&dcon->irq_time);
wake_up(&dcon_wait_queue); wake_up(&dcon_wait_queue);
printk(KERN_DEBUG "olpc-dcon: switching w/ status 0/0\n"); pr_debug("switching w/ status 0/0\n");
} else { } else {
printk(KERN_DEBUG "olpc-dcon: scanline interrupt w/CPU\n"); pr_debug("scanline interrupt w/CPU\n");
} }
} }
......
...@@ -10,6 +10,9 @@ ...@@ -10,6 +10,9 @@
* modify it under the terms of version 2 of the GNU General Public * modify it under the terms of version 2 of the GNU General Public
* License as published by the Free Software Foundation. * License as published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/cs5535.h> #include <linux/cs5535.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -22,23 +25,23 @@ static int dcon_init_xo_1(struct dcon_priv *dcon) ...@@ -22,23 +25,23 @@ static int dcon_init_xo_1(struct dcon_priv *dcon)
unsigned char lob; unsigned char lob;
if (gpio_request(OLPC_GPIO_DCON_STAT0, "OLPC-DCON")) { if (gpio_request(OLPC_GPIO_DCON_STAT0, "OLPC-DCON")) {
printk(KERN_ERR "olpc-dcon: failed to request STAT0 GPIO\n"); pr_err("failed to request STAT0 GPIO\n");
return -EIO; return -EIO;
} }
if (gpio_request(OLPC_GPIO_DCON_STAT1, "OLPC-DCON")) { if (gpio_request(OLPC_GPIO_DCON_STAT1, "OLPC-DCON")) {
printk(KERN_ERR "olpc-dcon: failed to request STAT1 GPIO\n"); pr_err("failed to request STAT1 GPIO\n");
goto err_gp_stat1; goto err_gp_stat1;
} }
if (gpio_request(OLPC_GPIO_DCON_IRQ, "OLPC-DCON")) { if (gpio_request(OLPC_GPIO_DCON_IRQ, "OLPC-DCON")) {
printk(KERN_ERR "olpc-dcon: failed to request IRQ GPIO\n"); pr_err("failed to request IRQ GPIO\n");
goto err_gp_irq; goto err_gp_irq;
} }
if (gpio_request(OLPC_GPIO_DCON_LOAD, "OLPC-DCON")) { if (gpio_request(OLPC_GPIO_DCON_LOAD, "OLPC-DCON")) {
printk(KERN_ERR "olpc-dcon: failed to request LOAD GPIO\n"); pr_err("failed to request LOAD GPIO\n");
goto err_gp_load; goto err_gp_load;
} }
if (gpio_request(OLPC_GPIO_DCON_BLANK, "OLPC-DCON")) { if (gpio_request(OLPC_GPIO_DCON_BLANK, "OLPC-DCON")) {
printk(KERN_ERR "olpc-dcon: failed to request BLANK GPIO\n"); pr_err("failed to request BLANK GPIO\n");
goto err_gp_blank; goto err_gp_blank;
} }
...@@ -83,7 +86,7 @@ static int dcon_init_xo_1(struct dcon_priv *dcon) ...@@ -83,7 +86,7 @@ static int dcon_init_xo_1(struct dcon_priv *dcon)
/* Register the interrupt handler */ /* Register the interrupt handler */
if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", dcon)) { if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", dcon)) {
printk(KERN_ERR "olpc-dcon: failed to request DCON's irq\n"); pr_err("failed to request DCON's irq\n");
goto err_req_irq; goto err_req_irq;
} }
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* License as published by the Free Software Foundation. * License as published by the Free Software Foundation.
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -66,7 +68,7 @@ static int dcon_init_xo_1_5(struct dcon_priv *dcon) ...@@ -66,7 +68,7 @@ static int dcon_init_xo_1_5(struct dcon_priv *dcon)
pdev = pci_get_device(PCI_VENDOR_ID_VIA, pdev = pci_get_device(PCI_VENDOR_ID_VIA,
PCI_DEVICE_ID_VIA_VX855, NULL); PCI_DEVICE_ID_VIA_VX855, NULL);
if (!pdev) { if (!pdev) {
printk(KERN_ERR "cannot find VX855 PCI ID\n"); pr_err("cannot find VX855 PCI ID\n");
return 1; return 1;
} }
...@@ -104,7 +106,7 @@ static int dcon_init_xo_1_5(struct dcon_priv *dcon) ...@@ -104,7 +106,7 @@ static int dcon_init_xo_1_5(struct dcon_priv *dcon)
/* we're sharing the IRQ with ACPI */ /* we're sharing the IRQ with ACPI */
irq = acpi_gbl_FADT.sci_interrupt; irq = acpi_gbl_FADT.sci_interrupt;
if (request_irq(irq, &dcon_interrupt, IRQF_SHARED, "DCON", dcon)) { if (request_irq(irq, &dcon_interrupt, IRQF_SHARED, "DCON", dcon)) {
printk(KERN_ERR PREFIX "DCON (IRQ%d) allocation failed\n", irq); pr_err("DCON (IRQ%d) allocation failed\n", irq);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment