snd_ich(4): Handle errors from ich_init() properly during resume.
ich_init() returns an errno value or 0, but ich_pci_resume() was comparing the return value with -1 to determine whether an error had occurred. PR: 248941 Submitted by: Tong Zhang <ztong0001@gmail.com> MFC after: 1 week
This commit is contained in:
parent
b3cb04b930
commit
555e998919
@ -1190,16 +1190,17 @@ static int
|
||||
ich_pci_resume(device_t dev)
|
||||
{
|
||||
struct sc_info *sc;
|
||||
int i;
|
||||
int err, i;
|
||||
|
||||
sc = pcm_getdevinfo(dev);
|
||||
|
||||
ICH_LOCK(sc);
|
||||
/* Reinit audio device */
|
||||
if (ich_init(sc) == -1) {
|
||||
err = ich_init(sc);
|
||||
if (err != 0) {
|
||||
device_printf(dev, "unable to reinitialize the card\n");
|
||||
ICH_UNLOCK(sc);
|
||||
return (ENXIO);
|
||||
return (err);
|
||||
}
|
||||
/* Reinit mixer */
|
||||
ich_pci_codec_reset(sc);
|
||||
|
Loading…
Reference in New Issue
Block a user