The branch main has been updated by jhb:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=6b06f746db1ad5a6ebb85d68f4418784e53d59e5

commit 6b06f746db1ad5a6ebb85d68f4418784e53d59e5
Author:     John Baldwin <[email protected]>
AuthorDate: 2022-04-21 17:29:14 +0000
Commit:     John Baldwin <[email protected]>
CommitDate: 2022-04-21 17:29:14 +0000

    sc: Use devclass_find to lookup the sc devclass.
    
    Reviewed by:    imp
    Differential Revision:  https://reviews.freebsd.org/D35007
---
 sys/isa/syscons_isa.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/sys/isa/syscons_isa.c b/sys/isa/syscons_isa.c
index d69652abe26a..862b6f31c62c 100644
--- a/sys/isa/syscons_isa.c
+++ b/sys/isa/syscons_isa.c
@@ -97,7 +97,7 @@ int
 sc_max_unit(void)
 {
 
-       return (devclass_get_maxunit(sc_devclass));
+       return (devclass_get_maxunit(devclass_find("sc")));
 }
 
 sc_softc_t
@@ -111,7 +111,8 @@ sc_softc_t
                /* FIXME: clear if it is wired to another unit! */
                sc = &main_softc;
        } else {
-               sc = device_get_softc(devclass_get_device(sc_devclass, unit));
+               sc = device_get_softc(devclass_get_device(devclass_find("sc"),
+                   unit));
                if (sc == NULL)
                        return (NULL);
        }
@@ -127,6 +128,7 @@ sc_softc_t
 sc_softc_t
 *sc_find_softc(struct video_adapter *adp, struct keyboard *kbd)
 {
+       devclass_t dc;
        sc_softc_t *sc;
        int i;
        int units;
@@ -135,9 +137,10 @@ sc_softc_t
        if ((adp == NULL || adp == sc->adp) &&
            (kbd == NULL || kbd == sc->kbd))
                return (sc);
-       units = devclass_get_maxunit(sc_devclass);
+       dc = devclass_find("sc");
+       units = devclass_get_maxunit(dc);
        for (i = 0; i < units; ++i) {
-               sc = device_get_softc(devclass_get_device(sc_devclass, i));
+               sc = device_get_softc(devclass_get_device(dc, i));
                if (sc == NULL)
                        continue;
                if ((adp == NULL || adp == sc->adp) &&

Reply via email to