Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/acpica/acpi_button.c
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | DRIVER_MODULE(acpi_button, acpi, acpi_button_driver, acpi_button_devclass, | ||||
0, 0); | 0, 0); | ||||
MODULE_DEPEND(acpi_button, acpi, 1, 1, 1); | MODULE_DEPEND(acpi_button, acpi, 1, 1, 1); | ||||
static int | static int | ||||
acpi_button_probe(device_t dev) | acpi_button_probe(device_t dev) | ||||
{ | { | ||||
struct acpi_button_softc *sc; | struct acpi_button_softc *sc; | ||||
char *str; | char *str; | ||||
int rv; | |||||
if (acpi_disabled("button") || | if (acpi_disabled("button")) | ||||
(str = ACPI_ID_PROBE(device_get_parent(dev), dev, btn_ids)) == NULL) | |||||
return (ENXIO); | return (ENXIO); | ||||
rv = ACPI_ID_PROBE(device_get_parent(dev), dev, btn_ids, &str); | |||||
if (rv > 0) | |||||
jhb: Space after 'if'. | |||||
return (ENXIO); | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
if (strcmp(str, "PNP0C0C") == 0) { | if (strcmp(str, "PNP0C0C") == 0) { | ||||
device_set_desc(dev, "Power Button"); | device_set_desc(dev, "Power Button"); | ||||
sc->button_type = ACPI_POWER_BUTTON; | sc->button_type = ACPI_POWER_BUTTON; | ||||
} else if (strcmp(str, "ACPI_FPB") == 0) { | } else if (strcmp(str, "ACPI_FPB") == 0) { | ||||
device_set_desc(dev, "Power Button (fixed)"); | device_set_desc(dev, "Power Button (fixed)"); | ||||
sc->button_type = ACPI_POWER_BUTTON; | sc->button_type = ACPI_POWER_BUTTON; | ||||
sc->fixed = 1; | sc->fixed = 1; | ||||
} else if (strcmp(str, "PNP0C0E") == 0) { | } else if (strcmp(str, "PNP0C0E") == 0) { | ||||
device_set_desc(dev, "Sleep Button"); | device_set_desc(dev, "Sleep Button"); | ||||
sc->button_type = ACPI_SLEEP_BUTTON; | sc->button_type = ACPI_SLEEP_BUTTON; | ||||
} else if (strcmp(str, "ACPI_FSB") == 0) { | } else if (strcmp(str, "ACPI_FSB") == 0) { | ||||
device_set_desc(dev, "Sleep Button (fixed)"); | device_set_desc(dev, "Sleep Button (fixed)"); | ||||
sc->button_type = ACPI_SLEEP_BUTTON; | sc->button_type = ACPI_SLEEP_BUTTON; | ||||
sc->fixed = 1; | sc->fixed = 1; | ||||
} | } | ||||
return (0); | return (rv); | ||||
} | } | ||||
static int | static int | ||||
acpi_button_attach(device_t dev) | acpi_button_attach(device_t dev) | ||||
{ | { | ||||
struct acpi_prw_data prw; | struct acpi_prw_data prw; | ||||
struct acpi_button_softc *sc; | struct acpi_button_softc *sc; | ||||
ACPI_STATUS status; | ACPI_STATUS status; | ||||
▲ Show 20 Lines • Show All 147 Lines • Show Last 20 Lines |
Space after 'if'.