Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/fdt Remove the hack to find companion devices and ju...



details:   https://anonhg.NetBSD.org/src/rev/fce5789bfca3
branches:  trunk
changeset: 825316:fce5789bfca3
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Jul 08 16:19:56 2017 +0000

description:
Remove the hack to find companion devices and just assume 1 companion if
ETTF flag is not set.

diffstat:

 sys/dev/fdt/ehci_fdt.c |  23 +++--------------------
 1 files changed, 3 insertions(+), 20 deletions(-)

diffs (51 lines):

diff -r db88262858f4 -r fce5789bfca3 sys/dev/fdt/ehci_fdt.c
--- a/sys/dev/fdt/ehci_fdt.c    Sat Jul 08 16:19:20 2017 +0000
+++ b/sys/dev/fdt/ehci_fdt.c    Sat Jul 08 16:19:56 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ehci_fdt.c,v 1.1 2017/06/29 17:04:53 jmcneill Exp $ */
+/* $NetBSD: ehci_fdt.c,v 1.2 2017/07/08 16:19:56 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2015-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.1 2017/06/29 17:04:53 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci_fdt.c,v 1.2 2017/07/08 16:19:56 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -52,23 +52,6 @@
        ehci_fdt_match, ehci_fdt_attach, NULL,
        ehci_activate, NULL, ehci_childdet);
 
-static void
-ehci_fdt_find_companions(struct ehci_softc *sc)
-{
-       const char * drivers[] = { "ohci", "uhci", NULL };
-       device_t comp_dev;
-       int unit, n;
-
-       /* XXX find an ohci or uhci with the same unit as us */
-       unit = device_unit(sc->sc_dev);
-
-       for (n = 0; drivers[n] != NULL; n++) {
-               comp_dev = device_find_by_driver_unit(drivers[n], unit);
-               if (comp_dev != NULL)
-                       sc->sc_comps[sc->sc_ncomp++] = comp_dev;
-       }
-}
-
 static int
 ehci_fdt_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -129,7 +112,7 @@
        if (of_hasprop(phandle, "has-transaction-translator"))
                sc->sc_flags |= EHCIF_ETTF;
        else
-               ehci_fdt_find_companions(sc);
+               sc->sc_ncomp = 1;
        sc->sc_id_vendor = 0;
        strlcpy(sc->sc_vendor, "Generic", sizeof(sc->sc_vendor));
        sc->sc_size = size;



Home | Main Index | Thread Index | Old Index