git: 0ac15e476d87 - main - spibus: Use bus_generic_* directly instead of wrappers
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 02 Jan 2025 18:28:32 UTC
The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=0ac15e476d8732bd749768e3fb80e0075f5ad4c0 commit 0ac15e476d8732bd749768e3fb80e0075f5ad4c0 Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2025-01-02 18:25:01 +0000 Commit: John Baldwin <jhb@FreeBSD.org> CommitDate: 2025-01-02 18:25:01 +0000 spibus: Use bus_generic_* directly instead of wrappers Differential Revision: https://reviews.freebsd.org/D47971 --- sys/dev/spibus/acpi_spibus.c | 2 +- sys/dev/spibus/spibus.c | 29 +++-------------------------- sys/dev/spibus/spibusvar.h | 1 - 3 files changed, 4 insertions(+), 28 deletions(-) diff --git a/sys/dev/spibus/acpi_spibus.c b/sys/dev/spibus/acpi_spibus.c index 9bce45b93dba..749113d81220 100644 --- a/sys/dev/spibus/acpi_spibus.c +++ b/sys/dev/spibus/acpi_spibus.c @@ -394,7 +394,7 @@ acpi_spibus_detach(device_t dev) { acpi_spibus_set_power_children(dev, ACPI_STATE_D3, false); - return (spibus_detach(dev)); + return (bus_generic_detach(dev)); } static int diff --git a/sys/dev/spibus/spibus.c b/sys/dev/spibus/spibus.c index f082b9ec171a..a2e2d884851b 100644 --- a/sys/dev/spibus/spibus.c +++ b/sys/dev/spibus/spibus.c @@ -61,29 +61,6 @@ spibus_attach(device_t dev) return (0); } -/* - * Since this is not a self-enumerating bus, and since we always add - * children in attach, we have to always delete children here. - */ -int -spibus_detach(device_t dev) -{ - return (bus_generic_detach(dev)); -} - -static int -spibus_suspend(device_t dev) -{ - return (bus_generic_suspend(dev)); -} - -static -int -spibus_resume(device_t dev) -{ - return (bus_generic_resume(dev)); -} - static int spibus_print_child(device_t dev, device_t child) { @@ -257,10 +234,10 @@ static device_method_t spibus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, spibus_probe), DEVMETHOD(device_attach, spibus_attach), - DEVMETHOD(device_detach, spibus_detach), + DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, spibus_suspend), - DEVMETHOD(device_resume, spibus_resume), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface */ DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), diff --git a/sys/dev/spibus/spibusvar.h b/sys/dev/spibus/spibusvar.h index 6a74f9b1053d..25cd380173ad 100644 --- a/sys/dev/spibus/spibusvar.h +++ b/sys/dev/spibus/spibusvar.h @@ -77,7 +77,6 @@ extern driver_t spibus_driver; extern driver_t ofw_spibus_driver; int spibus_attach(device_t); -int spibus_detach(device_t); device_t spibus_add_child_common(device_t, u_int, const char *, int, size_t); void spibus_child_deleted(device_t, device_t); void spibus_probe_nomatch(device_t, device_t);