From nobody Thu Jan 02 18:28:34 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YPFZq3bggz5jn6m; Thu, 02 Jan 2025 18:28:35 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YPFZp6j7Gz4vK2; Thu, 2 Jan 2025 18:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0sGUVMHUdswn03xpMAw0fFFnruwNpE9GzbPfSvrj6xw=; b=E6c0cxx+DybhXwK8D488MDYQ0aaSB8KjUTJcjH2qpUzC2C3hEHKbqBhnmC9G93aptzO4cr 1vJmOFqowfAHaHj1X5CzcDo+ADx3uy/vMnv/bVlivic3IB2xdSbZQCZYzOHlhSVRk1NvRn nHRQ5Mv2w7TW7TjTcC1q/4g0t5WfOQP89kyhULHzkxxPzJ9S71qbI+UsY8kaZ/4jtNf985 k6EKQxDeWCLLb6SsKOECxIQSgzeHhvQCnlDCalHpiwCzrWXFLmsDpcBJlf7+GpN3CCH5rP f2vTG6ZwwddO708kf1VFy2BLe9YEbmIWiK5t7u1f+rtZlVAnabdqFGZ9cBYmmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842514; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0sGUVMHUdswn03xpMAw0fFFnruwNpE9GzbPfSvrj6xw=; b=ZFQXYx918IQLQnGTI1jAWfE8mj2hRU9QrmiXnu17ELa6rEyFxPArq9GrfUAGCsR+mkcnHl TsjKIKWUSF3HF9yHwG8qcBEqgulUymRQ90IdX3fHI1mLcHP+Py/DIu6vkNII4pR4iQRKDP Ej3bHILemNzcoSDIk/bpcap2LfxGh8lp7Nb+pC+1p71MydRCOcx8L5TwNZO7wGkAI2aSWx 0B4ZkqeXgEP615njJHovaRubONlAyOLndAiklJOWpy7Xs6zvmOmL9uTF4mrjPUObrk31y6 zbm7+Q9EB2ZHJz0t8mOgjyPEeAABvYIzd7Oi73pSUt7N5zsugWB5wYPVr16BBg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735842514; a=rsa-sha256; cv=none; b=usvB5rvvzWUog/q9Is4DnN8UWWZXL0x6zIb97tf9pomsR966NDxZpVVxTahfFOs1IPBZIy pdOIqk6aNEZt6+BxgrtjwjhZ3HTb4s5OqLzJ9eif5CjyBq65HdkznVTZclP2G6/3zKAv+4 hS+p3HJXEMxGP08ip23SnG0x8gyggn2+qIQy/8uw3YdDYytC32NzvHToPr5sw492x+b4Uw aMbmcdxPmEYKcP9kCC1V8gygv8dtMZPA/+HBS4AF7dxREvVCfEXPG4QPZw9UbKZxJ8wp9l SdNUYgDlyrhhzRBBAyWE6Jo81njVONIZis1kWWyUkThvXjQYW+2Nd1b4WrNrpQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YPFZp5xKvzpS1; Thu, 02 Jan 2025 18:28:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 502ISYwD066854; Thu, 2 Jan 2025 18:28:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 502ISYt8066851; Thu, 2 Jan 2025 18:28:34 GMT (envelope-from git) Date: Thu, 2 Jan 2025 18:28:34 GMT Message-Id: <202501021828.502ISYt8066851@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: d174ffca3a79 - main - mfi: Use bus_generic_detach to simplify deleting children during detach List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d174ffca3a79171069cb041f81c2680a6e4809ed Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d174ffca3a79171069cb041f81c2680a6e4809ed commit d174ffca3a79171069cb041f81c2680a6e4809ed Author: John Baldwin AuthorDate: 2025-01-02 18:25:27 +0000 Commit: John Baldwin CommitDate: 2025-01-02 18:25:27 +0000 mfi: Use bus_generic_detach to simplify deleting children during detach Differential Revision: https://reviews.freebsd.org/D47973 --- sys/dev/mfi/mfi_pci.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/mfi/mfi_pci.c b/sys/dev/mfi/mfi_pci.c index 82082e6b72cf..65e8e30bf994 100644 --- a/sys/dev/mfi/mfi_pci.c +++ b/sys/dev/mfi/mfi_pci.c @@ -279,8 +279,7 @@ static int mfi_pci_detach(device_t dev) { struct mfi_softc *sc; - int error, devcount, i; - device_t *devlist; + int error; sc = device_get_softc(dev); @@ -294,13 +293,11 @@ mfi_pci_detach(device_t dev) sc->mfi_detaching = 1; mtx_unlock(&sc->mfi_io_lock); - if ((error = device_get_children(sc->mfi_dev, &devlist, &devcount)) != 0) { + error = bus_generic_detach(sc->mfi_dev); + if (error != 0) { sx_xunlock(&sc->mfi_config_lock); return error; } - for (i = 0; i < devcount; i++) - device_delete_child(sc->mfi_dev, devlist[i]); - free(devlist, M_TEMP); sx_xunlock(&sc->mfi_config_lock); EVENTHANDLER_DEREGISTER(shutdown_final, sc->mfi_eh);