diff options
| author | Takanori Watanabe <takawata@FreeBSD.org> | 2018-10-26 00:05:46 +0000 |
|---|---|---|
| committer | Takanori Watanabe <takawata@FreeBSD.org> | 2018-10-26 00:05:46 +0000 |
| commit | 5efca36fbda65afe7726d685dcc43a707ef76447 (patch) | |
| tree | 582c853f814a4acc5c72bf510ec4ba7b180e75c3 /sys/dev/acpi_support | |
| parent | fef4815e9af171e64f6156bf7b97bb7424b8a22b (diff) | |
Notes
Diffstat (limited to 'sys/dev/acpi_support')
| -rw-r--r-- | sys/dev/acpi_support/acpi_asus.c | 13 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_fujitsu.c | 9 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_ibm.c | 11 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_panasonic.c | 10 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_rapidstart.c | 10 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_sony.c | 6 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_toshiba.c | 17 | ||||
| -rw-r--r-- | sys/dev/acpi_support/acpi_wmi.c | 11 | ||||
| -rw-r--r-- | sys/dev/acpi_support/atk0110.c | 10 |
9 files changed, 56 insertions, 41 deletions
diff --git a/sys/dev/acpi_support/acpi_asus.c b/sys/dev/acpi_support/acpi_asus.c index 86cd8b7bf69b..5111146b0a3e 100644 --- a/sys/dev/acpi_support/acpi_asus.c +++ b/sys/dev/acpi_support/acpi_asus.c @@ -549,15 +549,16 @@ acpi_asus_probe(device_t dev) ACPI_OBJECT Arg, *Obj; ACPI_OBJECT_LIST Args; static char *asus_ids[] = { "ATK0100", "ASUS010", NULL }; + int rv; char *rstr; ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__); if (acpi_disabled("asus")) return (ENXIO); - rstr = ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids); - if (rstr == NULL) { - return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, asus_ids, &rstr); + if (rv > 0) { + return (rv); } sc = device_get_softc(dev); @@ -595,7 +596,7 @@ acpi_asus_probe(device_t dev) sc->model = &acpi_samsung_models[0]; device_set_desc(dev, "Samsung P30 Laptop Extras"); AcpiOsFree(Buf.Pointer); - return (0); + return (rv); } /* EeePC */ @@ -603,7 +604,7 @@ acpi_asus_probe(device_t dev) sc->model = &acpi_eeepc_models[0]; device_set_desc(dev, "ASUS EeePC"); AcpiOsFree(Buf.Pointer); - return (0); + return (rv); } } @@ -627,7 +628,7 @@ good: sbuf_delete(sb); AcpiOsFree(Buf.Pointer); - return (0); + return (rv); } /* diff --git a/sys/dev/acpi_support/acpi_fujitsu.c b/sys/dev/acpi_support/acpi_fujitsu.c index 6f96bc5ce443..98fd1fe0e36a 100644 --- a/sys/dev/acpi_support/acpi_fujitsu.c +++ b/sys/dev/acpi_support/acpi_fujitsu.c @@ -228,16 +228,15 @@ acpi_fujitsu_probe(device_t dev) { char *name; char buffer[64]; + int rv; - name = ACPI_ID_PROBE(device_get_parent(dev), dev, fujitsu_ids); - if (acpi_disabled("fujitsu") || name == NULL || - device_get_unit(dev) > 1) + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, fujitsu_ids, &name); + if (acpi_disabled("fujitsu") || rv > 0 || device_get_unit(dev) > 1) return (ENXIO); - sprintf(buffer, "Fujitsu Function Hotkeys %s", name); device_set_desc_copy(dev, buffer); - return (0); + return (rv); } static int diff --git a/sys/dev/acpi_support/acpi_ibm.c b/sys/dev/acpi_support/acpi_ibm.c index d5f77475d81e..c6e7c3c75969 100644 --- a/sys/dev/acpi_support/acpi_ibm.c +++ b/sys/dev/acpi_support/acpi_ibm.c @@ -411,14 +411,17 @@ acpi_ibm_mic_led_set (struct acpi_ibm_softc *sc, int arg) static int acpi_ibm_probe(device_t dev) { + int rv; + if (acpi_disabled("ibm") || - ACPI_ID_PROBE(device_get_parent(dev), dev, ibm_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, ibm_ids, NULL); - device_set_desc(dev, "IBM ThinkPad ACPI Extras"); - - return (0); + if (rv <= 0) + device_set_desc(dev, "IBM ThinkPad ACPI Extras"); + + return (rv); } static int diff --git a/sys/dev/acpi_support/acpi_panasonic.c b/sys/dev/acpi_support/acpi_panasonic.c index 4a90256e46b9..87683aee7b47 100644 --- a/sys/dev/acpi_support/acpi_panasonic.c +++ b/sys/dev/acpi_support/acpi_panasonic.c @@ -137,14 +137,16 @@ static int acpi_panasonic_probe(device_t dev) { static char *mat_ids[] = { "MAT0019", NULL }; - + int rv; + if (acpi_disabled("panasonic") || - ACPI_ID_PROBE(device_get_parent(dev), dev, mat_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, mat_ids, NULL); - device_set_desc(dev, "Panasonic Notebook Hotkeys"); - return (0); + if (rv <= 0) + device_set_desc(dev, "Panasonic Notebook Hotkeys"); + return (rv); } static int diff --git a/sys/dev/acpi_support/acpi_rapidstart.c b/sys/dev/acpi_support/acpi_rapidstart.c index f28414cef371..4b896338db80 100644 --- a/sys/dev/acpi_support/acpi_rapidstart.c +++ b/sys/dev/acpi_support/acpi_rapidstart.c @@ -62,14 +62,16 @@ static char *rapidstart_ids[] = {"INT3392", NULL}; static int acpi_rapidstart_probe(device_t dev) { + int rv; + if (acpi_disabled("rapidstart") || - ACPI_ID_PROBE(device_get_parent(dev), dev, rapidstart_ids) == NULL || device_get_unit(dev) != 0) return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, rapidstart_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Intel Rapid Start ACPI device"); - device_set_desc(dev, "Intel Rapid Start ACPI device"); - - return (0); + return (rv); } diff --git a/sys/dev/acpi_support/acpi_sony.c b/sys/dev/acpi_support/acpi_sony.c index fc5c6519e4b5..97c35d58f412 100644 --- a/sys/dev/acpi_support/acpi_sony.c +++ b/sys/dev/acpi_support/acpi_sony.c @@ -114,11 +114,11 @@ static char *sny_id[] = {"SNY5001", NULL}; static int acpi_sony_probe(device_t dev) { - int ret = ENXIO; + int ret; - if (ACPI_ID_PROBE(device_get_parent(dev), dev, sny_id)) { + ret = ACPI_ID_PROBE(device_get_parent(dev), dev, sny_id, NULL); + if (ret <= 0) { device_set_desc(dev, "Sony notebook controller"); - ret = 0; } return (ret); } diff --git a/sys/dev/acpi_support/acpi_toshiba.c b/sys/dev/acpi_support/acpi_toshiba.c index 8d5a9cef535d..612a12ea621d 100644 --- a/sys/dev/acpi_support/acpi_toshiba.c +++ b/sys/dev/acpi_support/acpi_toshiba.c @@ -220,14 +220,15 @@ static int acpi_toshiba_probe(device_t dev) { static char *tosh_ids[] = { "TOS6200", "TOS6207", "TOS6208", NULL }; + int rv; 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); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, tosh_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Toshiba HCI Extras"); + return (rv); } static int @@ -543,15 +544,17 @@ static int acpi_toshiba_video_probe(device_t dev) { static char *vid_ids[] = { "TOS6201", NULL }; + int rv; 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); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, vid_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "Toshiba Video"); + return (rv); } static int diff --git a/sys/dev/acpi_support/acpi_wmi.c b/sys/dev/acpi_support/acpi_wmi.c index d8185b9f067e..bda7137881a7 100644 --- a/sys/dev/acpi_support/acpi_wmi.c +++ b/sys/dev/acpi_support/acpi_wmi.c @@ -208,12 +208,15 @@ static char *wmi_ids[] = {"PNP0C14", NULL}; static int acpi_wmi_probe(device_t dev) { - if (acpi_disabled("wmi") || - ACPI_ID_PROBE(device_get_parent(dev), dev, wmi_ids) == NULL) + int rv; + + if (acpi_disabled("wmi")) return (ENXIO); - device_set_desc(dev, "ACPI-WMI mapping"); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, wmi_ids, NULL); + if (rv <= 0) + device_set_desc(dev, "ACPI-WMI mapping"); - return (0); + return (rv); } /* diff --git a/sys/dev/acpi_support/atk0110.c b/sys/dev/acpi_support/atk0110.c index ee6abd15716d..e6dd8e86cf53 100644 --- a/sys/dev/acpi_support/atk0110.c +++ b/sys/dev/acpi_support/atk0110.c @@ -122,11 +122,13 @@ static char* aibs_hids[] = { static int aibs_probe(device_t dev) { - if (acpi_disabled("aibs") || - ACPI_ID_PROBE(device_get_parent(dev), dev, aibs_hids) == NULL) - return (ENXIO); + int rv; - device_set_desc(dev, "ASUSTeK AI Booster (ACPI ASOC ATK0110)"); + if (acpi_disabled("aibs")) + return (ENXIO); + rv = ACPI_ID_PROBE(device_get_parent(dev), dev, aibs_hids, NULL); + if (rv <= 0 ) + device_set_desc(dev, "ASUSTeK AI Booster (ACPI ASOC ATK0110)"); return (0); } |
