From 3342afcbaf42c2e6a4604c84e267901411e790ca Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 16 Oct 2024 14:08:49 -0400 Subject: [PATCH] bus_generic_detach: Remove redundant check device_detach() checks the device state and only calls a driver's DEVICE_DETACH method if the device is attached but not busy. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47156 --- sys/kern/subr_bus.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index 7140ca007b71..7c21325f8684 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -3405,9 +3405,6 @@ bus_generic_detach(device_t dev) device_t child; int error; - if (dev->state != DS_ATTACHED) - return (EBUSY); - /* * Detach children in the reverse order. * See bus_generic_suspend for details.