diff options
author | 2016-03-28 19:12:17 +0000 | |
---|---|---|
committer | 2016-03-28 19:12:17 +0000 | |
commit | 6272444167e2f3651ffd3555ab2d66cc099f5692 (patch) | |
tree | de84241d8aaa1cfcd8278c6b4b3f23164e61287b | |
parent | Remove handrolled #define FREE and use free(3) directly without wrapping (diff) | |
download | wireguard-openbsd-6272444167e2f3651ffd3555ab2d66cc099f5692.tar.xz wireguard-openbsd-6272444167e2f3651ffd3555ab2d66cc099f5692.zip |
Adding each and every new acpi device driver to acpi_foundhid() is
gettinga bit of the burden. And it really isn't how our autoconf
framework is supposed to work for busses that can be enumerated. All
the drivers already check for a matching _HID in their attach
function. So we can just drop the checks in acpi_foundhid() and let
the drivers sort themselves out.
Print a "not configured" line for devices for which we don't attach adriver.
This may be a bit much as there are devices for which we will not have a
driver. This will be removed if it causes too much dmesg spam.
ok deraadt@, mlarkin@
-rw-r--r-- | sys/dev/acpi/acpi.c | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 6ae2f2d549f..881bf3636ef 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: acpi.c,v 1.305 2016/01/17 09:04:18 jsg Exp $ */ +/* $OpenBSD: acpi.c,v 1.306 2016/03/28 19:12:17 kettenis Exp $ */ /* * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com> * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> @@ -1155,6 +1155,8 @@ acpi_print(void *aux, const char *pnp) if (pnp) { if (aa->aaa_name) printf("%s at %s", aa->aaa_name, pnp); + else if (aa->aaa_dev) + printf("\"%s\" at %s", aa->aaa_dev, pnp); else return (QUIET); } @@ -2778,37 +2780,16 @@ acpi_foundhid(struct aml_node *node, void *arg) aaa.aaa_node = node->parent; aaa.aaa_dev = dev; - if (!strcmp(dev, ACPI_DEV_AC)) { - aaa.aaa_name = "acpiac"; - } else if (!strcmp(dev, ACPI_DEV_CMB)) { - aaa.aaa_name = "acpibat"; - } else if (!strcmp(dev, ACPI_DEV_LD) || - !strcmp(dev, ACPI_DEV_PBD) || - !strcmp(dev, ACPI_DEV_SBD)) { - aaa.aaa_name = "acpibtn"; - } else if (!strcmp(dev, ACPI_DEV_ASUS) || + if (!strcmp(dev, ACPI_DEV_ASUS) || !strcmp(dev, ACPI_DEV_ASUS1)) { - aaa.aaa_name = "acpiasus"; acpi_asus_enabled = 1; } else if (!strcmp(dev, ACPI_DEV_IBM) || !strcmp(dev, ACPI_DEV_LENOVO)) { - aaa.aaa_name = "acpithinkpad"; acpi_thinkpad_enabled = 1; - } else if (!strcmp(dev, ACPI_DEV_ASUSAIBOOSTER)) { - aaa.aaa_name = "aibs"; } else if (!strcmp(dev, ACPI_DEV_TOSHIBA_LIBRETTO) || !strcmp(dev, ACPI_DEV_TOSHIBA_DYNABOOK) || !strcmp(dev, ACPI_DEV_TOSHIBA_SPA40)) { - aaa.aaa_name = "acpitoshiba"; acpi_toshiba_enabled = 1; - } else if (!strcmp(dev, "80860F14") || !strcmp(dev, "PNP0FFF")) { - aaa.aaa_name = "sdhc"; - } else if (!strcmp(dev, ACPI_DEV_DWIIC1) || - !strcmp(dev, ACPI_DEV_DWIIC2) || - !strcmp(dev, ACPI_DEV_DWIIC3) || - !strcmp(dev, ACPI_DEV_DWIIC4) || - !strcmp(dev, ACPI_DEV_DWIIC5)) { - aaa.aaa_name = "dwiic"; } #ifndef SMALL_KERNEL @@ -2822,8 +2803,7 @@ acpi_foundhid(struct aml_node *node, void *arg) } #endif - if (aaa.aaa_name) - config_found(self, &aaa, acpi_print); + config_found(self, &aaa, acpi_print); return (0); } |