diff options
author | Nate Lawson <njl@FreeBSD.org> | 2004-08-30 21:35:34 +0000 |
---|---|---|
committer | Nate Lawson <njl@FreeBSD.org> | 2004-08-30 21:35:34 +0000 |
commit | 885128efdc64b63c52985985b6048c75fa61de2c (patch) | |
tree | 07900bf419e0134656745ea015cb0ecafbc7bd10 /sys/dev/fdc/fdc_acpi.c | |
parent | f40c77a223d486288b81f6066433f278efb97993 (diff) | |
download | src-885128efdc64b63c52985985b6048c75fa61de2c.tar.gz src-885128efdc64b63c52985985b6048c75fa61de2c.zip |
Fix _FDI drive type probing. The new fd child is not an ACPI device while
the old one is. Hence we need to evaluate the old one for _FDI since it
has a valid ACPI_HANDLE ivar. This is a minimal fix. Make a note that a
more complete one is to make fdc support the ACPI_HANDLE ivar for its
children.
This and the previous change are MT5 candidates.
Notes
Notes:
svn path=/head/; revision=134534
Diffstat (limited to 'sys/dev/fdc/fdc_acpi.c')
-rw-r--r-- | sys/dev/fdc/fdc_acpi.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/fdc/fdc_acpi.c b/sys/dev/fdc/fdc_acpi.c index 0ee234cce35b..9c0377812b5e 100644 --- a/sys/dev/fdc/fdc_acpi.c +++ b/sys/dev/fdc/fdc_acpi.c @@ -217,7 +217,7 @@ static ACPI_STATUS fdc_acpi_probe_child(ACPI_HANDLE h, device_t *dev, int level, void *arg) { struct fdc_walk_ctx *ctx; - device_t child; + device_t child, old_child; ACPI_BUFFER buf; ACPI_OBJECT *pkg, *obj; ACPI_STATUS status; @@ -241,6 +241,7 @@ fdc_acpi_probe_child(ACPI_HANDLE h, device_t *dev, int level, void *arg) child = fdc_add_child(ctx->dev, "fd", ctx->index); if (child == NULL) goto out; + old_child = *dev; *dev = child; /* Get temporary buffer for _FDI probe. */ @@ -249,8 +250,14 @@ fdc_acpi_probe_child(ACPI_HANDLE h, device_t *dev, int level, void *arg) if (buf.Pointer == NULL) goto out; - /* Evaluate _FDI to get drive type to pass to the child. */ - status = ACPI_EVALUATE_OBJECT(ctx->acpi_dev, *dev, "_FDI", NULL, &buf); + /* + * Evaluate _FDI to get drive type to pass to the child. We use the + * old child here since it has a valid ACPI_HANDLE since it is a + * child of acpi. A better way to implement this would be to make fdc + * support the ACPI handle ivar for its children. + */ + status = ACPI_EVALUATE_OBJECT(ctx->acpi_dev, old_child, "_FDI", NULL, + &buf); if (ACPI_FAILURE(status)) { if (status != AE_NOT_FOUND) device_printf(ctx->dev, "_FDI failed - %#x\n", status); |