Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/sys/dev/pci Pullup rev 1.20 (requested by kent in ticke...



details:   https://anonhg.NetBSD.org/src/rev/1c625f78db7b
branches:  netbsd-2-0
changeset: 562689:1c625f78db7b
user:      jmc <jmc%NetBSD.org@localhost>
date:      Wed Sep 22 20:58:12 2004 +0000

description:
Pullup rev 1.20 (requested by kent in ticket #867)

ac97_host_if::reset() returns non-zero value if codec reset fails, and
ac97 is not attached in that case. PR#26973

diffstat:

 sys/dev/pci/autri.c |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r 74a9b41117a9 -r 1c625f78db7b sys/dev/pci/autri.c
--- a/sys/dev/pci/autri.c       Wed Sep 22 20:58:09 2004 +0000
+++ b/sys/dev/pci/autri.c       Wed Sep 22 20:58:12 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autri.c,v 1.18 2003/10/29 03:46:10 mycroft Exp $       */
+/*     $NetBSD: autri.c,v 1.18.2.1 2004/09/22 20:58:12 jmc Exp $       */
 
 /*
  * Copyright (c) 2001 SOMEYA Yoshihiko and KUROSAWA Takahiro.
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: autri.c,v 1.18 2003/10/29 03:46:10 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autri.c,v 1.18.2.1 2004/09/22 20:58:12 jmc Exp $");
 
 #include "midi.h"
 
@@ -101,7 +101,7 @@
 int    autri_attach_codec(void *sc, struct ac97_codec_if *);
 int    autri_read_codec(void *sc, u_int8_t a, u_int16_t *d);
 int    autri_write_codec(void *sc, u_int8_t a, u_int16_t d);
-void   autri_reset_codec(void *sc);
+int    autri_reset_codec(void *sc);
 enum ac97_host_flags   autri_flags_codec(void *sc);
 
 static void autri_powerhook(int why,void *addr);
@@ -366,7 +366,7 @@
        return 0;
 }
 
-void
+int
 autri_reset_codec(void *sc_)
 {
        struct autri_codec_softc *codec = sc_;
@@ -425,7 +425,7 @@
        default:
                printf("%s: autri_reset_codec : unknown device\n",
                       sc->sc_dev.dv_xname);
-               return;
+               return EOPNOTSUPP;
        }
 
        /* wait for 'Codec Ready' */
@@ -436,9 +436,12 @@
                delay(1000);
        }
 
-       if (count == 0)
+       if (count == 0) {
                printf("%s: Codec timeout. AC'97 is not ready for operation.\n",
                       sc->sc_dev.dv_xname);
+               return ETIMEDOUT;
+       }
+       return 0;
 }
 
 enum ac97_host_flags



Home | Main Index | Thread Index | Old Index