[PATCH 07/49] drivers/staging/dream: Convert printks to pr_<level>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
---
 drivers/staging/dream/gpio_axis.c         |    6 ++--
 drivers/staging/dream/gpio_event.c        |   19 ++++++-----
 drivers/staging/dream/gpio_input.c        |   49 ++++++++++++-----------------
 drivers/staging/dream/gpio_matrix.c       |   49 +++++++++++++++--------------
 drivers/staging/dream/gpio_output.c       |   10 ++---
 drivers/staging/dream/synaptics_i2c_rmi.c |   12 +++----
 6 files changed, 67 insertions(+), 78 deletions(-)

diff --git a/drivers/staging/dream/gpio_axis.c b/drivers/staging/dream/gpio_axis.c
index c801172..964bc61 100644
--- a/drivers/staging/dream/gpio_axis.c
+++ b/drivers/staging/dream/gpio_axis.c
@@ -79,9 +79,9 @@ static void gpio_event_update_axis(struct gpio_axis_state *as, int report)
 				change -= ai->decoded_size;
 			if (change == ai->decoded_size / 2) {
 				if (ai->flags & GPIOEAF_PRINT_EVENT)
-					pr_info("axis %d-%d unknown direction, "
-						"pos %d -> %d\n", ai->type,
-						ai->code, old_pos, pos);
+					pr_info("axis %d-%d unknown direction, pos %d -> %d\n",
+						ai->type, ai->code,
+						old_pos, pos);
 				change = 0; /* no closest direction */
 			}
 			if (ai->flags & GPIOEAF_PRINT_EVENT)
diff --git a/drivers/staging/dream/gpio_event.c b/drivers/staging/dream/gpio_event.c
index 8b64c1e..57e5fd9 100644
--- a/drivers/staging/dream/gpio_event.c
+++ b/drivers/staging/dream/gpio_event.c
@@ -13,6 +13,8 @@
  *
  */
 
+#define pr_fmt(fmt) "gpio_event_probe: " fmt
+
 #include <linux/earlysuspend.h>
 #include <linux/module.h>
 #include <linux/input.h>
@@ -58,14 +60,13 @@ static int gpio_event_call_all_func(struct gpio_event *ip, int func)
 		for (i = 0; i < ip->info->info_count; i++, ii++) {
 			if ((*ii)->func == NULL) {
 				ret = -ENODEV;
-				pr_err("gpio_event_probe: Incomplete pdata, "
-					"no function\n");
+				pr_err("Incomplete pdata, no function\n");
 				goto err_no_func;
 			}
 			ret = (*ii)->func(ip->input_dev, *ii, &ip->state[i],
 					  func);
 			if (ret) {
-				pr_err("gpio_event_probe: function failed\n");
+				pr_err("function failed\n");
 				goto err_func_failed;
 			}
 		}
@@ -113,20 +114,20 @@ static int __init gpio_event_probe(struct platform_device *pdev)
 
 	event_info = pdev->dev.platform_data;
 	if (event_info == NULL) {
-		pr_err("gpio_event_probe: No pdata\n");
+		pr_err("No pdata\n");
 		return -ENODEV;
 	}
 	if (event_info->name == NULL ||
 	   event_info->info == NULL ||
 	   event_info->info_count == 0) {
-		pr_err("gpio_event_probe: Incomplete pdata\n");
+		pr_err("Incomplete pdata\n");
 		return -ENODEV;
 	}
 	ip = kzalloc(sizeof(*ip) +
 		     sizeof(ip->state[0]) * event_info->info_count, GFP_KERNEL);
 	if (ip == NULL) {
 		err = -ENOMEM;
-		pr_err("gpio_event_probe: Failed to allocate private data\n");
+		pr_err("Failed to allocate private data\n");
 		goto err_kp_alloc_failed;
 	}
 	platform_set_drvdata(pdev, ip);
@@ -134,7 +135,7 @@ static int __init gpio_event_probe(struct platform_device *pdev)
 	input_dev = input_allocate_device();
 	if (input_dev == NULL) {
 		err = -ENOMEM;
-		pr_err("gpio_event_probe: Failed to allocate input device\n");
+		pr_err("Failed to allocate input device\n");
 		goto err_input_dev_alloc_failed;
 	}
 	input_set_drvdata(input_dev, ip);
