diff --git a/sys/dev/acpica/acpi_isab.c b/sys/dev/acpica/acpi_isab.c index c8688daa5471..3d97653b302b 100644 --- a/sys/dev/acpica/acpi_isab.c +++ b/sys/dev/acpica/acpi_isab.c @@ -35,17 +35,14 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include #include -#include #include +#include #include "acpi.h" - #include #include -/* - * Hooks for the ACPI CA debugging infrastructure - */ +/* Hooks for the ACPI CA debugging infrastructure. */ #define _COMPONENT ACPI_BUS ACPI_MODULE_NAME("ISA_ACPI") @@ -54,7 +51,6 @@ struct acpi_isab_softc { ACPI_HANDLE ap_handle; }; - static int acpi_isab_probe(device_t bus); static int acpi_isab_attach(device_t bus); static int acpi_isab_read_ivar(device_t dev, device_t child, int which, @@ -94,14 +90,14 @@ static int acpi_isab_probe(device_t dev) { - if ((acpi_get_type(dev) == ACPI_TYPE_DEVICE) && + if (acpi_get_type(dev) == ACPI_TYPE_DEVICE && !acpi_disabled("isa") && devclass_get_device(isab_devclass, 0) == dev && (acpi_MatchHid(dev, "PNP0A05") || acpi_MatchHid(dev, "PNP0A06"))) { device_set_desc(dev, "ACPI Generic ISA bridge"); - return(0); + return (0); } - return(ENXIO); + return (ENXIO); } static int @@ -124,9 +120,9 @@ acpi_isab_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) struct acpi_isab_softc *sc = device_get_softc(dev); switch (which) { - case ACPI_IVAR_HANDLE: + case ACPI_IVAR_HANDLE: *result = (uintptr_t)sc->ap_handle; - return(0); + return (0); } - return(ENOENT); + return (ENOENT); } diff --git a/sys/dev/acpica/acpi_pci.c b/sys/dev/acpica/acpi_pci.c index c6e95fd56b5c..ae12318f4819 100644 --- a/sys/dev/acpica/acpi_pci.c +++ b/sys/dev/acpica/acpi_pci.c @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include "acpi.h" - #include #include @@ -48,29 +47,27 @@ __FBSDID("$FreeBSD$"); #include "pcib_if.h" #include "pci_if.h" -/* - * Hooks for the ACPI CA debugging infrastructure - */ +/* Hooks for the ACPI CA debugging infrastructure. */ #define _COMPONENT ACPI_BUS ACPI_MODULE_NAME("PCI") struct acpi_pci_devinfo { - struct pci_devinfo ap_dinfo; - ACPI_HANDLE ap_handle; + struct pci_devinfo ap_dinfo; + ACPI_HANDLE ap_handle; }; static int acpi_pci_probe(device_t dev); static int acpi_pci_attach(device_t dev); static int acpi_pci_read_ivar(device_t dev, device_t child, int which, - uintptr_t *result); + uintptr_t *result); static int acpi_pci_child_location_str_method(device_t cbdev, - device_t child, char *buf, size_t buflen); + device_t child, char *buf, size_t buflen); static int acpi_pci_set_powerstate_method(device_t dev, device_t child, - int state); + int state); static ACPI_STATUS acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, - void *context, void **status); + void *context, void **status); static device_method_t acpi_pci_methods[] = { /* Device interface */ @@ -223,22 +220,22 @@ acpi_pci_save_handle(ACPI_HANDLE handle, UINT32 level, void *context, ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (ACPI_FAILURE(acpi_GetInteger(handle, "_ADR", &address))) - return_ACPI_STATUS(AE_OK); + return_ACPI_STATUS (AE_OK); slot = address >> 16; func = address & 0xffff; if (device_get_children((device_t)context, &devlist, &devcount) != 0) - return_ACPI_STATUS(AE_OK); + return_ACPI_STATUS (AE_OK); for (i = 0; i < devcount; i++) { dinfo = device_get_ivars(devlist[i]); if (dinfo->ap_dinfo.cfg.func == func && dinfo->ap_dinfo.cfg.slot == slot) { dinfo->ap_handle = handle; free(devlist, M_TEMP); - return_ACPI_STATUS(AE_OK); + return_ACPI_STATUS (AE_OK); } } free(devlist, M_TEMP); - return_ACPI_STATUS(AE_OK); + return_ACPI_STATUS (AE_OK); } static int @@ -247,11 +244,9 @@ acpi_pci_probe(device_t dev) if (pcib_get_bus(dev) < 0) return (ENXIO); - - device_set_desc(dev, "ACPI PCI bus"); - if (acpi_get_handle(dev) == NULL) return (ENXIO); + device_set_desc(dev, "ACPI PCI bus"); return (0); } @@ -281,7 +276,7 @@ acpi_pci_attach(device_t dev) * these devices. */ pci_add_children(dev, busno, sizeof(struct acpi_pci_devinfo)); - (void) AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1, + AcpiWalkNamespace(ACPI_TYPE_DEVICE, acpi_get_handle(dev), 1, acpi_pci_save_handle, dev, NULL); return (bus_generic_attach(dev)); diff --git a/sys/dev/acpica/acpi_pcib_pci.c b/sys/dev/acpica/acpi_pcib_pci.c index e7ef8e312846..7350829c55f6 100644 --- a/sys/dev/acpica/acpi_pcib_pci.c +++ b/sys/dev/acpica/acpi_pcib_pci.c @@ -32,11 +32,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include +#include #include "acpi.h" - #include #include @@ -44,12 +43,9 @@ __FBSDID("$FreeBSD$"); #include #include #include - #include "pcib_if.h" -/* - * Hooks for the ACPI CA debugging infrastructure - */ +/* Hooks for the ACPI CA debugging infrastructure. */ #define _COMPONENT ACPI_BUS ACPI_MODULE_NAME("PCI_PCI") @@ -60,16 +56,17 @@ struct acpi_pcib_softc { }; struct acpi_pcib_lookup_info { - UINT32 address; - ACPI_HANDLE handle; + UINT32 address; + ACPI_HANDLE handle; }; static int acpi_pcib_pci_probe(device_t bus); static int acpi_pcib_pci_attach(device_t bus); static int acpi_pcib_pci_resume(device_t bus); -static int acpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result); +static int acpi_pcib_read_ivar(device_t dev, device_t child, + int which, uintptr_t *result); static int acpi_pcib_pci_route_interrupt(device_t pcib, - device_t dev, int pin); + device_t dev, int pin); static device_method_t acpi_pcib_pci_methods[] = { /* Device interface */ @@ -112,13 +109,13 @@ static int acpi_pcib_pci_probe(device_t dev) { - if ((pci_get_class(dev) != PCIC_BRIDGE) || - (pci_get_subclass(dev) != PCIS_BRIDGE_PCI) || + if (pci_get_class(dev) != PCIC_BRIDGE || + pci_get_subclass(dev) != PCIS_BRIDGE_PCI || acpi_disabled("pci")) return (ENXIO); if (acpi_get_handle(dev) == NULL) return (ENXIO); - if (!pci_cfgregopen()) + if (pci_cfgregopen() == 0) return (ENXIO); device_set_desc(dev, "ACPI PCI-PCI bridge"); @@ -149,14 +146,14 @@ acpi_pcib_pci_resume(device_t dev) static int acpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result) { - struct acpi_pcib_softc *sc = device_get_softc(dev); + struct acpi_pcib_softc *sc = device_get_softc(dev); switch (which) { - case ACPI_IVAR_HANDLE: + case ACPI_IVAR_HANDLE: *result = (uintptr_t)sc->ap_handle; - return(0); + return (0); } - return(pcib_read_ivar(dev, child, which, result)); + return (pcib_read_ivar(dev, child, which, result)); } static int @@ -171,7 +168,7 @@ acpi_pcib_pci_route_interrupt(device_t pcib, device_t dev, int pin) * for routing interrupts. */ if (sc->ap_prt.Pointer == NULL) - return (pcib_route_interrupt(pcib, dev, pin)); + return (pcib_route_interrupt(pcib, dev, pin)); else - return (acpi_pcib_route_interrupt(pcib, dev, pin, &sc->ap_prt)); + return (acpi_pcib_route_interrupt(pcib, dev, pin, &sc->ap_prt)); }