diff options
author | Nate Lawson <njl@FreeBSD.org> | 2004-06-29 19:05:20 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2004-06-29 19:05:20 +0000 |
commit | 3ed1dfa11d23c58dcb18253956cf17068669e2e0 (patch) | |
tree | c8ac7f2233245c10e68f59143767dd02e899cf98 | |
parent | 0e01bb05802d9775f73511318064b1ec9bdd2130 (diff) | |
download | src-3ed1dfa11d23c58dcb18253956cf17068669e2e0.tar.gz src-3ed1dfa11d23c58dcb18253956cf17068669e2e0.zip |
Update for acpi_id_probe()
Notes
Notes:
svn path=/head/; revision=131284
-rw-r--r-- | sys/dev/acpi_support/acpi_asus.c | 4 | ||||
-rw-r--r-- | sys/dev/acpi_support/acpi_toshiba.c | 41 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_asus.c | 4 | ||||
-rw-r--r-- | sys/i386/acpica/acpi_toshiba.c | 41 |
4 files changed, 38 insertions, 52 deletions
diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c index 10d97e48edd4..4f0b1f4c8af1 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 bb7ce0bb9881..8c03c9797485 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 diff --git a/sys/i386/acpica/acpi_asus.c b/sys/i386/acpica/acpi_asus.c index 10d97e48edd4..4f0b1f4c8af1 100644 --- a/sys/i386/acpica/acpi_asus.c +++ b/sys/i386/acpica/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/i386/acpica/acpi_toshiba.c b/sys/i386/acpica/acpi_toshiba.c index bb7ce0bb9881..8c03c9797485 100644 --- a/sys/i386/acpica/acpi_toshiba.c +++ b/sys/i386/acpica/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 |