diff --git a/sys/arm64/apple/apple_pcie.c b/sys/arm64/apple/apple_pcie.c index 0a20bedea7d..8e5ad318bf8 100644 --- a/sys/arm64/apple/apple_pcie.c +++ b/sys/arm64/apple/apple_pcie.c @@ -871,36 +871,33 @@ device_printf(sc->dev, "port %u: link up\n", port); gpio_controller_config_pin(reset_gpio, GPIO_CONFIG_OUTPUT); gpio_controller_set_pin(reset_gpio, 1); #else - struct gpiobus_pin *gpio_rset; + gpio_pin_t gpio_rset; int error; - if (ofw_gpiobus_parse_gpios(dev, "reset-gpios", &gpio_rset) > 1) { - device_printf(dev, "too many reset gpios\n"); + gpio_rset = NULL; + if (gpio_pin_get_by_ofw_property(dev, port_node, "reset-gpios", + &gpio_rset) != 0) { + device_printf(dev, "Unable to find reset GPIO\n"); return; } - if (gpio_rset != NULL) { - error = GPIO_PIN_SETFLAGS(gpio_rset->dev, gpio_rset->pin, - GPIO_PIN_OUTPUT); - if (error != 0) { - device_printf(dev, "Cannot config GPIO pin %d on %s\n", - gpio_rset->pin, - device_get_nameunit(gpio_rset->dev)); - return; - } - - error = GPIO_PIN_SET(gpio_rset->dev, gpio_rset->pin, 1); - if (error != 0) { - device_printf(dev, "Cannot set GPIO pin %d on %s\n", - gpio_rset->pin, - device_get_nameunit(gpio_rset->dev)); - return; - } + error = GPIO_PIN_SETFLAGS(gpio_rset->dev, gpio_rset->pin, + GPIO_PIN_OUTPUT); + if (error != 0) { + device_printf(dev, "Cannot config GPIO pin %d on %s\n", + gpio_rset->pin, + device_get_nameunit(gpio_rset->dev)); + return; + } - } else { - device_printf(dev, "Unable to find reset GPIO\n"); + error = GPIO_PIN_SET(gpio_rset->dev, gpio_rset->pin, 1); + if (error != 0) { + device_printf(dev, "Cannot set GPIO pin %d on %s\n", + gpio_rset->pin, + device_get_nameunit(gpio_rset->dev)); return; } + #endif /* Setup Refclk. */ @@ -970,7 +967,7 @@ device_printf(sc->dev, "port %u: link up\n", port); } if ((stat & PCIE_PORT_STAT_READY) == 0) { - device_printf(sc->dev, "didn't become ready"); + device_printf(sc->dev, "didn't become ready\n"); return; } @@ -987,7 +984,7 @@ device_printf(sc->dev, "port %u: link up\n", port); } if ((stat & PCIE_PORT_STAT_READY) == 0) { - device_printf(sc->dev, "didn't link up"); + device_printf(sc->dev, "didn't link up\n"); return; } #endif