From 4b6aea4d6d4ebfd9ce2fa81ff3d60157e7e7059a Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sat, 8 Jul 2017 16:19:56 +0000 Subject: Remove the hack to find companion devices and just assume 1 companion if ETTF flag is not set. --- sys/dev/fdt/ehci_fdt.c | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/fdt/ehci_fdt.c b/sys/dev/fdt/ehci_fdt.c index b3bbef011c9..6d29cc788f5 100644 --- a/sys/dev/fdt/ehci_fdt.c +++ b/sys/dev/fdt/ehci_fdt.c @@ -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 @@ -27,7 +27,7 @@ */ #include -__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 #include @@ -52,23 +52,6 @@ CFATTACH_DECL2_NEW(ehci_fdt, sizeof(struct ehci_softc), 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_t self, void *aux) 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; -- cgit