@@ -159,8 +160,8 @@ static int __init gpio_event_probe(struct platform_device *pdev)
 
 	err = input_register_device(input_dev);
 	if (err) {
-		pr_err("gpio_event_probe: Unable to register %s input device\n",
-			input_dev->name);
+		pr_err("Unable to register %s input device\n",
+		       input_dev->name);
 		goto err_input_register_device_failed;
 	}
 
diff --git a/drivers/staging/dream/gpio_input.c b/drivers/staging/dream/gpio_input.c
index 7e307f2..96de112 100644
--- a/drivers/staging/dream/gpio_input.c
+++ b/drivers/staging/dream/gpio_input.c
@@ -79,8 +79,7 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)
 		if (key_state->debounce & DEBOUNCE_UNSTABLE) {
 			debounce = key_state->debounce = DEBOUNCE_UNKNOWN;
 			enable_irq(gpio_to_irq(key_entry->gpio));
-			pr_info("gpio_keys_scan_keys: key %x-%x, %d "
-				"(%d) continue debounce\n",
+			pr_info("gpio_keys_scan_keys: key %x-%x, %d (%d) continue debounce\n",
 				ds->info->type, key_entry->code,
 				i, key_entry->gpio);
 		}
@@ -91,8 +90,7 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)
 				ds->debounce_count++;
 				key_state->debounce = DEBOUNCE_UNKNOWN;
 				if (gpio_flags & GPIOEDF_PRINT_KEY_DEBOUNCE)
-					pr_info("gpio_keys_scan_keys: key %x-"
-						"%x, %d (%d) start debounce\n",
+					pr_info("gpio_keys_scan_keys: key %x-%x, %d (%d) start debounce\n",
 						ds->info->type, key_entry->code,
 						i, key_entry->gpio);
 			}
@@ -100,8 +98,7 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)
 		}
 		if (pressed && (debounce & DEBOUNCE_NOTPRESSED)) {
 			if (gpio_flags & GPIOEDF_PRINT_KEY_DEBOUNCE)
-				pr_info("gpio_keys_scan_keys: key %x-%x, %d "
-					"(%d) debounce pressed 1\n",
+				pr_info("gpio_keys_scan_keys: key %x-%x, %d (%d) debounce pressed 1\n",
 					ds->info->type, key_entry->code,
 					i, key_entry->gpio);
 			key_state->debounce = DEBOUNCE_PRESSED;
@@ -109,8 +106,7 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)
 		}
 		if (!pressed && (debounce & DEBOUNCE_PRESSED)) {
 			if (gpio_flags & GPIOEDF_PRINT_KEY_DEBOUNCE)
-				pr_info("gpio_keys_scan_keys: key %x-%x, %d "
-					"(%d) debounce pressed 0\n",
+				pr_info("gpio_keys_scan_keys: key %x-%x, %d (%d) debounce pressed 0\n",
 					ds->info->type, key_entry->code,
 					i, key_entry->gpio);
 			key_state->debounce = DEBOUNCE_NOTPRESSED;
@@ -123,9 +119,9 @@ static enum hrtimer_restart gpio_event_input_timer_func(struct hrtimer *timer)
 		else
 			key_state->debounce |= DEBOUNCE_POLL;
 		if (gpio_flags & GPIOEDF_PRINT_KEYS)
-			pr_info("gpio_keys_scan_keys: key %x-%x, %d (%d) "
-				"changed to %d\n", ds->info->type,
-				key_entry->code, i, key_entry->gpio, pressed);
+			pr_info("gpio_keys_scan_keys: key %x-%x, %d (%d) changed to %d\n",
+				ds->info->type, key_entry->code,
+				i, key_entry->gpio, pressed);
 		input_event(ds->input_dev, ds->info->type,
 			    key_entry->code, pressed);
 	}
@@ -176,8 +172,7 @@ static irqreturn_t gpio_event_input_irq_handler(int irq, void *dev_id)
 					HRTIMER_MODE_REL);
 			}
 			if (ds->info->flags & GPIOEDF_PRINT_KEY_DEBOUNCE)
