Module Name: src Committed By: pgoyette Date: Thu Jul 22 16:35:24 UTC 2010
Modified Files: src/sys/dev/acpi: com_acpi.c Log Message: Even if there's an error in attaching the device (failure to find IRQ resource, or I/O mapping), set-up a power management handler so we can sleep later on. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/sys/dev/acpi/com_acpi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/acpi/com_acpi.c diff -u src/sys/dev/acpi/com_acpi.c:1.31 src/sys/dev/acpi/com_acpi.c:1.32 --- src/sys/dev/acpi/com_acpi.c:1.31 Fri Mar 5 14:00:17 2010 +++ src/sys/dev/acpi/com_acpi.c Thu Jul 22 16:35:24 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: com_acpi.c,v 1.31 2010/03/05 14:00:17 jruoho Exp $ */ +/* $NetBSD: com_acpi.c,v 1.32 2010/07/22 16:35:24 pgoyette Exp $ */ /* * Copyright (c) 2002 Jared D. McNeill <jmcne...@invisible.ca> @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.31 2010/03/05 14:00:17 jruoho Exp $"); +__KERNEL_RCSID(0, "$NetBSD: com_acpi.c,v 1.32 2010/07/22 16:35:24 pgoyette Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -157,7 +157,16 @@ if (!pmf_device_register(self, NULL, com_resume)) aprint_error_dev(self, "couldn't establish a power handler\n"); + goto cleanup; + /* + * In case of irq resource or i/o space mapping error, just set + * a NULL power handler. This may allow us to sleep later on. + */ out: + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(self, "couldn't establish a power handler\n"); + + cleanup: acpi_resource_cleanup(&res); }