mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 00:32:25 -04:00
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
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33107
(cherry picked from commit 943df073a3)
This commit is contained in:
parent
e17d7f3d86
commit
2c6ebb7834
1 changed files with 6 additions and 6 deletions
|
|
@ -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…
Reference in a new issue