-				pr_info("gpio_event_input_irq_handler: "
-					"key %x-%x, %d (%d) start debounce\n",
+				pr_info("gpio_event_input_irq_handler: key %x-%x, %d (%d) start debounce\n",
 					ds->info->type, key_entry->code,
 					keymap_index, key_entry->gpio);
 		} else {
@@ -189,10 +184,9 @@ static irqreturn_t gpio_event_input_irq_handler(int irq, void *dev_id)
 		pressed = gpio_get_value(key_entry->gpio) ^
 			!(ds->info->flags & GPIOEDF_ACTIVE_HIGH);
 		if (ds->info->flags & GPIOEDF_PRINT_KEYS)
-			pr_info("gpio_event_input_irq_handler: key %x-%x, %d "
-				"(%d) changed to %d\n",
-				ds->info->type, key_entry->code, keymap_index,
-				key_entry->gpio, pressed);
+			pr_info("gpio_event_input_irq_handler: key %x-%x, %d (%d) changed to %d\n",
+				ds->info->type, key_entry->code,
+				keymap_index, key_entry->gpio, pressed);
 		input_event(ds->input_dev, ds->info->type,
 			    key_entry->code, pressed);
 	}
@@ -213,9 +207,8 @@ static int gpio_event_input_request_irqs(struct gpio_input_state *ds)
 		err = request_irq(irq, gpio_event_input_irq_handler,
 				  req_flags, "gpio_keys", &ds->key_state[i]);
 		if (err) {
-			pr_err("gpio_event_input_request_irqs: request_irq "
-				"failed for input %d, irq %d\n",
-				ds->info->keymap[i].gpio, irq);
+			pr_err("%s: request_irq failed for input %d, irq %d\n",
+			       __func__, ds->info->keymap[i].gpio, irq);
 			goto err_request_irq_failed;
 		}
 		enable_irq_wake(irq);
@@ -270,8 +263,8 @@ int gpio_event_input_func(struct input_dev *input_dev,
 					di->keymap_size, GFP_KERNEL);
 		if (ds == NULL) {
 			ret = -ENOMEM;
-			pr_err("gpio_event_input_func: "
-				"Failed to allocate private data\n");
+			pr_err("%s: Failed to allocate private data\n",
+			       __func__);
 			goto err_ds_alloc_failed;
 		}
 		ds->debounce_count = di->keymap_size;
