summaryrefslogtreecommitdiffstats
path: root/sys/dev/fdc/fdc_acpi.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-08-30 21:35:34 +0000
committernjl <njl@FreeBSD.org>2004-08-30 21:35:34 +0000
commit7f7a949a560854b1fcdeb36fd667af569fd27eb3 (patch)
tree07900bf419e0134656745ea015cb0ecafbc7bd10 /sys/dev/fdc/fdc_acpi.c
parenta6c55dd256ac203335adb170a529b3f84e37b700 (diff)
downloadFreeBSD-src-7f7a949a560854b1fcdeb36fd667af569fd27eb3.zip
FreeBSD-src-7f7a949a560854b1fcdeb36fd667af569fd27eb3.tar.gz
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.
Diffstat (limited to 'sys/dev/fdc/fdc_acpi.c')
-rw-r--r--sys/dev/fdc/fdc_acpi.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/dev/fdc/fdc_acpi.c b/sys/dev/fdc/fdc_acpi.c
index 0ee234c..9c03778 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);
OpenPOWER on IntegriCloud