diff options
| author | jmcneill <jmcneill@NetBSD.org> | 2021-05-18 11:13:31 +0000 |
|---|---|---|
| committer | jmcneill <jmcneill@NetBSD.org> | 2021-05-18 11:13:31 +0000 |
| commit | 7dd2d4e8a7530dd0dce7ec6bcf3decabcd5924f9 (patch) | |
| tree | 00a7be3e0e4a8aa164b45e8dd3dbdcb39986e6c0 /sys/dev/fdt | |
| parent | 2a8a8ce3e96ede17d0a6f08d421ff28f9244d511 (diff) | |
Unbreak previous; we have to look for a child node iff our node isn't
compatible with snps,dwc3.
Diffstat (limited to 'sys/dev/fdt')
| -rw-r--r-- | sys/dev/fdt/dwc3_fdt.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/dev/fdt/dwc3_fdt.c b/sys/dev/fdt/dwc3_fdt.c index 719c519e588..8da3364a72d 100644 --- a/sys/dev/fdt/dwc3_fdt.c +++ b/sys/dev/fdt/dwc3_fdt.c @@ -1,4 +1,4 @@ -/* $NetBSD: dwc3_fdt.c,v 1.14 2021/04/24 23:36:53 thorpej Exp $ */ +/* $NetBSD: dwc3_fdt.c,v 1.15 2021/05/18 11:13:31 jmcneill Exp $ */ /*- * Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.14 2021/04/24 23:36:53 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwc3_fdt.c,v 1.15 2021/05/18 11:13:31 jmcneill Exp $"); #include <sys/param.h> #include <sys/bus.h> @@ -203,14 +203,18 @@ dwc3_fdt_set_mode(struct xhci_softc *sc, u_int mode) } static const struct device_compatible_entry compat_data[] = { - /* 1 = parent of dwc3 subnode */ - { .compat = "allwinner,sun50i-h6-dwc3", .value = 1 }, - { .compat = "amlogic,meson-gxl-dwc3", .value = 1 }, - { .compat = "fsl,imx8mq-dwc3", .value = 1 }, - { .compat = "rockchip,rk3328-dwc3", .value = 1 }, - { .compat = "rockchip,rk3399-dwc3", .value = 1 }, - { .compat = "samsung,exynos5250-dwusb3", .value = 1 }, - { .compat = "snps,dwc3", .value = 0 }, + { .compat = "allwinner,sun50i-h6-dwc3" }, + { .compat = "amlogic,meson-gxl-dwc3" }, + { .compat = "fsl,imx8mq-dwc3" }, + { .compat = "rockchip,rk3328-dwc3" }, + { .compat = "rockchip,rk3399-dwc3" }, + { .compat = "samsung,exynos5250-dwusb3" }, + { .compat = "snps,dwc3" }, + DEVICE_COMPAT_EOL +}; + +static const struct device_compatible_entry compat_data_dwc3[] = { + { .compat = "snps,dwc3" }, DEVICE_COMPAT_EOL }; @@ -228,7 +232,6 @@ dwc3_fdt_attach(device_t parent, device_t self, void *aux) struct xhci_softc * const sc = device_private(self); struct fdt_attach_args * const faa = aux; const int phandle = faa->faa_phandle; - const struct device_compatible_entry *dce; struct fdtbus_reset *rst; struct fdtbus_phy *phy; struct clk *clk; @@ -239,11 +242,8 @@ dwc3_fdt_attach(device_t parent, device_t self, void *aux) void *ih; u_int n; - dce = of_compatible_lookup(phandle, compat_data); - KASSERT(dce != NULL); - /* Find dwc3 sub-node */ - if (dce->value != 0) { + if (of_compatible_lookup(phandle, compat_data_dwc3) == NULL) { dwc3_phandle = of_find_firstchild_byname(phandle, "dwc3"); } else { dwc3_phandle = phandle; |