@@ -290,15 +283,14 @@ int gpio_event_input_func(struct input_dev *input_dev,
 		for (i = 0; i < di->keymap_size; i++) {
 			ret = gpio_request(di->keymap[i].gpio, "gpio_kp_in");
 			if (ret) {
-				pr_err("gpio_event_input_func: gpio_request "
-					"failed for %d\n", di->keymap[i].gpio);
+				pr_err("%s: gpio_request failed for %d\n",
+				       __func__, di->keymap[i].gpio);
 				goto err_gpio_request_failed;
 			}
 			ret = gpio_direction_input(di->keymap[i].gpio);
 			if (ret) {
-				pr_err("gpio_event_input_func: "
-					"gpio_direction_input failed for %d\n",
-					di->keymap[i].gpio);
+				pr_err("%s: gpio_direction_input failed for %d\n",
+				       __func__, di->keymap[i].gpio);
 				goto err_gpio_configure_failed;
 			}
 		}
@@ -308,8 +300,7 @@ int gpio_event_input_func(struct input_dev *input_dev,
 		spin_lock_irqsave(&ds->irq_lock, irqflags);
 		ds->use_irq = ret == 0;
 
-		pr_info("GPIO Input Driver: Start gpio inputs for %s in %s "
-			"mode\n",
+		pr_info("GPIO Input Driver: Start gpio inputs for %s in %s mode\n",
 			input_dev->name, ret == 0 ? "interrupt" : "polling");
 
 		hrtimer_init(&ds->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
diff --git a/drivers/staging/dream/gpio_matrix.c b/drivers/staging/dream/gpio_matrix.c
index c1f4765..c255ec2 100644
--- a/drivers/staging/dream/gpio_matrix.c
+++ b/drivers/staging/dream/gpio_matrix.c
@@ -13,6 +13,8 @@
  *
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/kernel.h>
 #include <linux/gpio.h>
 #include <linux/gpio_event.h>
@@ -41,14 +43,14 @@ static void clear_phantom_key(struct gpio_kp *kp, int out, int in)
 
 	if (!test_bit(keycode, kp->input_dev->key)) {
 		if (mi->flags & GPIOKPF_PRINT_PHANTOM_KEYS)
-			pr_info("gpiomatrix: phantom key %x, %d-%d (%d-%d) "
-				"cleared\n", keycode, out, in,
+			pr_info("phantom key %x, %d-%d (%d-%d) cleared\n",
+				keycode, out, in,
 				mi->output_gpios[out], mi->input_gpios[in]);
 		__clear_bit(key_index, kp->keys_pressed);
 	} else {
 		if (mi->flags & GPIOKPF_PRINT_PHANTOM_KEYS)
-			pr_info("gpiomatrix: phantom key %x, %d-%d (%d-%d) "
-				"not cleared\n", keycode, out, in,
+			pr_info("phantom key %x, %d-%d (%d-%d) not cleared\n",
+				keycode, out, in,
 				mi->output_gpios[out], mi->input_gpios[in]);
 	}
 }
@@ -108,14 +110,13 @@ static void report_key(struct gpio_kp *kp, int key_index, int out, int in)
 	if (pressed != test_bit(keycode, kp->input_dev->key)) {
 		if (keycode == KEY_RESERVED) {
 			if (mi->flags & GPIOKPF_PRINT_UNMAPPED_KEYS)
-				pr_info("gpiomatrix: unmapped key, %d-%d "
-					"(%d-%d) changed to %d\n",
+				pr_info("unmapped key, %d-%d (%d-%d) changed to %d\n",
 					out, in, mi->output_gpios[out],
 					mi->input_gpios[in], pressed);
 		} else {
 			if (mi->flags & GPIOKPF_PRINT_MAPPED_KEYS)
-				pr_info("gpiomatrix: key %x, %d-%d (%d-%d) "
-					"changed to %d\n", keycode,
+				pr_info("key %x, %d-%d (%d-%d) changed to %d\n",
+					keycode,
 					out, in, mi->output_gpios[out],
 					mi->input_gpios[in], pressed);
 			input_report_key(kp->input_dev, keycode, pressed);
@@ -257,14 +258,14 @@ static int gpio_keypad_request_irqs(struct gpio_kp *kp)
 		err = request_irq(irq, gpio_keypad_irq_handler, request_flags,
 				  "gpio_kp", kp);
 		if (err) {
-			pr_err("gpiomatrix: request_irq failed for input %d, "
-				"irq %d\n", mi->input_gpios[i], irq);
+			pr_err("request_irq failed for input %d, irq %d\n",
+			       mi->input_gpios[i], irq);
 			goto err_request_irq_failed;
 		}
 		err = set_irq_wake(irq, 1);
 		if (err) {
-			pr_err("gpiomatrix: set_irq_wake failed for input %d, "
-				"irq %d\n", mi->input_gpios[i], irq);
+			pr_err("set_irq_wake failed for input %d, irq %d\n",
+			       mi->input_gpios[i], irq);
 		}
 		disable_irq(irq);
 	}
@@ -322,15 +323,15 @@ int gpio_event_matrix_func(struct input_dev *input_dev,
 
 		for (i = 0; i < mi->noutputs; i++) {
 			if (gpio_cansleep(mi->output_gpios[i])) {
-				pr_err("gpiomatrix: unsupported output gpio %d,"
-					" can sleep\n", mi->output_gpios[i]);
+				pr_err("unsupported output gpio %d, can sleep\n",
+				       mi->output_gpios[i]);
 				err = -EINVAL;
 				goto err_request_output_gpio_failed;
 			}
 			err = gpio_request(mi->output_gpios[i], "gpio_kp_out");
 			if (err) {
-				pr_err("gpiomatrix: gpio_request failed for "
-					"output %d\n", mi->output_gpios[i]);
+				pr_err("gpio_request failed for output %d\n",
+				       mi->output_gpios[i]);
 				goto err_request_output_gpio_failed;
 			}
 			if (mi->flags & GPIOKPF_DRIVE_INACTIVE)
@@ -339,22 +340,22 @@ int gpio_event_matrix_func(struct input_dev *input_dev,
 			else
 				err = gpio_direction_input(mi->output_gpios[i]);
 			if (err) {
-				pr_err("gpiomatrix: gpio_configure failed for "
-					"output %d\n", mi->output_gpios[i]);
+				pr_err("gpio_configure failed for output %d\n",
+				       mi->output_gpios[i]);
 				goto err_output_gpio_configure_failed;
 			}
 		}
 		for (i = 0; i < mi->ninputs; i++) {
 			err = gpio_request(mi->input_gpios[i], "gpio_kp_in");
 			if (err) {
-				pr_err("gpiomatrix: gpio_request failed for "
-					"input %d\n", mi->input_gpios[i]);
+				pr_err("gpio_request failed for input %d\n",
+				       mi->input_gpios[i]);
 				goto err_request_input_gpio_failed;
 			}
 			err = gpio_direction_input(mi->input_gpios[i]);
 			if (err) {
-				pr_err("gpiomatrix: gpio_direction_input failed"
-					" for input %d\n", mi->input_gpios[i]);
+				pr_err("gpio_direction_input failed for input %d\n",
+				       mi->input_gpios[i]);
 				goto err_gpio_direction_input_failed;
 			}
 		}
@@ -367,8 +368,8 @@ int gpio_event_matrix_func(struct input_dev *input_dev,
 		err = gpio_keypad_request_irqs(kp);
 		kp->use_irq = err == 0;
 
-		pr_info("GPIO Matrix Keypad Driver: Start keypad matrix for %s "
-			"in %s mode\n", input_dev->name,
+		pr_info("GPIO Matrix Keypad Driver: Start keypad matrix for %s in %s mode\n",
+			input_dev->name,
 			kp->use_irq ? "interrupt" : "polling");
 
 		if (kp->use_irq)
diff --git a/drivers/staging/dream/gpio_output.c b/drivers/staging/dream/gpio_output.c
index 6f8453c..8044ced 100644
--- a/drivers/staging/dream/gpio_output.c
+++ b/drivers/staging/dream/gpio_output.c
@@ -56,16 +56,15 @@ int gpio_event_output_func(
 			ret = gpio_request(oi->keymap[i].gpio,
 					   "gpio_event_output");
 			if (ret) {
-				pr_err("gpio_event_output_func: gpio_request "
-					"failed for %d\n", oi->keymap[i].gpio);
+				pr_err("%s: gpio_request failed for %d\n",
+				       __func__, oi->keymap[i].gpio);
 				goto err_gpio_request_failed;
 			}
 			ret = gpio_direction_output(oi->keymap[i].gpio,
 						    output_level);
 			if (ret) {
-				pr_err("gpio_event_output_func: "
-					"gpio_direction_output failed for %d\n",
-					oi->keymap[i].gpio);
+				pr_err("%s: gpio_direction_output failed for %d\n",
+				       __func__, oi->keymap[i].gpio);
 				goto err_gpio_direction_output_failed;
 			}
 		}
@@ -81,4 +80,3 @@ err_gpio_request_failed:
 	}
 	return ret;
 }
-
diff --git a/drivers/staging/dream/synaptics_i2c_rmi.c b/drivers/staging/dream/synaptics_i2c_rmi.c
index ae696d3..1660233 100644
--- a/drivers/staging/dream/synaptics_i2c_rmi.c
+++ b/drivers/staging/dream/synaptics_i2c_rmi.c
@@ -189,13 +189,11 @@ static void synaptics_ts_work_func(struct work_struct *work)
 			continue;
 		}
 		if ((buf[14] & 0xc0) != 0x40) {
-			pr_warning("synaptics_ts_work_func:"
-			       " bad read %x %x %x %x %x %x %x %x %x"
-			       " %x %x %x %x %x %x, ret %d\n",
-			       buf[0], buf[1], buf[2], buf[3],
-			       buf[4], buf[5], buf[6], buf[7],
-			       buf[8], buf[9], buf[10], buf[11],
-			       buf[12], buf[13], buf[14], ret);
+			pr_warning("synaptics_ts_work_func: bad read %x %x %x %x %x %x %x %x %x %x %x %x %x %x %x, ret %d\n",
+				   buf[0], buf[1], buf[2], buf[3],
+				   buf[4], buf[5], buf[6], buf[7],
+				   buf[8], buf[9], buf[10], buf[11],
+				   buf[12], buf[13], buf[14], ret);
 			if (bad_data)
 				synaptics_init_panel(ts);
 			bad_data = 1;
-- 
1.6.5.rc3.dirty

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux