diff options
Diffstat (limited to 'sys/dev/acpi_support')
-rw-r--r-- | sys/dev/acpi_support/acpi_asus.c | 4 | ||||
-rw-r--r-- | sys/dev/acpi_support/acpi_toshiba.c | 41 |
2 files changed, 19 insertions, 26 deletions
diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c index 10d97e4..4f0b1f4 100644 --- a/sys/dev/acpi_support/acpi_asus.c +++ b/sys/dev/acpi_support/acpi_asus.c @@ -208,12 +208,12 @@ acpi_asus_probe(device_t dev) ACPI_BUFFER Buf; ACPI_OBJECT Arg, *Obj; ACPI_OBJECT_LIST Args; + static char *asus_ids[] = { "ATK0100", NULL }; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (!acpi_disabled("asus") && - acpi_get_type(dev) == ACPI_TYPE_DEVICE && - acpi_MatchHid(acpi_get_handle(dev), "ATK0100")) { + ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids)) { sc = device_get_softc(dev); sc->dev = dev; sc->handle = acpi_get_handle(dev); diff --git a/sys/dev/acpi_support/acpi_toshiba.c b/sys/dev/acpi_support/acpi_toshiba.c index bb7ce0b..8c03c97 100644 --- a/sys/dev/acpi_support/acpi_toshiba.c +++ b/sys/dev/acpi_support/acpi_toshiba.c @@ -212,20 +212,15 @@ TUNABLE_INT("hw.acpi.toshiba.enable_fn_keys", &enable_fn_keys); static int acpi_toshiba_probe(device_t dev) { - ACPI_HANDLE h; - int ret = ENXIO; - - h = acpi_get_handle(dev); - if (!acpi_disabled("toshiba") && - acpi_get_type(dev) == ACPI_TYPE_DEVICE && - device_get_unit(dev) == 0 && - (acpi_MatchHid(h, "TOS6200") || - acpi_MatchHid(h, "TOS6207"))) { - device_set_desc(dev, "Toshiba HCI Extras"); - ret = 0; - } + static char *tosh_ids[] = { "TOS6200", "TOS6207", NULL }; - return (ret); + if (acpi_disabled("toshiba") || + ACPI_ID_PROBE(device_get_parent(dev), dev, tosh_ids) == NULL || + device_get_unit(dev) != 0) + return (ENXIO); + + device_set_desc(dev, "Toshiba HCI Extras"); + return (0); } static int @@ -524,18 +519,16 @@ acpi_toshiba_notify(ACPI_HANDLE h, UINT32 notify, void *context) static int acpi_toshiba_video_probe(device_t dev) { - int ret = ENXIO; - - if (!acpi_disabled("toshiba") && - acpi_get_type(dev) == ACPI_TYPE_DEVICE && - device_get_unit(dev) == 0 && - acpi_MatchHid(acpi_get_handle(dev), "TOS6201")) { - device_quiet(dev); - device_set_desc(dev, "Toshiba Video"); - ret = 0; - } + static char *vid_ids[] = { "TOS6201", NULL }; - return (ret); + if (acpi_disabled("toshiba") || + ACPI_ID_PROBE(device_get_parent(dev), dev, vid_ids) == NULL || + device_get_unit(dev) != 0) + return (ENXIO); + + device_quiet(dev); + device_set_desc(dev, "Toshiba Video"); + return (0); } static int |