mirror of https://github.com/nirenjan/libx52.git
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
parent
b752c3e46b
commit
e54dfd94d2
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue