summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_ec.c
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2009-11-07 11:46:38 +0000
committeravg <avg@FreeBSD.org>2009-11-07 11:46:38 +0000
commit267e9d600c17502bb5a3430fc3e21538dad30ece (patch)
treed6218aa9c94496b63774fe5285d0656daa2020d6 /sys/dev/acpica/acpi_ec.c
parent00f6dd9619458ca98fbfc8c8ae54dddc80c21e62 (diff)
downloadFreeBSD-src-267e9d600c17502bb5a3430fc3e21538dad30ece.zip
FreeBSD-src-267e9d600c17502bb5a3430fc3e21538dad30ece.tar.gz
acpi: remove 'magic' ivar
o acpi_hpet: auto-added 'wildcard' devices can be identified by non-NULL handle attribute. o acpi_ec: auto-add 'wildcard' devices can be identified by unset (NULL) private attribute. o acpi_cpu: use private instead of magic to store cpu id. Reviewed by: jhb Silence from: acpi@ MFC after: 2 weeks X-MFC-Note: perhaps the ivar should stay for ABI stability
Diffstat (limited to 'sys/dev/acpica/acpi_ec.c')
-rw-r--r--sys/dev/acpica/acpi_ec.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/sys/dev/acpica/acpi_ec.c b/sys/dev/acpica/acpi_ec.c
index a5a81dc..b339ba1 100644
--- a/sys/dev/acpica/acpi_ec.c
+++ b/sys/dev/acpica/acpi_ec.c
@@ -129,9 +129,6 @@ struct acpi_ec_params {
int uid;
};
-/* Indicate that this device has already been probed via ECDT. */
-#define DEV_ECDT(x) (acpi_get_magic(x) == (uintptr_t)&acpi_ec_devclass)
-
/*
* Driver softc.
*/
@@ -332,7 +329,6 @@ acpi_ec_ecdt_probe(device_t parent)
params->uid = ecdt->Uid;
acpi_GetInteger(h, "_GLK", &params->glk);
acpi_set_private(child, params);
- acpi_set_magic(child, (uintptr_t)&acpi_ec_devclass);
/* Finish the attach process. */
if (device_probe_and_attach(child) != 0)
@@ -348,6 +344,7 @@ acpi_ec_probe(device_t dev)
ACPI_STATUS status;
device_t peer;
char desc[64];
+ int ecdt;
int ret;
struct acpi_ec_params *params;
static char *ec_ids[] = { "PNP0C09", NULL };
@@ -362,11 +359,12 @@ acpi_ec_probe(device_t dev)
* duplicate probe.
*/
ret = ENXIO;
- params = NULL;
+ ecdt = 0;
buf.Pointer = NULL;
buf.Length = ACPI_ALLOCATE_BUFFER;
- if (DEV_ECDT(dev)) {
- params = acpi_get_private(dev);
+ params = acpi_get_private(dev);
+ if (params != NULL) {
+ ecdt = 1;
ret = 0;
} else if (!acpi_disabled("ec") &&
ACPI_ID_PROBE(device_get_parent(dev), dev, ec_ids)) {
@@ -439,7 +437,7 @@ out:
if (ret == 0) {
snprintf(desc, sizeof(desc), "Embedded Controller: GPE %#x%s%s",
params->gpe_bit, (params->glk) ? ", GLK" : "",
- DEV_ECDT(dev) ? ", ECDT" : "");
+ ecdt ? ", ECDT" : "");
device_set_desc_copy(dev, desc);
}
OpenPOWER on IntegriCloud