Module Name:    src
Committed By:   jmcneill
Date:           Sat Jul  8 16:19:56 UTC 2017

Modified Files:
        src/sys/dev/fdt: ehci_fdt.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/fdt/ehci_fdt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/fdt/ehci_fdt.c
diff -u src/sys/dev/fdt/ehci_fdt.c:1.1 src/sys/dev/fdt/ehci_fdt.c:1.2
--- src/sys/dev/fdt/ehci_fdt.c:1.1	Thu Jun 29 17:04:53 2017
+++ src/sys/dev/fdt/ehci_fdt.c	Sat Jul  8 16:19:56 2017
@@ -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 <jmcne...@invisible.ca>
@@ -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 @@ CFATTACH_DECL2_NEW(ehci_fdt, sizeof(stru
 	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 @@ ehci_fdt_attach(device_t parent, device_
 	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;

Reply via email to