From nobody Thu Jan 02 18:28:22 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 4YPFZZ4Yk0z5jnTj; Thu, 02 Jan 2025 18:28:22 +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 4YPFZZ2l2Bz4v43; Thu, 2 Jan 2025 18:28:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842502; 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=gH48jSvXimyhW/UvDoaxip0HAA14OawPNv9KG76IqDA=; b=lwSmQH7NnvmLjphPXA2UwRnoXh0SBsZAt243RwjMI0wQY3t1Us5aJpUGLYR7bECqD8k2wP lJ3FDrmthx6DYAmJXCVRWyu3kJ+1hBsxTEuDDay2uIuuDpPlpDktrw5xOImd2E7YQNMdTT 6iRswBt9GDTZBg0F1Ku7qxdr8hSCcPqo6Rg1tpIC1UpYQYudHkoxpbVaHENohRbPC/eXa1 qwrzmn5p7uJtvuk9+RclHen2Eg/Zfp8jYDR9W+3/YyfgMiPkDIASPvaYvw8Pl1jdaqidln QEOAsAy2AzQMRXhFfdqhhkYNw6Ot/6myPyQWMv7l0ziXlIU/yvd66H1UIhD+ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735842502; 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=gH48jSvXimyhW/UvDoaxip0HAA14OawPNv9KG76IqDA=; b=JmhSA129zRCJUTLkud0xySx7MDdu1g6e/Sip2jNMwiCwrHP7j9oVSB/x3NEuE1/1nYLP8U oUGqCvrwrMo0BvV0LNwdDWhItW2HirYnd+meoHsrLedWij6kBvRRsK8SLplhlULMUiOCZL 7JJmRqesJCl5WEhmon9XcfpmurIcklr1GQwcrSfCEp2JslsDS8AuJbg9Mh63ZxM+h1j7dx XpppF7l4CMoFHQOznbJ2sZzFaNjXiKomDVc8kjcwRcaoRcT3iyce1PkAYpn/4VtvuLSRIG hFbRFclkj8jGVHbMBSlv3OAuk6D1qjkD9YHJl5f84LYUMIgeG44SllsLiUuxKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735842502; a=rsa-sha256; cv=none; b=ZeTk5FKrPEp0Rl9MMCBsOsQqWdmRNxk/z4ixaqPiNs6cPstPe01e//vDhL3zY5isBHLRil IaCha4cIRqbTnhz7mHF9p7r98BgqYCXnKqZ6mTCX7QGt1kmpVD36cpg8CQ8VKUGHQ1DozL vmukB2nGZ37Iyq4k8dIStfhvOwi1sSpx4ga5nfMHvaxM6Syl3Rc/grPyOdmSXv7HuKN4np 0Mqf18AMYs1foAOPjJ9SNORXZRrEE5DnA2Sm5rXYQXGO50M1XHHZvSxim+s+1NHHigxyo1 152qIqEerZv9+mB0hF7IfyQseFGf8QFFCDDTjigdcmpDtqpScjB3WHiWVzMthQ== 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 4YPFZZ2DKzznl9; Thu, 02 Jan 2025 18:28:22 +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 502ISMdZ066286; Thu, 2 Jan 2025 18:28:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 502ISMaw066283; Thu, 2 Jan 2025 18:28:22 GMT (envelope-from git) Date: Thu, 2 Jan 2025 18:28:22 GMT Message-Id: <202501021828.502ISMaw066283@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: 160179ea3e24 - main - Remove now-redundant calls to device_delete_children 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: 160179ea3e24651cd8b15a4fafce519546eac505 Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=160179ea3e24651cd8b15a4fafce519546eac505 commit 160179ea3e24651cd8b15a4fafce519546eac505 Author: John Baldwin AuthorDate: 2025-01-02 18:22:50 +0000 Commit: John Baldwin CommitDate: 2025-01-02 18:22:50 +0000 Remove now-redundant calls to device_delete_children Earlier calls to bus_generic_detach now take care of deleting children. Differential Revision: https://reviews.freebsd.org/D47962 --- sys/arm/ti/cpsw/if_cpsw.c | 2 +- sys/dev/cardbus/cardbus.c | 2 -- sys/dev/cxgbe/t4_main.c | 1 - sys/dev/dpaa2/dpaa2_mc.c | 2 +- sys/dev/dpaa2/dpaa2_rc.c | 2 +- sys/dev/gpio/gpiobus.c | 10 +--------- sys/dev/hid/hidbus.c | 3 +-- sys/dev/ida/ida.c | 3 --- sys/dev/iicbus/controller/opencores/iicoc_pci.c | 1 - sys/dev/iicbus/iicsmb.c | 1 - sys/dev/nvdimm/nvdimm_acpi.c | 7 +------ sys/dev/pci/pci.c | 4 +--- sys/dev/superio/superio.c | 1 - sys/dev/usb/misc/cp2112.c | 1 - sys/dev/usb/misc/i2ctinyusb.c | 1 - sys/dev/vmd/vmd.c | 3 --- 16 files changed, 7 insertions(+), 37 deletions(-) diff --git a/sys/arm/ti/cpsw/if_cpsw.c b/sys/arm/ti/cpsw/if_cpsw.c index 674a7ed8575a..5b443e6c2712 100644 --- a/sys/arm/ti/cpsw/if_cpsw.c +++ b/sys/arm/ti/cpsw/if_cpsw.c @@ -965,7 +965,7 @@ cpsw_detach(device_t dev) if (error != 0) return (error); - return (device_delete_children(dev)); + return (0); } static phandle_t diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index f375eb112cce..21467a11cb68 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -245,8 +245,6 @@ cardbus_detach_card(device_t cbdev) bus_topo_lock(); err = bus_generic_detach(cbdev); - if (err == 0) - err = device_delete_children(cbdev); bus_topo_unlock(); if (err) return (err); diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 024c97dcb78c..e4120e76000c 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2814,7 +2814,6 @@ cxgbe_detach(device_t dev) rc = bus_generic_detach(dev); if (rc) return (rc); - device_delete_children(dev); sysctl_ctx_free(&pi->ctx); begin_vi_detach(sc, &pi->vi[0]); diff --git a/sys/dev/dpaa2/dpaa2_mc.c b/sys/dev/dpaa2/dpaa2_mc.c index c84b22d1d74d..8abfc3bfe1cc 100644 --- a/sys/dev/dpaa2/dpaa2_mc.c +++ b/sys/dev/dpaa2/dpaa2_mc.c @@ -292,7 +292,7 @@ dpaa2_mc_detach(device_t dev) if (dinfo) free(dinfo, M_DPAA2_MC); - return (device_delete_children(dev)); + return (0); } /* diff --git a/sys/dev/dpaa2/dpaa2_rc.c b/sys/dev/dpaa2/dpaa2_rc.c index 7f8eddff1353..d8e15e388bf5 100644 --- a/sys/dev/dpaa2/dpaa2_rc.c +++ b/sys/dev/dpaa2/dpaa2_rc.c @@ -114,7 +114,7 @@ dpaa2_rc_detach(device_t dev) if (dinfo) free(dinfo, M_DPAA2_RC); - return (device_delete_children(dev)); + return (0); } static int diff --git a/sys/dev/gpio/gpiobus.c b/sys/dev/gpio/gpiobus.c index 37371fa4e1cc..e053adacf457 100644 --- a/sys/dev/gpio/gpiobus.c +++ b/sys/dev/gpio/gpiobus.c @@ -315,16 +315,10 @@ gpiobus_attach_bus(device_t dev) int gpiobus_detach_bus(device_t dev) { - int err; - #ifdef FDT ofw_gpiobus_unregister_provider(dev); #endif - err = bus_generic_detach(dev); - if (err != 0) - return (err); - - return (device_delete_children(dev)); + return (bus_generic_detach(dev)); } int @@ -584,8 +578,6 @@ gpiobus_detach(device_t dev) if ((err = bus_detach_children(dev)) != 0) return (err); - if ((err = device_delete_children(dev)) != 0) - return (err); rman_fini(&sc->sc_intr_rman); if (sc->sc_pins) { diff --git a/sys/dev/hid/hidbus.c b/sys/dev/hid/hidbus.c index 9b8b7fed8887..96d36c8d191d 100644 --- a/sys/dev/hid/hidbus.c +++ b/sys/dev/hid/hidbus.c @@ -297,8 +297,7 @@ hidbus_detach_children(device_t dev) if (is_bus) { /* If hidbus is passed, delete all children. */ - bus_generic_detach(bus); - device_delete_children(bus); + error = bus_generic_detach(bus); } else { /* * If hidbus child is passed, delete all hidbus children diff --git a/sys/dev/ida/ida.c b/sys/dev/ida/ida.c index ea231b041e13..fa135b7fc9ed 100644 --- a/sys/dev/ida/ida.c +++ b/sys/dev/ida/ida.c @@ -346,9 +346,6 @@ ida_detach(device_t dev) ida = (struct ida_softc *)device_get_softc(dev); error = bus_generic_detach(dev); - if (error) - return (error); - error = device_delete_children(dev); if (error) return (error); diff --git a/sys/dev/iicbus/controller/opencores/iicoc_pci.c b/sys/dev/iicbus/controller/opencores/iicoc_pci.c index cecfa888349b..f01b4514936e 100644 --- a/sys/dev/iicbus/controller/opencores/iicoc_pci.c +++ b/sys/dev/iicbus/controller/opencores/iicoc_pci.c @@ -50,7 +50,6 @@ iicoc_detach(device_t dev) struct iicoc_softc *sc; sc = device_get_softc(dev); - device_delete_children(dev); bus_generic_detach(dev); bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res); mtx_destroy(&sc->sc_mtx); diff --git a/sys/dev/iicbus/iicsmb.c b/sys/dev/iicbus/iicsmb.c index e502ad904070..a5885648632e 100644 --- a/sys/dev/iicbus/iicsmb.c +++ b/sys/dev/iicbus/iicsmb.c @@ -166,7 +166,6 @@ iicsmb_detach(device_t dev) struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev); bus_generic_detach(dev); - device_delete_children(dev); mtx_destroy(&sc->lock); return (0); diff --git a/sys/dev/nvdimm/nvdimm_acpi.c b/sys/dev/nvdimm/nvdimm_acpi.c index b9803c2c3a05..39697e52eebb 100644 --- a/sys/dev/nvdimm/nvdimm_acpi.c +++ b/sys/dev/nvdimm/nvdimm_acpi.c @@ -206,7 +206,6 @@ nvdimm_root_detach(device_t dev) { struct nvdimm_root_dev *root; struct SPA_mapping *spa, *next; - int error; root = device_get_softc(dev); SLIST_FOREACH_SAFE(spa, &root->spas, link, next) { @@ -215,11 +214,7 @@ nvdimm_root_detach(device_t dev) SLIST_REMOVE_HEAD(&root->spas, link); free(spa, M_NVDIMM_ACPI); } - error = bus_generic_detach(dev); - if (error != 0) - return (error); - error = device_delete_children(dev); - return (error); + return (bus_generic_detach(dev)); } static int diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 64bce9f01ea8..251680590747 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -4510,9 +4510,7 @@ pci_detach(device_t dev) return (error); sc = device_get_softc(dev); error = bus_release_resource(dev, PCI_RES_BUS, 0, sc->sc_bus); - if (error) - return (error); - return (device_delete_children(dev)); + return (error); } static void diff --git a/sys/dev/superio/superio.c b/sys/dev/superio/superio.c index 7bed7bb510d3..94e97f197a93 100644 --- a/sys/dev/superio/superio.c +++ b/sys/dev/superio/superio.c @@ -740,7 +740,6 @@ superio_detach(device_t dev) return (error); if (sc->chardev != NULL) destroy_dev(sc->chardev); - device_delete_children(dev); bus_release_resource(dev, SYS_RES_IOPORT, sc->io_rid, sc->io_res); mtx_destroy(&sc->conf_lock); return (0); diff --git a/sys/dev/usb/misc/cp2112.c b/sys/dev/usb/misc/cp2112.c index e3587241f412..d4776ca342cb 100644 --- a/sys/dev/usb/misc/cp2112.c +++ b/sys/dev/usb/misc/cp2112.c @@ -1345,7 +1345,6 @@ cp2112iic_detach(device_t dev) err = bus_generic_detach(dev); if (err != 0) return (err); - device_delete_children(dev); mtx_lock(&sc->io.lock); usbd_transfer_stop(sc->xfers[CP2112_INTR_IN]); diff --git a/sys/dev/usb/misc/i2ctinyusb.c b/sys/dev/usb/misc/i2ctinyusb.c index 47f27d9383a6..ca40fd5baf5c 100644 --- a/sys/dev/usb/misc/i2ctinyusb.c +++ b/sys/dev/usb/misc/i2ctinyusb.c @@ -193,7 +193,6 @@ i2ctinyusb_detach(device_t dev) err = bus_generic_detach(dev); if (err != 0) return (err); - device_delete_children(dev); mtx_destroy(&sc->sc_mtx); diff --git a/sys/dev/vmd/vmd.c b/sys/dev/vmd/vmd.c index 40565eab6f3e..0595a6c5be16 100644 --- a/sys/dev/vmd/vmd.c +++ b/sys/dev/vmd/vmd.c @@ -399,9 +399,6 @@ vmd_detach(device_t dev) int error; error = bus_generic_detach(dev); - if (error) - return (error); - error = device_delete_children(dev); if (error) return (error); if (sc->vmd_msix_count == 0)