From bca431a2778fa1ace58dcf9b48a4f39415f27618 Mon Sep 17 00:00:00 2001 From: loos Date: Fri, 6 Dec 2019 20:05:08 +0000 Subject: [PATCH] Fix the ARM64 build, include the necessary header. While here, call device_delete_children() to detach and dealloc all the existent children and handle the child's detach errors properly. Reported by: jenkins, hselasky, ian Sponsored by: Rubicon Communications, LLC (Netgate) --- sys/arm/mv/a37x0_spi.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arm/mv/a37x0_spi.c b/sys/arm/mv/a37x0_spi.c index 8b3d8fdb264b..69a4ceeac080 100644 --- a/sys/arm/mv/a37x0_spi.c +++ b/sys/arm/mv/a37x0_spi.c @@ -29,9 +29,9 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include #include +#include #include #include @@ -228,9 +228,11 @@ a37x0_spi_attach(device_t dev) static int a37x0_spi_detach(device_t dev) { + int err; struct a37x0_spi_softc *sc; - bus_generic_detach(dev); + if ((err = device_delete_children(dev)) != 0) + return (err); sc = device_get_softc(dev); mtx_destroy(&sc->sc_mtx); if (sc->sc_intrhand)