From e54dfd94d253141da78a55f2227eb8c5a8b9fdc2 Mon Sep 17 00:00:00 2001 From: nirenjan Date: Fri, 17 Oct 2014 14:43:22 +0000 Subject: [PATCH] Use dev_err/dev_dbg when device is available Previous commit used pr_err/pr_debug because it mistakenly assumed that the device pointer was not available. This ensures that the driver uses the dev_err and dev_dbg functions wherever it can. --- kernel_module/x52joy_input.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel_module/x52joy_input.c b/kernel_module/x52joy_input.c index a9b844a..5acb8c3 100644 --- a/kernel_module/x52joy_input.c +++ b/kernel_module/x52joy_input.c @@ -150,11 +150,13 @@ void x52_irq_handler(struct urb *urb) case -ENOENT: case -ESHUTDOWN: /* This URB is terminated, clean up */ - pr_debug("%s - URB shutting down with status: %d", + dev_dbg(joy->idev->dev.parent, + "%s - URB shutting down with status: %d", __func__, status); return; default: - pr_debug("%s - nonzero URB status received: %d", + dev_dbg(joy->idev->dev.parent, + "%s - nonzero URB status received: %d", __func__, status); goto error; } @@ -172,7 +174,8 @@ void x52_irq_handler(struct urb *urb) error: retval = usb_submit_urb(urb, GFP_ATOMIC); if (retval) - pr_err("%s - usb_submit_urb failed with result %d", + dev_err(joy->idev->dev.parent, + "%s - usb_submit_urb failed with result %d", __func__, retval); }