git: d62d10eb1229 - main - Use bus_generic_detach directly instead of a wrapper
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 05 Nov 2024 01:33:42 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=d62d10eb1229c9aa0b3cf1b18872df59c18155db commit d62d10eb1229c9aa0b3cf1b18872df59c18155db Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2024-11-05 01:30:13 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2024-11-05 01:30:13 +0000 Use bus_generic_detach directly instead of a wrapper Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D47386 --- sys/dev/acpica/acpi_container.c | 10 +--------- sys/dev/adb/adb_bus.c | 8 +------- sys/dev/mdio/mdio.c | 10 +--------- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/sys/dev/acpica/acpi_container.c b/sys/dev/acpica/acpi_container.c index 0f23f6b25fe1..81a1ee8ce25c 100644 --- a/sys/dev/acpica/acpi_container.c +++ b/sys/dev/acpica/acpi_container.c @@ -38,7 +38,6 @@ ACPI_MODULE_NAME("CONTAINER") static int acpi_syscont_probe(device_t); static int acpi_syscont_attach(device_t); -static int acpi_syscont_detach(device_t); static int acpi_syscont_alloc_msi(device_t, device_t, int count, int maxcount, int *irqs); static int acpi_syscont_release_msi(device_t bus, device_t dev, @@ -54,7 +53,7 @@ static device_method_t acpi_syscont_methods[] = { /* Device interface */ DEVMETHOD(device_probe, acpi_syscont_probe), DEVMETHOD(device_attach, acpi_syscont_attach), - DEVMETHOD(device_detach, acpi_syscont_detach), + DEVMETHOD(device_detach, bus_generic_detach), /* Bus interface */ DEVMETHOD(bus_add_child, bus_generic_add_child), @@ -108,13 +107,6 @@ acpi_syscont_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -acpi_syscont_detach(device_t dev) -{ - - return (bus_generic_detach(dev)); -} - static int acpi_syscont_alloc_msi(device_t bus, device_t dev, int count, int maxcount, int *irqs) diff --git a/sys/dev/adb/adb_bus.c b/sys/dev/adb/adb_bus.c index 8c805254a2e6..9e0d1f2a1ce5 100644 --- a/sys/dev/adb/adb_bus.c +++ b/sys/dev/adb/adb_bus.c @@ -42,7 +42,6 @@ static int adb_bus_probe(device_t dev); static int adb_bus_attach(device_t dev); -static int adb_bus_detach(device_t dev); static void adb_bus_enumerate(void *xdev); static void adb_probe_nomatch(device_t dev, device_t child); static int adb_print_child(device_t dev, device_t child); @@ -57,7 +56,7 @@ static device_method_t adb_bus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, adb_bus_probe), DEVMETHOD(device_attach, adb_bus_attach), - DEVMETHOD(device_detach, adb_bus_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), @@ -188,11 +187,6 @@ adb_bus_enumerate(void *xdev) config_intrhook_disestablish(&sc->enum_hook); } -static int adb_bus_detach(device_t dev) -{ - return (bus_generic_detach(dev)); -} - static void adb_probe_nomatch(device_t dev, device_t child) { diff --git a/sys/dev/mdio/mdio.c b/sys/dev/mdio/mdio.c index c34493254e0f..64d3b23c2372 100644 --- a/sys/dev/mdio/mdio.c +++ b/sys/dev/mdio/mdio.c @@ -59,14 +59,6 @@ mdio_attach(device_t dev) return (bus_generic_attach(dev)); } -static int -mdio_detach(device_t dev) -{ - - bus_generic_detach(dev); - return (0); -} - static int mdio_readreg(device_t dev, int phy, int reg) { @@ -108,7 +100,7 @@ static device_method_t mdio_methods[] = { DEVMETHOD(device_identify, mdio_identify), DEVMETHOD(device_probe, mdio_probe), DEVMETHOD(device_attach, mdio_attach), - DEVMETHOD(device_detach, mdio_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), /* bus interface */