* [PATCH] Input: wacom - use dev_xxx() instead of naked printk()s and dbg()s
@ 2012-04-30 5:51 Dmitry Torokhov
2012-05-01 16:23 ` Chris Bagwell
0 siblings, 1 reply; 2+ messages in thread
From: Dmitry Torokhov @ 2012-04-30 5:51 UTC (permalink / raw)
To: linux-input; +Cc: Ping Cheng, Chris Bagwell, Jason Gerecke
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
---
drivers/input/tablet/wacom_sys.c | 15 ++++++++-------
drivers/input/tablet/wacom_wac.c | 29 +++++++++++++++++++----------
2 files changed, 27 insertions(+), 17 deletions(-)
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index 8f3b30b..b3a8bd3 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -522,7 +522,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
error = usb_get_extra_descriptor(&interface->endpoint[0],
HID_DEVICET_REPORT, &hid_desc);
if (error) {
- printk(KERN_ERR "wacom: can not retrieve extra class descriptor\n");
+ dev_err(&intf->dev,
+ "can not retrieve extra class descriptor\n");
goto out;
}
}
@@ -1040,13 +1041,13 @@ static void wacom_wireless_work(struct work_struct *work)
wacom->wacom_wac.input = NULL;
if (wacom_wac->pid == 0) {
- printk(KERN_INFO "wacom: wireless tablet disconnected\n");
+ dev_info(&wacom->intf->dev, "wireless tablet disconnected\n");
} else {
const struct usb_device_id *id = wacom_ids;
- printk(KERN_INFO
- "wacom: wireless tablet connected with PID %x\n",
- wacom_wac->pid);
+ dev_info(&wacom->intf->dev,
+ "wireless tablet connected with PID %x\n",
+ wacom_wac->pid);
while (id->match_flags) {
if (id->idVendor == USB_VENDOR_ID_WACOM &&
@@ -1056,8 +1057,8 @@ static void wacom_wireless_work(struct work_struct *work)
}
if (!id->match_flags) {
- printk(KERN_INFO
- "wacom: ignorning unknown PID.\n");
+ dev_info(&wacom->intf->dev,
+ "ignoring unknown PID.\n");
return;
}
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 10e5cf8..004bc1b 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -61,7 +61,8 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom)
break;
default:
- printk(KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n", data[0]);
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d\n", __func__, data[0]);
return 0;
}
@@ -76,7 +77,8 @@ static int wacom_pl_irq(struct wacom_wac *wacom)
int prox, pressure;
if (data[0] != WACOM_REPORT_PENABLED) {
- dbg("wacom_pl_irq: received unknown report #%d", data[0]);
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d\n", __func__, data[0]);
return 0;
}
@@ -146,7 +148,8 @@ static int wacom_ptu_irq(struct wacom_wac *wacom)
struct input_dev *input = wacom->input;
if (data[0] != WACOM_REPORT_PENABLED) {
- printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]);
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d\n", __func__, data[0]);
return 0;
}
@@ -175,7 +178,8 @@ static int wacom_dtu_irq(struct wacom_wac *wacom)
struct input_dev *input = wacom->input;
int prox = data[1] & 0x20, pressure;
- dbg("wacom_dtu_irq: received report #%d", data[0]);
+ dev_dbg(input->dev.parent,
+ "%s: received report #%d", __func__, data[0]);
if (prox) {
/* Going into proximity select tool */
@@ -211,7 +215,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
int retval = 0;
if (data[0] != WACOM_REPORT_PENABLED) {
- dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d\n", __func__, data[0]);
goto exit;
}
@@ -489,10 +494,13 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
unsigned int t;
int idx = 0, result;
- if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD
- && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD
- && data[0] != WACOM_REPORT_INTUOS5PAD) {
- dbg("wacom_intuos_irq: received unknown report #%d", data[0]);
+ if (data[0] != WACOM_REPORT_PENABLED &&
+ data[0] != WACOM_REPORT_INTUOSREAD &&
+ data[0] != WACOM_REPORT_INTUOSWRITE &&
+ data[0] != WACOM_REPORT_INTUOSPAD &&
+ data[0] != WACOM_REPORT_INTUOS5PAD) {
+ dev_dbg(input->dev.parent,
+ "%s: received unknown report #%d\n", __func__, data[0]);
return 0;
}
@@ -938,7 +946,8 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
{
char *data = wacom->data;
- dbg("wacom_tpc_irq: received report #%d", data[0]);
+ dev_dbg(wacom->input->dev.parent,
+ "%s: received report #%d\n", __func__, data[0]);
switch (len) {
case WACOM_PKGLEN_TPC1FG:
--
1.7.7.6
--
Dmitry
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Input: wacom - use dev_xxx() instead of naked printk()s and dbg()s
2012-04-30 5:51 [PATCH] Input: wacom - use dev_xxx() instead of naked printk()s and dbg()s Dmitry Torokhov
@ 2012-05-01 16:23 ` Chris Bagwell
0 siblings, 0 replies; 2+ messages in thread
From: Chris Bagwell @ 2012-05-01 16:23 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, Ping Cheng, Jason Gerecke
On Mon, Apr 30, 2012 at 12:51 AM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Nice alignment to same debug levels as well.
Reviewed-by: Chris Bagwell <chris@cnpbagwell.com>
> ---
> drivers/input/tablet/wacom_sys.c | 15 ++++++++-------
> drivers/input/tablet/wacom_wac.c | 29 +++++++++++++++++++----------
> 2 files changed, 27 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index 8f3b30b..b3a8bd3 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -522,7 +522,8 @@ static int wacom_retrieve_hid_descriptor(struct usb_interface *intf,
> error = usb_get_extra_descriptor(&interface->endpoint[0],
> HID_DEVICET_REPORT, &hid_desc);
> if (error) {
> - printk(KERN_ERR "wacom: can not retrieve extra class descriptor\n");
> + dev_err(&intf->dev,
> + "can not retrieve extra class descriptor\n");
> goto out;
> }
> }
> @@ -1040,13 +1041,13 @@ static void wacom_wireless_work(struct work_struct *work)
> wacom->wacom_wac.input = NULL;
>
> if (wacom_wac->pid == 0) {
> - printk(KERN_INFO "wacom: wireless tablet disconnected\n");
> + dev_info(&wacom->intf->dev, "wireless tablet disconnected\n");
> } else {
> const struct usb_device_id *id = wacom_ids;
>
> - printk(KERN_INFO
> - "wacom: wireless tablet connected with PID %x\n",
> - wacom_wac->pid);
> + dev_info(&wacom->intf->dev,
> + "wireless tablet connected with PID %x\n",
> + wacom_wac->pid);
>
> while (id->match_flags) {
> if (id->idVendor == USB_VENDOR_ID_WACOM &&
> @@ -1056,8 +1057,8 @@ static void wacom_wireless_work(struct work_struct *work)
> }
>
> if (!id->match_flags) {
> - printk(KERN_INFO
> - "wacom: ignorning unknown PID.\n");
> + dev_info(&wacom->intf->dev,
> + "ignoring unknown PID.\n");
> return;
> }
>
> diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
> index 10e5cf8..004bc1b 100644
> --- a/drivers/input/tablet/wacom_wac.c
> +++ b/drivers/input/tablet/wacom_wac.c
> @@ -61,7 +61,8 @@ static int wacom_penpartner_irq(struct wacom_wac *wacom)
> break;
>
> default:
> - printk(KERN_INFO "wacom_penpartner_irq: received unknown report #%d\n", data[0]);
> + dev_dbg(input->dev.parent,
> + "%s: received unknown report #%d\n", __func__, data[0]);
> return 0;
> }
>
> @@ -76,7 +77,8 @@ static int wacom_pl_irq(struct wacom_wac *wacom)
> int prox, pressure;
>
> if (data[0] != WACOM_REPORT_PENABLED) {
> - dbg("wacom_pl_irq: received unknown report #%d", data[0]);
> + dev_dbg(input->dev.parent,
> + "%s: received unknown report #%d\n", __func__, data[0]);
> return 0;
> }
>
> @@ -146,7 +148,8 @@ static int wacom_ptu_irq(struct wacom_wac *wacom)
> struct input_dev *input = wacom->input;
>
> if (data[0] != WACOM_REPORT_PENABLED) {
> - printk(KERN_INFO "wacom_ptu_irq: received unknown report #%d\n", data[0]);
> + dev_dbg(input->dev.parent,
> + "%s: received unknown report #%d\n", __func__, data[0]);
> return 0;
> }
>
> @@ -175,7 +178,8 @@ static int wacom_dtu_irq(struct wacom_wac *wacom)
> struct input_dev *input = wacom->input;
> int prox = data[1] & 0x20, pressure;
>
> - dbg("wacom_dtu_irq: received report #%d", data[0]);
> + dev_dbg(input->dev.parent,
> + "%s: received report #%d", __func__, data[0]);
>
> if (prox) {
> /* Going into proximity select tool */
> @@ -211,7 +215,8 @@ static int wacom_graphire_irq(struct wacom_wac *wacom)
> int retval = 0;
>
> if (data[0] != WACOM_REPORT_PENABLED) {
> - dbg("wacom_graphire_irq: received unknown report #%d", data[0]);
> + dev_dbg(input->dev.parent,
> + "%s: received unknown report #%d\n", __func__, data[0]);
> goto exit;
> }
>
> @@ -489,10 +494,13 @@ static int wacom_intuos_irq(struct wacom_wac *wacom)
> unsigned int t;
> int idx = 0, result;
>
> - if (data[0] != WACOM_REPORT_PENABLED && data[0] != WACOM_REPORT_INTUOSREAD
> - && data[0] != WACOM_REPORT_INTUOSWRITE && data[0] != WACOM_REPORT_INTUOSPAD
> - && data[0] != WACOM_REPORT_INTUOS5PAD) {
> - dbg("wacom_intuos_irq: received unknown report #%d", data[0]);
> + if (data[0] != WACOM_REPORT_PENABLED &&
> + data[0] != WACOM_REPORT_INTUOSREAD &&
> + data[0] != WACOM_REPORT_INTUOSWRITE &&
> + data[0] != WACOM_REPORT_INTUOSPAD &&
> + data[0] != WACOM_REPORT_INTUOS5PAD) {
> + dev_dbg(input->dev.parent,
> + "%s: received unknown report #%d\n", __func__, data[0]);
> return 0;
> }
>
> @@ -938,7 +946,8 @@ static int wacom_tpc_irq(struct wacom_wac *wacom, size_t len)
> {
> char *data = wacom->data;
>
> - dbg("wacom_tpc_irq: received report #%d", data[0]);
> + dev_dbg(wacom->input->dev.parent,
> + "%s: received report #%d\n", __func__, data[0]);
>
> switch (len) {
> case WACOM_PKGLEN_TPC1FG:
> --
> 1.7.7.6
>
>
> --
> Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-01 16:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-30 5:51 [PATCH] Input: wacom - use dev_xxx() instead of naked printk()s and dbg()s Dmitry Torokhov
2012-05-01 16:23 ` Chris Bagwell
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.