Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Even if there's an error in attaching the devic...
details: https://anonhg.NetBSD.org/src/rev/ad1ec50d0dee
branches: trunk
changeset: 756546:ad1ec50d0dee
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Thu Jul 22 16:35:24 2010 +0000
description:
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.
diffstat:
sys/dev/acpi/com_acpi.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (35 lines):
diff -r c9d77612bbd6 -r ad1ec50d0dee sys/dev/acpi/com_acpi.c
--- a/sys/dev/acpi/com_acpi.c Thu Jul 22 14:10:14 2010 +0000
+++ b/sys/dev/acpi/com_acpi.c Thu Jul 22 16:35:24 2010 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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);
}
Home |
Main Index |
Thread Index |
Old Index