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.
pull/3/head
nirenjan 2014-10-17 14:43:22 +00:00
parent b752c3e46b
commit e54dfd94d2
1 changed files with 6 additions and 3 deletions

View File

@ -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);
}