Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/pci tsleep(9) is depreciated. Use kpause(9) i...



details:   https://anonhg.NetBSD.org/src-all/rev/0f7f017c96ac
branches:  trunk
changeset: 377992:0f7f017c96ac
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Tue Mar 08 05:05:50 2022 +1100

description:
tsleep(9) is depreciated.  Use kpause(9) instead.

diffstat:

 sys/dev/pci/if_ipw.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r 5b43e1a37c1c -r 0f7f017c96ac sys/dev/pci/if_ipw.c
--- a/sys/dev/pci/if_ipw.c      Tue Mar 08 04:55:02 2022 +1100
+++ b/sys/dev/pci/if_ipw.c      Tue Mar 08 05:05:50 2022 +1100
@@ -1428,6 +1428,7 @@ static int
 ipw_cmd(struct ipw_softc *sc, uint32_t type, void *data, uint32_t len)
 {
        struct ipw_soft_bd *sbd;
+       int error = 0;
 
        sbd = &sc->stbd_list[sc->txcur];
 
@@ -1460,7 +1461,10 @@ ipw_cmd(struct ipw_softc *sc, uint32_t t
        CSR_WRITE_4(sc, IPW_CSR_TX_WRITE, sc->txcur);
 
        /* Wait at most one second for command to complete */
-       return tsleep(&sc->cmd, 0, "ipwcmd", hz);
+       if ((error = kpause("ipwcmd", false, hz, NULL)) != EWOULDBLOCK)
+               return error;
+
+       return 0;
 }
 
 static int
@@ -2010,7 +2014,7 @@ ipw_load_firmware(struct ipw_softc *sc, 
            IPW_CTL_ALLOW_STANDBY);
 
        /* wait at most one second for firmware initialization to complete */
-       if ((error = tsleep(sc, 0, "ipwinit", hz)) != 0) {
+       if ((error = kpause("ipwinit", false, hz, NULL)) != 0) {
                aprint_error_dev(sc->sc_dev,
                    "timeout waiting for firmware initialization "
                    "to complete\n");



Home | Main Index | Thread Index | Old Index