Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi Destroy the callout(9) when detaching. Also eva...
details: https://anonhg.NetBSD.org/src/rev/9489bd87a215
branches: trunk
changeset: 752563:9489bd87a215
user: jruoho <jruoho%NetBSD.org@localhost>
date: Mon Mar 01 13:16:21 2010 +0000
description:
Destroy the callout(9) when detaching. Also evaluate the removal of the
notify handler before going to demolishing business.
diffstat:
sys/dev/acpi/smbus_acpi.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diffs (44 lines):
diff -r 5b01210c0e9c -r 9489bd87a215 sys/dev/acpi/smbus_acpi.c
--- a/sys/dev/acpi/smbus_acpi.c Mon Mar 01 13:12:19 2010 +0000
+++ b/sys/dev/acpi/smbus_acpi.c Mon Mar 01 13:16:21 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbus_acpi.c,v 1.2 2010/03/01 05:37:37 jruoho Exp $ */
+/* $NetBSD: smbus_acpi.c,v 1.3 2010/03/01 13:16:21 jruoho Exp $ */
/*-
* Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbus_acpi.c,v 1.2 2010/03/01 05:37:37 jruoho Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbus_acpi.c,v 1.3 2010/03/01 13:16:21 jruoho Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -274,18 +274,16 @@
struct acpi_smbus_softc *sc = device_private(self);
ACPI_STATUS rv;
+ rv = AcpiRemoveNotifyHandler(sc->sc_devnode->ad_handle,
+ ACPI_DEVICE_NOTIFY, acpi_smbus_notify_handler);
+
+ if (ACPI_FAILURE(rv))
+ return EBUSY;
+
pmf_device_deregister(self);
callout_halt(&sc->sc_callout, NULL);
-
- rv = AcpiRemoveNotifyHandler(sc->sc_devnode->ad_handle,
- ACPI_DEVICE_NOTIFY, acpi_smbus_notify_handler);
- if (ACPI_FAILURE(rv)) {
- aprint_error_dev(self,
- "unable to deregister DEVICE NOTIFY handler: %s\n",
- AcpiFormatException(rv));
- return EBUSY;
- }
+ callout_destroy(&sc->sc_callout);
mutex_destroy(&sc->sc_i2c_mutex);
Home |
Main Index |
Thread Index |
Old Index