LinuxKPI: USB return possible error from suspend/resume
USB suspend/resume cannot fail so we never returned the error which resulted in a -Wunused-but-set-variable warning. Initialize the return variable and return a possible error possibly triggering a printf upstream to at least have a trace of the problem. This also fixes the warning. Suggested by: hselasky Sponsored by: The FreeBSD Foundation MFC after: 10 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D33107
This commit is contained in:
parent
7043359ce3
commit
943df073a3
@ -343,10 +343,10 @@ usb_linux_suspend(device_t dev)
|
||||
struct usb_driver *udrv = usb_linux_get_usb_driver(sc);
|
||||
int err;
|
||||
|
||||
if (udrv && udrv->suspend) {
|
||||
err = 0;
|
||||
if (udrv && udrv->suspend)
|
||||
err = (udrv->suspend) (sc->sc_ui, 0);
|
||||
}
|
||||
return (0);
|
||||
return (-err);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
@ -361,10 +361,10 @@ usb_linux_resume(device_t dev)
|
||||
struct usb_driver *udrv = usb_linux_get_usb_driver(sc);
|
||||
int err;
|
||||
|
||||
if (udrv && udrv->resume) {
|
||||
err = 0;
|
||||
if (udrv && udrv->resume)
|
||||
err = (udrv->resume) (sc->sc_ui);
|
||||
}
|
||||
return (0);
|
||||
return (-err);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------*
|
||||
|
Loading…
x
Reference in New Issue
Block a user